ZenCart_Documentation  1.5.0
http://www.collinsharper.com
C:/xampp/htdocs/zen-cart/admin/languages.php
Go to the documentation of this file.
00001 <?php
00010   require('includes/application_top.php');
00011   $action = (isset($_GET['action']) ? $_GET['action'] : '');
00012   if (zen_not_null($action)) {
00013     switch ($action) {
00014       case 'insert':
00015         $name = zen_db_prepare_input($_POST['name']);
00016         $code = zen_db_prepare_input($_POST['code']);
00017         $image = zen_db_prepare_input($_POST['image']);
00018         $directory = zen_db_prepare_input($_POST['directory']);
00019         $sort_order = zen_db_prepare_input((int)$_POST['sort_order']);
00020         $check = $db->Execute("select * from " . TABLE_LANGUAGES . " where code = '" . $code . "'");
00021         if ($check->RecordCount() > 0) {
00022           $messageStack->add(ERROR_DUPLICATE_LANGUAGE_CODE, 'error');
00023         } else {
00024 
00025           $db->Execute("insert into " . TABLE_LANGUAGES . "
00026                         (name, code, image, directory, sort_order)
00027                         values ('" . zen_db_input($name) . "', '" . zen_db_input($code) . "',
00028                                 '" . zen_db_input($image) . "', '" . zen_db_input($directory) . "',
00029                                 '" . zen_db_input($sort_order) . "')");
00030 
00031           $insert_id = $db->Insert_ID();
00032 
00033           // set default, if selected
00034           if (isset($_POST['default']) && ($_POST['default'] == 'on')) {
00035             $db->Execute("update " . TABLE_CONFIGURATION . "
00036                           set configuration_value = '" . zen_db_input($code) . "'
00037                           where configuration_key = 'DEFAULT_LANGUAGE'");
00038           }
00039 
00040 // create additional categories_description records
00041           $categories = $db->Execute("select c.categories_id, cd.categories_name,
00042                                       categories_description
00043                                       from " . TABLE_CATEGORIES . " c
00044                                       left join " . TABLE_CATEGORIES_DESCRIPTION . " cd
00045                                       on c.categories_id = cd.categories_id
00046                                       where cd.language_id = '" . (int)$_SESSION['languages_id'] . "'");
00047 
00048           while (!$categories->EOF) {
00049             $db->Execute("insert into " . TABLE_CATEGORIES_DESCRIPTION . "
00050                           (categories_id, language_id, categories_name,
00051                           categories_description)
00052                           values ('" . (int)$categories->fields['categories_id'] . "', '" . (int)$insert_id . "',
00053                                   '" . zen_db_input($categories->fields['categories_name']) . "',
00054                                   '" . zen_db_input($categories->fields['categories_description']) . "')");
00055             $categories->MoveNext();
00056           }
00057 
00058 // create additional products_description records
00059           $products = $db->Execute("select p.products_id, pd.products_name, pd.products_description,
00060                                            pd.products_url
00061                                     from " . TABLE_PRODUCTS . " p
00062                                     left join " . TABLE_PRODUCTS_DESCRIPTION . " pd
00063                                     on p.products_id = pd.products_id
00064                                     where pd.language_id = '" . (int)$_SESSION['languages_id'] . "'");
00065 
00066           while (!$products->EOF) {
00067             $db->Execute("insert into " . TABLE_PRODUCTS_DESCRIPTION . "
00068                         (products_id, language_id, products_name, products_description, products_url)
00069                         values ('" . (int)$products->fields['products_id'] . "',
00070                                 '" . (int)$insert_id . "',
00071                                 '" . zen_db_input($products->fields['products_name']) . "',
00072                                 '" . zen_db_input($products->fields['products_description']) . "',
00073                                 '" . zen_db_input($products->fields['products_url']) . "')");
00074             $products->MoveNext();
00075           }
00076 
00077 // create additional meta_tags_products_description records
00078           $meta_tags_products = $db->Execute("select mt.products_id, mt.metatags_title, mt.metatags_keywords,
00079                                            mt.metatags_description
00080                                     from " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION. " mt
00081                                     where mt.language_id = '" . (int)$_SESSION['languages_id'] . "'");
00082 
00083           while (!$meta_tags_products->EOF) {
00084             $db->Execute("insert into " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . "
00085                         (products_id, language_id, metatags_title, metatags_keywords, metatags_description)
00086                         values ('" . (int)$meta_tags_products->fields['products_id'] . "',
00087                                 '" . (int)$insert_id . "',
00088                                 '" . zen_db_input($meta_tags_products->fields['metatags_title']) . "',
00089                                 '" . zen_db_input($meta_tags_products->fields['metatags_keywords']) . "',
00090                                 '" . zen_db_input($meta_tags_products->fields['metatags_description']) . "')");
00091             $meta_tags_products->MoveNext();
00092           }
00093 
00094 // create additional meta_tags_categories_description records
00095           $meta_tags_categories = $db->Execute("select mt.categories_id, mt.metatags_title, mt.metatags_keywords,
00096                                            mt.metatags_description
00097                                     from " . TABLE_METATAGS_CATEGORIES_DESCRIPTION. " mt
00098                                     where mt.language_id = '" . (int)$_SESSION['languages_id'] . "'");
00099 
00100           while (!$meta_tags_categories->EOF) {
00101             $db->Execute("insert into " . TABLE_METATAGS_CATEGORIES_DESCRIPTION . "
00102                         (categories_id, language_id, metatags_title, metatags_keywords, metatags_description)
00103                         values ('" . (int)$meta_tags_categories->fields['categories_id'] . "',
00104                                 '" . (int)$insert_id . "',
00105                                 '" . zen_db_input($meta_tags_categories->fields['metatags_title']) . "',
00106                                 '" . zen_db_input($meta_tags_categories->fields['metatags_keywords']) . "',
00107                                 '" . zen_db_input($meta_tags_categories->fields['metatags_description']) . "')");
00108             $meta_tags_categories->MoveNext();
00109           }
00110 
00111 // create additional products_options records
00112           $products_options = $db->Execute("select products_options_id, products_options_name,
00113                               products_options_sort_order, products_options_type, products_options_length, products_options_comment, products_options_size,
00114                               products_options_images_per_row, products_options_images_style
00115                                            from " . TABLE_PRODUCTS_OPTIONS . "
00116                                            where language_id = '" . (int)$_SESSION['languages_id'] . "'");
00117 
00118           while (!$products_options->EOF) {
00119             $db->Execute("insert into " . TABLE_PRODUCTS_OPTIONS . "
00120                           (products_options_id, language_id, products_options_name,
00121                            products_options_sort_order, products_options_type, products_options_length, products_options_comment, products_options_size, products_options_images_per_row, products_options_images_style)
00122                           values ('" . (int)$products_options->fields['products_options_id'] . "',
00123                                   '" . (int)$insert_id . "',
00124                                   '" . zen_db_input($products_options->fields['products_options_name']) . "',
00125                                   '" . zen_db_input($products_options->fields['products_options_sort_order']) . "',
00126                                   '" . zen_db_input($products_options->fields['products_options_type']) . "',
00127                                   '" . zen_db_input($products_options->fields['products_options_length']) . "',
00128                                   '" . zen_db_input($products_options->fields['products_options_comment']) . "',
00129                                   '" . zen_db_input($products_options->fields['products_options_size']) . "',
00130                                   '" . zen_db_input($products_options->fields['products_options_images_per_row']) . "',
00131                                   '" . zen_db_input($products_options->fields['products_options_images_style']) . "')");
00132 
00133             $products_options->MoveNext();
00134           }
00135 
00136 // create additional products_options_values records
00137           $products_options_values = $db->Execute("select products_options_values_id,
00138                                                    products_options_values_name, products_options_values_sort_order
00139                            from " . TABLE_PRODUCTS_OPTIONS_VALUES . "
00140                            where language_id = '" . (int)$_SESSION['languages_id'] . "'");
00141 
00142           while (!$products_options_values->EOF) {
00143             $db->Execute("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES . "
00144                         (products_options_values_id, language_id, products_options_values_name, products_options_values_sort_order)
00145                          values ('" . (int)$products_options_values->fields['products_options_values_id'] . "',
00146                                  '" . (int)$insert_id . "', '" . zen_db_input($products_options_values->fields['products_options_values_name']) . "', '" . zen_db_input($products_options_values->fields['products_options_values_sort_order']) . "')");
00147 
00148             $products_options_values->MoveNext();
00149           }
00150 
00151 // create additional manufacturers_info records
00152           $manufacturers = $db->Execute("select m.manufacturers_id, mi.manufacturers_url
00153                                        from " . TABLE_MANUFACTURERS . " m
00154                            left join " . TABLE_MANUFACTURERS_INFO . " mi
00155                            on m.manufacturers_id = mi.manufacturers_id
00156                            where mi.languages_id = '" . (int)$_SESSION['languages_id'] . "'");
00157 
00158           while (!$manufacturers->EOF) {
00159             $db->Execute("insert into " . TABLE_MANUFACTURERS_INFO . "
00160                          (manufacturers_id, languages_id, manufacturers_url)
00161                           values ('" . $manufacturers->fields['manufacturers_id'] . "', '" . (int)$insert_id . "',
00162                                   '" . zen_db_input($manufacturers->fields['manufacturers_url']) . "')");
00163 
00164             $manufacturers->MoveNext();
00165           }
00166 
00167 // create additional orders_status records
00168           $orders_status = $db->Execute("select orders_status_id, orders_status_name
00169                                          from " . TABLE_ORDERS_STATUS . "
00170                                          where language_id = '" . (int)$_SESSION['languages_id'] . "'");
00171 
00172           while (!$orders_status->EOF) {
00173             $db->Execute("insert into " . TABLE_ORDERS_STATUS . "
00174                           (orders_status_id, language_id, orders_status_name)
00175                           values ('" . (int)$orders_status->fields['orders_status_id'] . "',
00176                                   '" . (int)$insert_id . "',
00177                                   '" . zen_db_input($orders_status->fields['orders_status_name']) . "')");
00178             $orders_status->MoveNext();
00179           }
00180 
00181           // create additional coupons_description records
00182           $coupons = $db->Execute("select c.coupon_id, cd.coupon_name, cd.coupon_description
00183                                     from " . TABLE_COUPONS . " c
00184                                     left join " . TABLE_COUPONS_DESCRIPTION . " cd
00185                                     on c.coupon_id = cd.coupon_id
00186                                     where cd.language_id = '" . (int)$_SESSION['languages_id'] . "'");
00187 
00188           while (!$coupons->EOF) {
00189             $db->Execute("insert into " . TABLE_COUPONS_DESCRIPTION . "
00190                           (coupon_id, language_id, coupon_name, coupon_description)
00191                            values ('" . (int)$coupons->fields['coupon_id'] . "',
00192                                    '" . (int)$insert_id . "',
00193                                    '" . zen_db_input($coupons->fields['coupon_name']) . "',
00194                                    '" . zen_db_input($coupons->fields['coupon_description']) . "')");
00195             $coupons->MoveNext();
00196           }
00197 
00198           zen_redirect(zen_href_link(FILENAME_LANGUAGES, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'lID=' . $insert_id));
00199         }
00200 
00201         break;
00202       case 'save':
00203         //prepare/sanitize inputs
00204         $lID = zen_db_prepare_input($_GET['lID']);
00205         $name = zen_db_prepare_input($_POST['name']);
00206         $code = zen_db_prepare_input($_POST['code']);
00207         $image = zen_db_prepare_input($_POST['image']);
00208         $directory = zen_db_prepare_input($_POST['directory']);
00209         $sort_order = zen_db_prepare_input($_POST['sort_order']);
00210 
00211         // check if the spelling of the name for the default language has just been changed (thus meaning we need to change the spelling of DEFAULT_LANGUAGE to match it)
00212 // get "code" for the language we just updated
00213         $result = $db->Execute("select code from " . TABLE_LANGUAGES . " where languages_id = '" . (int)$lID . "'");
00214 // compare "code" vs DEFAULT_LANGUAGE
00215         $changing_default_lang = (DEFAULT_LANGUAGE == $result->fields['code']) ? true : false;
00216 // compare whether "code" matches $code (which was just submitted in the edit form
00217         $default_needs_an_update = (DEFAULT_LANGUAGE == $code) ? false : true;
00218 // if we just edited the default language id's name, then we need to update the database with the new name for default
00219         $default_lang_change_flag = ($default_needs_an_update && $changing_default_lang) ? true : false;
00220 
00221         // save new language settings
00222         $db->Execute("update " . TABLE_LANGUAGES . "
00223                       set name = '" . zen_db_input($name) . "', code = '" . zen_db_input($code) . "',
00224                       image = '" . zen_db_input($image) . "', directory = '" . zen_db_input($directory) . "',
00225                       sort_order = '" . zen_db_input($sort_order) . "'
00226                       where languages_id = '" . (int)$lID . "'");
00227 
00228         // update default language setting
00229         if ((isset($_POST['default']) && $_POST['default'] == 'on') || $default_lang_change_flag == true) {
00230           $db->Execute("update " . TABLE_CONFIGURATION . "
00231                         set configuration_value = '" . zen_db_input(substr($code,0,2)) . "'
00232                         where configuration_key = 'DEFAULT_LANGUAGE'");
00233         }
00234         zen_redirect(zen_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $_GET['lID']));
00235         break;
00236       case 'deleteconfirm':
00237         // demo active test
00238         if (zen_admin_demo()) {
00239           $_GET['action']= '';
00240           $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
00241           zen_redirect(zen_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page']));
00242         }
00243         $lID = zen_db_prepare_input($_POST['lID']);
00244         $lng = $db->Execute("select languages_id
00245                              from " . TABLE_LANGUAGES . "
00246                              where code = '" . DEFAULT_LANGUAGE . "'");
00247 
00248         if ($lng->fields['languages_id'] == $lID) {
00249           $db->Execute("update " . TABLE_CONFIGURATION . "
00250                         set configuration_value = ''
00251                         where configuration_key = 'DEFAULT_LANGUAGE'");
00252         }
00253         $db->Execute("delete from " . TABLE_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
00254         $db->Execute("delete from " . TABLE_PRODUCTS_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
00255         $db->Execute("delete from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . (int)$lID . "'");
00256         $db->Execute("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where language_id = '" . (int)$lID . "'");
00257         $db->Execute("delete from " . TABLE_MANUFACTURERS_INFO . " where languages_id = '" . (int)$lID . "'");
00258         $db->Execute("delete from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$lID . "'");
00259         $db->Execute("delete from " . TABLE_LANGUAGES . " where languages_id = '" . (int)$lID . "'");
00260         $db->Execute("delete from " . TABLE_COUPONS_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
00261         $db->Execute("delete from " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
00262         $db->Execute("delete from " . TABLE_METATAGS_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
00263 
00264         // if we just deleted our currently-selected language, need to switch to default lang:
00265         $lng = $db->Execute("select languages_id from " . TABLE_LANGUAGES . " where code = '" . DEFAULT_LANGUAGE . "'");
00266         if ((int)$_SESSION['languages_id'] == (int)$_POST['lID'])  $_SESSION['languages_id'] = $lng->fields['languages_id'];
00267 
00268         zen_redirect(zen_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page']));
00269         break;
00270       case 'delete':
00271         $lID = zen_db_prepare_input($_GET['lID']);
00272         $lng = $db->Execute("select code from " . TABLE_LANGUAGES . " where languages_id = '" . (int)$lID . "'");
00273         $remove_language = true;
00274         if ($lng->fields['code'] == DEFAULT_LANGUAGE) {
00275           $remove_language = false;
00276           $messageStack->add(ERROR_REMOVE_DEFAULT_LANGUAGE, 'error');
00277         }
00278         break;
00279     }
00280   }
00281 ?>
00282 <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
00283 <html <?php echo HTML_PARAMS; ?>>
00284 <head>
00285 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
00286 <title><?php echo TITLE; ?></title>
00287 <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
00288 <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
00289 <script language="javascript" src="includes/menu.js"></script>
00290 <script language="javascript" src="includes/general.js"></script>
00291 <script type="text/javascript">
00292   <!--
00293   function init()
00294   {
00295     cssjsmenu('navbar');
00296     if (document.getElementById)
00297     {
00298       var kill = document.getElementById('hoverJS');
00299       kill.disabled = true;
00300     }
00301   }
00302   // -->
00303 </script>
00304 </head>
00305 <body onLoad="init()">
00306 <!-- header //-->
00307 <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
00308 <!-- header_eof //-->
00309 <!-- body //-->
00310 <table border="0" width="100%" cellspacing="2" cellpadding="2">
00311   <tr>
00312 <!-- body_text //-->
00313     <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
00314       <tr>
00315         <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
00316           <tr>
00317             <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
00318             <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
00319           </tr>
00320         </table></td>
00321       </tr>
00322       <tr>
00323         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
00324           <tr>
00325             <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
00326               <tr class="dataTableHeadingRow">
00327                 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LANGUAGE_NAME; ?></td>
00328                 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LANGUAGE_CODE; ?></td>
00329                 <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
00330               </tr>
00331 <?php
00332   $languages_query_raw = "select languages_id, name, code, image, directory, sort_order from " . TABLE_LANGUAGES . " order by sort_order";
00333   $languages_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $languages_query_raw, $languages_query_numrows);
00334   $languages = $db->Execute($languages_query_raw);
00335   while (!$languages->EOF) {
00336     if ((!isset($_GET['lID']) || (isset($_GET['lID']) && ($_GET['lID'] == $languages->fields['languages_id']))) && !isset($lInfo) && (substr($action, 0, 3) != 'new')) {
00337       $lInfo = new objectInfo($languages->fields);
00338     }
00339     if (isset($lInfo) && is_object($lInfo) && ($languages->fields['languages_id'] == $lInfo->languages_id) ) {
00340       echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $lInfo->languages_id . '&action=edit') . '\'">' . "\n";
00341     } else {
00342       echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $languages->fields['languages_id']) . '\'">' . "\n";
00343     }
00344     if (DEFAULT_LANGUAGE == $languages->fields['code']) {
00345       echo '                <td class="dataTableContent"><b>' . $languages->fields['name'] . ' (' . TEXT_DEFAULT . ')</b></td>' . "\n";
00346     } else {
00347       echo '                <td class="dataTableContent">' . $languages->fields['name'] . '</td>' . "\n";
00348     }
00349 ?>
00350                 <td class="dataTableContent"><?php echo $languages->fields['code']; ?></td>
00351                 <td class="dataTableContent" align="right"><?php if (isset($lInfo) && is_object($lInfo) && ($languages->fields['languages_id'] == $lInfo->languages_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . zen_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $languages->fields['languages_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
00352               </tr>
00353 <?php
00354     $languages->MoveNext();
00355   }
00356 ?>
00357               <tr>
00358                 <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
00359                   <tr>
00360                     <td class="smallText" valign="top"><?php echo $languages_split->display_count($languages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_LANGUAGES); ?></td>
00361                     <td class="smallText" align="right"><?php echo $languages_split->display_links($languages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></td>
00362                   </tr>
00363 <?php
00364   if (empty($action)) {
00365 ?>
00366                   <tr>
00367                     <td align="right" colspan="2"><?php echo '<a href="' . zen_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $lInfo->languages_id . '&action=new') . '">' . zen_image_button('button_new_language.gif', IMAGE_NEW_LANGUAGE) . '</a>'; ?></td>
00368                   </tr>
00369 <?php
00370   }
00371 ?>
00372                 </table></td>
00373               </tr>
00374             </table></td>
00375 <?php
00376   $heading = array();
00377   $contents = array();
00378   switch ($action) {
00379     case 'new':
00380       $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_LANGUAGE . '</b>');
00381       $contents = array('form' => zen_draw_form('languages', FILENAME_LANGUAGES, 'action=insert'));
00382       $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
00383       $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_NAME . '<br>' . zen_draw_input_field('name'));
00384       $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_CODE . '<br>' . zen_draw_input_field('code', '', 'maxlength="2" size="4"'));
00385       $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_IMAGE . '<br>' . zen_draw_input_field('image', 'icon.gif'));
00386       $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_DIRECTORY . '<br>' . zen_draw_input_field('directory'));
00387       $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_SORT_ORDER . '<br>' . zen_draw_input_field('sort_order'));
00388       $contents[] = array('text' => '<br>' . zen_draw_checkbox_field('default') . ' ' . TEXT_SET_DEFAULT);
00389       $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . zen_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $_GET['lID']) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
00390       break;
00391     case 'edit':
00392       $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_LANGUAGE . '</b>');
00393       $contents = array('form' => zen_draw_form('languages', FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $lInfo->languages_id . '&action=save'));
00394       $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
00395       $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_NAME . '<br>' . zen_draw_input_field('name', htmlspecialchars($lInfo->name, ENT_COMPAT, CHARSET, TRUE)));
00396       $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_CODE . '<br>' . zen_draw_input_field('code', $lInfo->code, 'maxlength="2" size="4"'));
00397       $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_IMAGE . '<br>' . zen_draw_input_field('image', $lInfo->image));
00398       $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_DIRECTORY . '<br>' . zen_draw_input_field('directory', $lInfo->directory));
00399       $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_SORT_ORDER . '<br>' . zen_draw_input_field('sort_order', $lInfo->sort_order));
00400       if (DEFAULT_LANGUAGE != $lInfo->code) $contents[] = array('text' => '<br>' . zen_draw_checkbox_field('default') . ' ' . TEXT_SET_DEFAULT);
00401       $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . zen_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $lInfo->languages_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
00402       break;
00403     case 'delete':
00404       $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_LANGUAGE . '</b>');
00405       $contents = array('form'=>zen_draw_form('delete', FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&action=deleteconfirm') . zen_draw_hidden_field('lID', $lInfo->languages_id));
00406       $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
00407       $contents[] = array('text' => '<br><b>' . $lInfo->name . '</b>');
00408       $contents[] = array('text'=> (($remove_language) ? zen_image_submit('button_delete.gif', IMAGE_DELETE) : '') . ' <a href="' . zen_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $_GET['lID']) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>', 'align'=>'center');
00409       break;
00410     default:
00411       if (is_object($lInfo)) {
00412         $heading[] = array('text' => '<b>' . $lInfo->name . '</b>');
00413         $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $lInfo->languages_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $lInfo->languages_id . '&action=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
00414         $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_NAME . ' ' . $lInfo->name);
00415         $contents[] = array('text' => TEXT_INFO_LANGUAGE_CODE . ' ' . $lInfo->code);
00416         $contents[] = array('text' => '<br>' . zen_image(DIR_WS_CATALOG_LANGUAGES . $lInfo->directory . '/images/' . $lInfo->image, $lInfo->name));
00417         $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_DIRECTORY . '<br>' . DIR_WS_CATALOG_LANGUAGES . '<b>' . $lInfo->directory . '</b>');
00418         $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_SORT_ORDER . ' ' . $lInfo->sort_order);
00419       }
00420       break;
00421   }
00422 
00423   if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
00424     echo '            <td width="25%" valign="top">' . "\n";
00425     $box = new box;
00426     echo $box->infoBox($heading, $contents);
00427     echo '            </td>' . "\n";
00428   }
00429 ?>
00430           </tr>
00431         </table></td>
00432       </tr>
00433     </table></td>
00434 <!-- body_text_eof //-->
00435   </tr>
00436 </table>
00437 <!-- body_eof //-->
00438 <!-- footer //-->
00439 <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
00440 <!-- footer_eof //-->
00441 <br>
00442 </body>
00443 </html>
00444 <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
 All Data Structures Namespaces Files Functions Variables Enumerations