[ 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]

/includes/modules/ -> ezpages_bar_header.php (source)

   1  <?php
   2  /**

   3   * ezpages_bar_header - used to display links to EZ-Pages content horizontally as a header element

   4   *

   5   * @package templateSystem

   6   * @copyright Copyright 2003-2006 Zen Cart Development Team

   7   * @copyright Portions Copyright 2003 osCommerce

   8   * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0

   9   * @version $Id: ezpages_bar_header.php 3179 2006-03-12 22:31:33Z drbyte $

  10   */
  11  if (!defined('IS_ADMIN_FLAG')) {
  12    die('Illegal Access');
  13  }
  14  $zco_notifier->notify('NOTIFY_START_EZPAGES_HEADERBAR');
  15  
  16  // test if bar should display:

  17  if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) {
  18    if (isset($var_linksList)) {
  19      unset($var_linksList);
  20    }
  21    $page_query = $db->Execute("select * from " . TABLE_EZPAGES . " where status_header = 1 and header_sort_order > 0 order by header_sort_order, pages_title");
  22    if ($page_query->RecordCount()>0) {
  23      $rows = 0;
  24      while (!$page_query->EOF) {
  25        $rows++;
  26        $page_query_list_header[$rows]['id'] = $page_query->fields['pages_id'];
  27        $page_query_list_header[$rows]['name'] = $page_query->fields['pages_title'];
  28        $page_query_list_header[$rows]['altURL'] = '';
  29  
  30        // if altURL is specified, check to see if it starts with "http", and if so, create direct URL, otherwise use a zen href link

  31        switch (true) {
  32          // external link new window or same window

  33          case ($page_query->fields['alt_url_external'] != ''):
  34          $page_query_list_header[$rows]['altURL']  = $page_query->fields['alt_url_external'];
  35          break;
  36          // internal link new window

  37          case ($page_query->fields['alt_url'] != '' and $page_query->fields['page_open_new_window'] == '1'):
  38          $page_query_list_header[$rows]['altURL']  = (substr($page_query->fields['alt_url'],0,4) == 'http') ?
  39          $page_query->fields['alt_url'] :
  40          ($page_query->fields['alt_url']=='' ? '' : zen_href_link($page_query->fields['alt_url'], 'target="_blank', ($page_query->fields['page_is_ssl']=='0' ? 'NONSSL' : 'SSL'), true, true, true));
  41          break;
  42          // internal link same window

  43          case ($page_query->fields['alt_url'] != '' and $page_query->fields['page_open_new_window'] == '0'):
  44          $page_query_list_header[$rows]['altURL']  = (substr($page_query->fields['alt_url'],0,4) == 'http') ?
  45          $page_query->fields['alt_url'] :
  46          ($page_query->fields['alt_url']=='' ? '' : zen_href_link($page_query->fields['alt_url'], '', ($page_query->fields['page_is_ssl']=='0' ? 'NONSSL' : 'SSL'), true, true, true));
  47          break;
  48        }
  49  
  50        // if altURL is specified, use it; otherwise, use EZPage ID to create link

  51        $page_query_list_header[$rows]['link'] = ($page_query_list_header[$rows]['altURL'] =='') ?
  52        zen_href_link(FILENAME_EZPAGES, 'id=' . $page_query->fields['pages_id'] . '&chapter=' . $page_query->fields['toc_chapter'], ($page_query->fields['page_is_ssl']=='0' ? 'NONSSL' : 'SSL')) :
  53        $page_query_list_header[$rows]['altURL'];
  54        $page_query_list_header[$rows]['link'] .= ($page_query->fields['page_open_new_window'] == '1' ? '" target="_blank' : '');
  55  
  56        $page_query->MoveNext();
  57      }
  58  
  59      $var_linksList = $page_query_list_header;
  60    }
  61  } // display

  62  
  63  $zco_notifier->notify('NOTIFY_END_EZPAGES_HEADERBAR');
  64  ?>


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