[ 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/includes/init_includes/ -> init_html_editor.php (source)

   1  <?php
   2  /**

   3   * @package htmleditors

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

   5   * @copyright Portions Copyright 2003 osCommerce

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

   7   * @version $Id: init_html_editor.php 4247 2006-08-24 14:58:42Z drbyte $

   8   */
   9  if (!defined('IS_ADMIN_FLAG')) {
  10    die('Illegal Access');
  11  }
  12  /**

  13   * List of installed editors should be here:

  14   * CONSTANTS are used for language-specific display names, and are defined in languages/extra_definitions/editors_list.php

  15   */
  16    $editors_list['NONE']      = array('desc' => EDITOR_NONE,      'handler' => '',              'special_needs' => '');
  17    $editors_list['HTMLAREA']  = array('desc' => EDITOR_HTMLAREA,  'handler' => 'htmlarea.php',  'special_needs' => '');
  18  //  $editors_list['FCKEDITOR'] = array('desc' => EDITOR_FCKEDITOR, 'handler' => 'fckeditor.php', 'special_needs' => '');

  19  //  $editors_list['TINYMCE']   = array('desc' => EDITOR_TINYMCE,   'handler' => 'tinymce.php',   'special_needs' => '');

  20  
  21  
  22  
  23  /******* ADDITIONAL EDITORS CAN BE ADDED ABOVE THIS LINE *******/

  24  
  25  /**

  26   * Prepare pulldown menu for use in various pages where editor selections should be offered

  27   */
  28    $editors_pulldown = array();
  29    $i = 0;
  30    foreach($editors_list as $key=>$value) {
  31        $i++;
  32      $editors_pulldown[] = array('id' => $i, 'text' => $value['desc'], 'key' => $key);
  33    }
  34  /**

  35   * Session default is set if no preference has been chosen during this login session

  36   */
  37    if (!isset($_SESSION['html_editor_preference_status'])) {
  38      $_SESSION['html_editor_preference_status'] = HTML_EDITOR_PREFERENCE;
  39    }
  40  /**

  41   * If a new preference has been selected via a pulldown menu, set the details:

  42   */
  43    $new_editor_choice = (isset($_GET['action']) && $_GET['action'] == 'set_editor' && isset($_GET['reset_editor'])) ? $_GET['reset_editor'] : -1;
  44  
  45  /** 

  46   * Set a few variables for use in admin pages

  47   *

  48   * $_SESSION['html_editor_preference_status'] = the key name of the selected editor for this session

  49   * $current_editor_key = the numerical index pointer as default for the pulldown menu drawn when offering editor selection

  50   * $editor_handler = the path to the handler file containing the logic required for <HEAD> insertion to activate editor features

  51   *

  52   */
  53    foreach($editors_pulldown as $key=>$value) {
  54      if ($new_editor_choice == $value['id']) $_SESSION['html_editor_preference_status'] = $value['key'];
  55      if ($_SESSION['html_editor_preference_status'] == $value['key']) $current_editor_key = $value['id'];
  56    }
  57    $editor_handler = DIR_WS_INCLUDES . $editors_list[$_SESSION['html_editor_preference_status']]['handler'];
  58    $editor_handler = ($editor_handler == DIR_WS_INCLUDES) ? '' : $editor_handler;
  59    /* if handler not found, reset to NONE */

  60    if ($editor_handler != '' && !file_exists($editor_handler)) {
  61      $editor_handler = '';
  62      $_SESSION['html_editor_preference_status'] = 'NONE';
  63      $current_editor_key = 0;
  64    }
  65  
  66  /**

  67   * Debug code:

  68   */
  69  if (false) {
  70    echo '<br /><pre>'; print_r($_GET); echo '</pre>';
  71    echo '<br />new_editor_choice = ' . $new_editor_choice;
  72    echo '<br />current_editor_key = ' . $current_editor_key;
  73    echo '<br />$_SESSION[html_editor_preference_status] = ' . $_SESSION['html_editor_preference_status'];
  74    echo '<br />editor_handler = ' . $editor_handler;
  75    echo '<br /><pre>'; print_r($editors_list); echo '</pre>';
  76    echo '<br /><pre>'; print_r($editors_pulldown); echo '</pre>';
  77    //die('debug end');

  78  }
  79  ?>


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