[ Index ]
 

Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/admin/ -> languages.php (source)

   1  <?php
   2  //

   3  // +----------------------------------------------------------------------+

   4  // |zen-cart Open Source E-commerce                                       |

   5  // +----------------------------------------------------------------------+

   6  // | Copyright (c) 2006 The zen-cart developers                           |

   7  // |                                                                      |

   8  // | http://www.zen-cart.com/index.php                                    |

   9  // |                                                                      |

  10  // | Portions Copyright (c) 2003 osCommerce                               |

  11  // +----------------------------------------------------------------------+

  12  // | This source file is subject to version 2.0 of the GPL license,       |

  13  // | that is bundled with this package in the file LICENSE, and is        |

  14  // | available through the world-wide-web at the following url:           |

  15  // | http://www.zen-cart.com/license/2_0.txt.                             |

  16  // | If you did not receive a copy of the zen-cart license and are unable |

  17  // | to obtain it through the world-wide-web, please send a note to       |

  18  // | license@zen-cart.com so we can mail you a copy immediately.          |

  19  // +----------------------------------------------------------------------+

  20  //  $Id: languages.php 3813 2006-06-20 03:49:38Z ajeh $

  21  
  22    require ('includes/application_top.php');
  23    $action = (isset($_GET['action']) ? $_GET['action'] : '');
  24    if (zen_not_null($action)) {
  25      switch ($action) {
  26        case 'insert':
  27          $name = zen_db_prepare_input($_POST['name']);
  28          $code = zen_db_prepare_input($_POST['code']);
  29          $image = zen_db_prepare_input($_POST['image']);
  30          $directory = zen_db_prepare_input($_POST['directory']);
  31          $sort_order = zen_db_prepare_input((int)$_POST['sort_order']);
  32          $check = $db->Execute("select * from " . TABLE_LANGUAGES . " where code = '" . $code . "'");
  33          if ($check->RecordCount() > 0) {
  34            $messageStack->add(ERROR_DUPLICATE_LANGUAGE_CODE, 'error');
  35          } else {
  36  
  37            $db->Execute("insert into " . TABLE_LANGUAGES . "
  38                          (name, code, image, directory, sort_order)
  39                          values ('" . zen_db_input($name) . "', '" . zen_db_input($code) . "',
  40                                  '" . zen_db_input($image) . "', '" . zen_db_input($directory) . "',
  41                                  '" . zen_db_input($sort_order) . "')");
  42  
  43            $insert_id = $db->Insert_ID();
  44  
  45            // set default, if selected

  46            if (isset($_POST['default']) && ($_POST['default'] == 'on')) {
  47              $db->Execute("update " . TABLE_CONFIGURATION . "
  48                            set configuration_value = '" . zen_db_input($code) . "'
  49                            where configuration_key = 'DEFAULT_LANGUAGE'");
  50            }
  51  
  52  // create additional categories_description records

  53            $categories = $db->Execute("select c.categories_id, cd.categories_name,
  54                                        categories_description
  55                                        from " . TABLE_CATEGORIES . " c
  56                                        left join " . TABLE_CATEGORIES_DESCRIPTION . " cd
  57                                        on c.categories_id = cd.categories_id
  58                                        where cd.language_id = '" . (int)$_SESSION['languages_id'] . "'");
  59  
  60            while (!$categories->EOF) {
  61              $db->Execute("insert into " . TABLE_CATEGORIES_DESCRIPTION . "
  62                            (categories_id, language_id, categories_name,
  63                            categories_description)
  64                            values ('" . (int)$categories->fields['categories_id'] . "', '" . (int)$insert_id . "',
  65                                    '" . zen_db_input($categories->fields['categories_name']) . "',
  66                                    '" . zen_db_input($categories->fields['categories_description']) . "')");
  67              $categories->MoveNext();
  68            }
  69  
  70  // create additional products_description records

  71            $products = $db->Execute("select p.products_id, pd.products_name, pd.products_description,
  72                                             pd.products_url
  73                                      from " . TABLE_PRODUCTS . " p
  74                                      left join " . TABLE_PRODUCTS_DESCRIPTION . " pd
  75                                      on p.products_id = pd.products_id
  76                                      where pd.language_id = '" . (int)$_SESSION['languages_id'] . "'");
  77  
  78            while (!$products->EOF) {
  79              $db->Execute("insert into " . TABLE_PRODUCTS_DESCRIPTION . "
  80                          (products_id, language_id, products_name, products_description, products_url)
  81                          values ('" . (int)$products->fields['products_id'] . "',
  82                                  '" . (int)$insert_id . "',
  83                                  '" . zen_db_input($products->fields['products_name']) . "',
  84                                  '" . zen_db_input($products->fields['products_description']) . "',
  85                                  '" . zen_db_input($products->fields['products_url']) . "')");
  86              $products->MoveNext();
  87            }
  88  
  89  // create additional meta_tags_products_description records

  90            $meta_tags_products = $db->Execute("select mt.products_id, mt.metatags_title, mt.metatags_keywords,
  91                                             mt.metatags_description
  92                                      from " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION. " mt
  93                                      where mt.language_id = '" . (int)$_SESSION['languages_id'] . "'");
  94  
  95            while (!$meta_tags_products->EOF) {
  96              $db->Execute("insert into " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . "
  97                          (products_id, language_id, metatags_title, metatags_keywords, metatags_description)
  98                          values ('" . (int)$meta_tags_products->fields['products_id'] . "',
  99                                  '" . (int)$insert_id . "',
 100                                  '" . zen_db_input($meta_tags_products->fields['metatags_title']) . "',
 101                                  '" . zen_db_input($meta_tags_products->fields['metatags_keywords']) . "',
 102                                  '" . zen_db_input($meta_tags_products->fields['metatags_description']) . "')");
 103              $meta_tags_products->MoveNext();
 104            }
 105  
 106  // create additional meta_tags_categories_description records

 107            $meta_tags_categories = $db->Execute("select mt.categories_id, mt.metatags_title, mt.metatags_keywords,
 108                                             mt.metatags_description
 109                                      from " . TABLE_METATAGS_CATEGORIES_DESCRIPTION. " mt
 110                                      where mt.language_id = '" . (int)$_SESSION['languages_id'] . "'");
 111  
 112            while (!$meta_tags_categories->EOF) {
 113              $db->Execute("insert into " . TABLE_METATAGS_CATEGORIES_DESCRIPTION . "
 114                          (categories_id, language_id, metatags_title, metatags_keywords, metatags_description)
 115                          values ('" . (int)$meta_tags_categories->fields['categories_id'] . "',
 116                                  '" . (int)$insert_id . "',
 117                                  '" . zen_db_input($meta_tags_categories->fields['metatags_title']) . "',
 118                                  '" . zen_db_input($meta_tags_categories->fields['metatags_keywords']) . "',
 119                                  '" . zen_db_input($meta_tags_categories->fields['metatags_description']) . "')");
 120              $meta_tags_categories->MoveNext();
 121            }
 122  
 123  // create additional products_options records

 124            $products_options = $db->Execute("select products_options_id, products_options_name,
 125                                products_options_sort_order, products_options_type, products_options_length, products_options_comment, products_options_size,
 126                                products_options_images_per_row, products_options_images_style
 127                                             from " . TABLE_PRODUCTS_OPTIONS . "
 128                                             where language_id = '" . (int)$_SESSION['languages_id'] . "'");
 129  
 130            while (!$products_options->EOF) {
 131              $db->Execute("insert into " . TABLE_PRODUCTS_OPTIONS . "
 132                            (products_options_id, language_id, products_options_name,
 133                             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)
 134                            values ('" . (int)$products_options->fields['products_options_id'] . "',
 135                                    '" . (int)$insert_id . "',
 136                                    '" . zen_db_input($products_options->fields['products_options_name']) . "',
 137                                    '" . zen_db_input($products_options->fields['products_options_sort_order']) . "',
 138                                    '" . zen_db_input($products_options->fields['products_options_type']) . "',
 139                                    '" . zen_db_input($products_options->fields['products_options_length']) . "',
 140                                    '" . zen_db_input($products_options->fields['products_options_comment']) . "',
 141                                    '" . zen_db_input($products_options->fields['products_options_size']) . "',
 142                                    '" . zen_db_input($products_options->fields['products_options_images_per_row']) . "',
 143                                    '" . zen_db_input($products_options->fields['products_options_images_style']) . "')");
 144  
 145              $products_options->MoveNext();
 146            }
 147  
 148  // create additional products_options_values records

 149            $products_options_values = $db->Execute("select products_options_values_id,
 150                                                     products_options_values_name, products_options_values_sort_order
 151                             from " . TABLE_PRODUCTS_OPTIONS_VALUES . "
 152                             where language_id = '" . (int)$_SESSION['languages_id'] . "'");
 153  
 154            while (!$products_options_values->EOF) {
 155              $db->Execute("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES . "
 156                          (products_options_values_id, language_id, products_options_values_name, products_options_values_sort_order)
 157                           values ('" . (int)$products_options_values->fields['products_options_values_id'] . "',
 158                                   '" . (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']) . "')");
 159  
 160              $products_options_values->MoveNext();
 161            }
 162  
 163  // create additional manufacturers_info records

 164            $manufacturers = $db->Execute("select m.manufacturers_id, mi.manufacturers_url
 165                                         from " . TABLE_MANUFACTURERS . " m
 166                             left join " . TABLE_MANUFACTURERS_INFO . " mi
 167                             on m.manufacturers_id = mi.manufacturers_id
 168                             where mi.languages_id = '" . (int)$_SESSION['languages_id'] . "'");
 169  
 170            while (!$manufacturers->EOF) {
 171              $db->Execute("insert into " . TABLE_MANUFACTURERS_INFO . "
 172                           (manufacturers_id, languages_id, manufacturers_url)
 173                            values ('" . $manufacturers->fields['manufacturers_id'] . "', '" . (int)$insert_id . "',
 174                                    '" . zen_db_input($manufacturers->fields['manufacturers_url']) . "')");
 175  
 176              $manufacturers->MoveNext();
 177            }
 178  
 179  // create additional orders_status records

 180            $orders_status = $db->Execute("select orders_status_id, orders_status_name
 181                                           from " . TABLE_ORDERS_STATUS . "
 182                                           where language_id = '" . (int)$_SESSION['languages_id'] . "'");
 183  
 184            while (!$orders_status->EOF) {
 185              $db->Execute("insert into " . TABLE_ORDERS_STATUS . "
 186                            (orders_status_id, language_id, orders_status_name)
 187                            values ('" . (int)$orders_status->fields['orders_status_id'] . "',
 188                                    '" . (int)$insert_id . "',
 189                                    '" . zen_db_input($orders_status->fields['orders_status_name']) . "')");
 190              $orders_status->MoveNext();
 191            }
 192  
 193            // create additional coupons_description records

 194            $coupons = $db->Execute("select c.coupon_id, cd.coupon_name, cd.coupon_description
 195                                      from " . TABLE_COUPONS . " c
 196                                      left join " . TABLE_COUPONS_DESCRIPTION . " cd
 197                                      on c.coupon_id = cd.coupon_id
 198                                      where cd.language_id = '" . (int)$_SESSION['languages_id'] . "'");
 199  
 200            while (!$coupons->EOF) {
 201              $db->Execute("insert into " . TABLE_COUPONS_DESCRIPTION . "
 202                            (coupon_id, language_id, coupon_name, coupon_description)
 203                             values ('" . (int)$coupons->fields['coupon_id'] . "',
 204                                     '" . (int)$insert_id . "',
 205                                     '" . zen_db_input($coupons->fields['coupon_name']) . "',
 206                                     '" . zen_db_input($coupons->fields['coupon_description']) . "')");
 207              $coupons->MoveNext();
 208            }
 209  
 210            zen_redirect(zen_href_link(FILENAME_LANGUAGES, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'lID=' . $insert_id));
 211          }
 212  
 213          break;
 214        case 'save':
 215          //prepare/sanitize inputs

 216          $lID = zen_db_prepare_input($_GET['lID']);
 217          $name = zen_db_prepare_input($_POST['name']);
 218          $code = zen_db_prepare_input($_POST['code']);
 219          $image = zen_db_prepare_input($_POST['image']);
 220          $directory = zen_db_prepare_input($_POST['directory']);
 221          $sort_order = zen_db_prepare_input($_POST['sort_order']);
 222  
 223          // 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)

 224  // get "code" for the language we just updated

 225          $result = $db->Execute("select code from " . TABLE_LANGUAGES . " where languages_id = '" . (int)$lID . "'");
 226  // compare "code" vs DEFAULT_LANGUAGE

 227          $changing_default_lang = (DEFAULT_LANGUAGE == $result->fields['code']) ? true : false;
 228  // compare whether "code" matches $code (which was just submitted in the edit form

 229          $default_needs_an_update = (DEFAULT_LANGUAGE == $code) ? false : true;
 230  // if we just edited the default language id's name, then we need to update the database with the new name for default

 231          $default_lang_change_flag = ($default_needs_an_update && $changing_default_lang) ? true : false;
 232  
 233          // save new language settings

 234          $db->Execute("update " . TABLE_LANGUAGES . "
 235                        set name = '" . zen_db_input($name) . "', code = '" . zen_db_input($code) . "',
 236                        image = '" . zen_db_input($image) . "', directory = '" . zen_db_input($directory) . "',
 237                        sort_order = '" . zen_db_input($sort_order) . "'
 238                        where languages_id = '" . (int)$lID . "'");
 239  
 240          // update default language setting

 241          if ((isset($_POST['default']) && $_POST['default'] == 'on') || $default_lang_change_flag == true) {
 242            $db->Execute("update " . TABLE_CONFIGURATION . "
 243                          set configuration_value = '" . zen_db_input(substr($code,0,2)) . "'
 244                          where configuration_key = 'DEFAULT_LANGUAGE'");
 245          }
 246          zen_redirect(zen_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $_GET['lID']));
 247          break;
 248        case 'deleteconfirm':
 249          // demo active test

 250          if (zen_admin_demo()) {
 251            $_GET['action']= '';
 252            $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
 253            zen_redirect(zen_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page']));
 254          }
 255          $lID = zen_db_prepare_input($_GET['lID']);
 256          $lng = $db->Execute("select languages_id
 257                               from " . TABLE_LANGUAGES . "
 258                               where code = '" . DEFAULT_CURRENCY . "'");
 259  
 260          if ($lng->fields['languages_id'] == $lID) {
 261            $db->Execute("update " . TABLE_CONFIGURATION . "
 262                          set configuration_value = ''
 263                          where configuration_key = 'DEFAULT_CURRENCY'");
 264          }
 265          $db->Execute("delete from " . TABLE_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
 266          $db->Execute("delete from " . TABLE_PRODUCTS_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
 267          $db->Execute("delete from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . (int)$lID . "'");
 268          $db->Execute("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where language_id = '" . (int)$lID . "'");
 269          $db->Execute("delete from " . TABLE_MANUFACTURERS_INFO . " where languages_id = '" . (int)$lID . "'");
 270          $db->Execute("delete from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$lID . "'");
 271          $db->Execute("delete from " . TABLE_LANGUAGES . " where languages_id = '" . (int)$lID . "'");
 272          $db->Execute("delete from " . TABLE_COUPONS_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
 273          $db->Execute("delete from " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
 274          $db->Execute("delete from " . TABLE_METATAGS_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
 275          zen_redirect(zen_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page']));
 276          break;
 277        case 'delete':
 278          $lID = zen_db_prepare_input($_GET['lID']);
 279          $lng = $db->Execute("select code from " . TABLE_LANGUAGES . " where languages_id = '" . (int)$lID . "'");
 280          $remove_language = true;
 281          if ($lng->fields['code'] == DEFAULT_LANGUAGE) {
 282            $remove_language = false;
 283            $messageStack->add(ERROR_REMOVE_DEFAULT_LANGUAGE, 'error');
 284          }
 285          break;
 286      }
 287    }
 288  ?>
 289  <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
 290  <html <?php echo HTML_PARAMS; ?>>
 291  <head>
 292  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
 293  <title><?php echo TITLE; ?></title>
 294  <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
 295  <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
 296  <script language="javascript" src="includes/menu.js"></script>
 297  <script language="javascript" src="includes/general.js"></script>
 298  <script type="text/javascript">
 299    <!--
 300    function init()
 301    {
 302      cssjsmenu('navbar');
 303      if (document.getElementById)
 304      {
 305        var kill = document.getElementById('hoverJS');
 306        kill.disabled = true;
 307      }
 308    }
 309    // -->

 310  </script>
 311  </head>
 312  <body onLoad="init()">
 313  <!-- header //-->
 314  <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
 315  <!-- header_eof //-->
 316  <!-- body //-->
 317  <table border="0" width="100%" cellspacing="2" cellpadding="2">
 318    <tr>
 319  <!-- body_text //-->
 320      <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 321        <tr>
 322          <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
 323            <tr>
 324              <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
 325              <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
 326            </tr>
 327          </table></td>
 328        </tr>
 329        <tr>
 330          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
 331            <tr>
 332              <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 333                <tr class="dataTableHeadingRow">
 334                  <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LANGUAGE_NAME; ?></td>
 335                  <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LANGUAGE_CODE; ?></td>
 336                  <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
 337                </tr>
 338  <?php
 339    $languages_query_raw = "select languages_id, name, code, image, directory, sort_order from " . TABLE_LANGUAGES . " order by sort_order";
 340    $languages_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $languages_query_raw, $languages_query_numrows);
 341    $languages = $db->Execute($languages_query_raw);
 342    while (!$languages->EOF) {
 343      if ((!isset($_GET['lID']) || (isset($_GET['lID']) && ($_GET['lID'] == $languages->fields['languages_id']))) && !isset($lInfo) && (substr($action, 0, 3) != 'new')) {
 344        $lInfo = new objectInfo($languages->fields);
 345      }
 346      if (isset($lInfo) && is_object($lInfo) && ($languages->fields['languages_id'] == $lInfo->languages_id) ) {
 347        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";
 348      } else {
 349        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";
 350      }
 351      if (DEFAULT_LANGUAGE == $languages->fields['code']) {
 352        echo '                <td class="dataTableContent"><b>' . $languages->fields['name'] . ' (' . TEXT_DEFAULT . ')</b></td>' . "\n";
 353      } else {
 354        echo '                <td class="dataTableContent">' . $languages->fields['name'] . '</td>' . "\n";
 355      }
 356  ?>
 357                  <td class="dataTableContent"><?php echo $languages->fields['code']; ?></td>
 358                  <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>
 359                </tr>
 360  <?php
 361      $languages->MoveNext();
 362    }
 363  ?>
 364                <tr>
 365                  <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 366                    <tr>
 367                      <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>
 368                      <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>
 369                    </tr>
 370  <?php
 371    if (empty($action)) {
 372  ?>
 373                    <tr>
 374                      <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>
 375                    </tr>
 376  <?php
 377    }
 378  ?>
 379                  </table></td>
 380                </tr>
 381              </table></td>
 382  <?php
 383    $heading = array();
 384    $contents = array();
 385    switch ($action) {
 386      case 'new':
 387        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_LANGUAGE . '</b>');
 388        $contents = array('form' => zen_draw_form('languages', FILENAME_LANGUAGES, 'action=insert'));
 389        $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
 390        $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_NAME . '<br>' . zen_draw_input_field('name'));
 391        $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_CODE . '<br>' . zen_draw_input_field('code', '', 'maxlength="2" size="4"'));
 392        $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_IMAGE . '<br>' . zen_draw_input_field('image', 'icon.gif'));
 393        $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_DIRECTORY . '<br>' . zen_draw_input_field('directory'));
 394        $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_SORT_ORDER . '<br>' . zen_draw_input_field('sort_order'));
 395        $contents[] = array('text' => '<br>' . zen_draw_checkbox_field('default') . ' ' . TEXT_SET_DEFAULT);
 396        $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>');
 397        break;
 398      case 'edit':
 399        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_LANGUAGE . '</b>');
 400        $contents = array('form' => zen_draw_form('languages', FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $lInfo->languages_id . '&action=save'));
 401        $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
 402        $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_NAME . '<br>' . zen_draw_input_field('name', $lInfo->name));
 403        $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_CODE . '<br>' . zen_draw_input_field('code', $lInfo->code, 'maxlength="2" size="4"'));
 404        $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_IMAGE . '<br>' . zen_draw_input_field('image', $lInfo->image));
 405        $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_DIRECTORY . '<br>' . zen_draw_input_field('directory', $lInfo->directory));
 406        $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_SORT_ORDER . '<br>' . zen_draw_input_field('sort_order', $lInfo->sort_order));
 407        if (DEFAULT_LANGUAGE != $lInfo->code) $contents[] = array('text' => '<br>' . zen_draw_checkbox_field('default') . ' ' . TEXT_SET_DEFAULT);
 408        $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>');
 409        break;
 410      case 'delete':
 411        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_LANGUAGE . '</b>');
 412        $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
 413        $contents[] = array('text' => '<br><b>' . $lInfo->name . '</b>');
 414        $contents[] = array('align' => 'center', 'text' => '<br>' . (($remove_language) ? '<a href="' . zen_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $lInfo->languages_id . '&action=deleteconfirm') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>' : '') . ' <a href="' . zen_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $lInfo->languages_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
 415        break;
 416      default:
 417        if (is_object($lInfo)) {
 418          $heading[] = array('text' => '<b>' . $lInfo->name . '</b>');
 419          $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>');
 420          $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_NAME . ' ' . $lInfo->name);
 421          $contents[] = array('text' => TEXT_INFO_LANGUAGE_CODE . ' ' . $lInfo->code);
 422          $contents[] = array('text' => '<br>' . zen_image(DIR_WS_CATALOG_LANGUAGES . $lInfo->directory . '/images/' . $lInfo->image, $lInfo->name));
 423          $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_DIRECTORY . '<br>' . DIR_WS_CATALOG_LANGUAGES . '<b>' . $lInfo->directory . '</b>');
 424          $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_SORT_ORDER . ' ' . $lInfo->sort_order);
 425        }
 426        break;
 427    }
 428  
 429    if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
 430      echo '            <td width="25%" valign="top">' . "\n";
 431      $box = new box;
 432      echo $box->infoBox($heading, $contents);
 433      echo '            </td>' . "\n";
 434    }
 435  ?>
 436            </tr>
 437          </table></td>
 438        </tr>
 439      </table></td>
 440  <!-- body_text_eof //-->
 441    </tr>
 442  </table>
 443  <!-- body_eof //-->
 444  <!-- footer //-->
 445  <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
 446  <!-- footer_eof //-->
 447  <br>
 448  </body>
 449  </html>
 450  <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>


Généré le : Mon Nov 26 16:45:43 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics