phpDocumentor PHPShopElements
[ class tree: PHPShopElements ] [ all elements ]

Source for file elements.inc.php

Documentation is available at elements.inc.php

  1. <?php
  2.  
  3. /**
  4.  * Элемент cмена шаблонов
  5.  * @author PHPShop Software
  6.  * @version 1.0
  7.  * @package PHPShopElements
  8.  */
  9.  
  10.     /**
  11.      * Конструктор
  12.      */
  13.     function PHPShopSkinElement({
  14.         parent::PHPShopElements();
  15.     }
  16.  
  17.     /**
  18.      * Вывод смены шаблонов
  19.      * @return string
  20.      */
  21.     function index({
  22.         $dis=$name='';
  23.         if($this->PHPShopSystem->getValue('skin_choice')) {
  24.             $dir=$this->getValue('dir.templates').chr(47);
  25.             if (is_dir($dir)) {
  26.                 if (@$dh opendir($dir)) {
  27.                     while (($file readdir($dh)) !== false{
  28.  
  29.                         if($_SESSION['skin'== $file)
  30.                             $sel="selected";
  31.                         else $sel="";
  32.  
  33.                         if($file!="." and $file!=".." and $file!="index.html")
  34.                             @$name.= "<option value=\"$file\" $sel>Шаблон $file</option>";
  35.                     }
  36.                     closedir($dh);
  37.                 }
  38.             }
  39.  
  40.  
  41.             // Определяем переменые
  42.             $forma="<div style=\"padding:10px\"><form name=SkinForm method=post><select name=\"skin\" onchange=\"ChangeSkin()\">".$name."</select></form></div>";
  43.             $this->set('leftMenuContent',$forma);
  44.             $this->set('leftMenuName',"Сменить дизайн");
  45.  
  46.             // Подключаем шаблон
  47.             $dis=$this->parseTemplate($this->getValue('templates.left_menu'));
  48.         }
  49.         return $dis;
  50.     }
  51. }
  52.  
  53.  
  54.  
  55.     /**
  56.      * Конструктор
  57.      */
  58.     function PHPShopTextElement({
  59.         parent::PHPShopElements();
  60.     }
  61.  
  62.     /**
  63.      * Экшен по умолчанию
  64.      */
  65.     function topMenu({
  66.         global $PHPShopModules;
  67.  
  68.         // Подключаем шаблон
  69.         $dis $this->OpenHTML('menu');
  70.  
  71.         // Перехват модуля
  72.         $PHPShopModules->setHookHandler(__CLASS__,__FUNCTION__$this&$dis);
  73.  
  74.         return $dis;
  75.     }
  76. }
  77. ?>

Documentation generated on Mon, 25 Jun 2012 15:09:43 +0400 by phpDocumentor 1.4.3