energine
[ class tree: energine ] [ index: energine ] [ all elements ]

Source for file ProductTypeEditor.class.php

Documentation is available at ProductTypeEditor.class.php

  1. <?php
  2. /**
  3.  * Содержит класс ProductTypeEditor
  4.  *
  5.  * @package energine
  6.  * @subpackage shop
  7.  * @author dr.Pavka
  8.  * @copyright ColoCall 2006
  9.  * @version $Id$
  10.  */
  11.  
  12. //require_once('core/modules/share/components/Grid.class.php');
  13.  
  14. /**
  15.  * Редатор типов товаров
  16.  *
  17.  * @package energine
  18.  * @subpackage shop
  19.  * @author dr.Pavka
  20.  */
  21. class ProductTypeEditor extends Grid {
  22.     /**
  23.      * Редактор параметров
  24.      *
  25.      * @var ProductParamsEditor 
  26.      * @access private
  27.      */
  28.     private $paramsEditor = false;
  29.     /**
  30.      * Конструктор класса
  31.      *
  32.      * @param string $name 
  33.      * @param string $module 
  34.      * @param Document $document 
  35.      * @param array $params 
  36.      * @access public
  37.      */
  38.     public function __construct($name$moduleDocument $document,  array $params null{
  39.         parent::__construct($name$module$document,  $params);
  40.         $this->setTableName('shop_product_types');
  41.         $this->setOrder(array('pt_name' => QAL::ASC));
  42.     }
  43.  
  44.     /**
  45.      * Выводит компонент - редактор параметров
  46.      *
  47.      * @return void 
  48.      * @access protected
  49.      */
  50.  
  51.     protected function showParams({
  52.         $id $this->request->getPath(Request::PATH_ACTION);
  53.         $id $id[0];
  54.         $this->request->setPathOffset($this->request->getPathOffset(2);
  55.         $this->paramsEditor $this->document->componentManager->createComponent('paramsEditor''shop''ProductParamsEditor'array('productTypeID' => $id)false);
  56.         $this->paramsEditor->getAction();
  57.         $this->paramsEditor->run();
  58.     }
  59.  
  60.     /**
  61.      * Для метода showParams вызывается свой билдер
  62.      *
  63.      * @return DOMNode 
  64.      * @access public
  65.      */
  66.  
  67.     public function build({
  68.         if ($this->getAction(== 'showParams'{
  69.             $result $this->paramsEditor->build();
  70.         }
  71.         else {
  72.             $result parent::build();
  73.         }
  74.  
  75.         return $result;
  76.     }
  77.  
  78. }
В создании документации нам помог: phpDocumentor