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

Source for file BrotherDivisions.class.php

Documentation is available at BrotherDivisions.class.php

  1. <?php
  2.  
  3.  
  4. /**
  5.  * Содержит класс BrotherDivisions
  6.  *
  7.  * @package energine
  8.  * @subpackage share
  9.  * @author dr.Pavka
  10.  * @copyright Energine 2006
  11.  * @version $Id$
  12.  */
  13.  
  14.  
  15. //require_once('core/modules/share/components/ChildDivisions.class.php');
  16.  
  17. /**
  18.  * Класс передназначен для вівода дочерних разделов текущего раздела
  19.  *
  20.  * @package energine
  21.  * @subpackage share
  22.  * @author dr.Pavka
  23.  *
  24.  */
  25. class BrotherDivisions extends ChildDivisions {
  26.     /**
  27.      * Конструктор класса
  28.      *
  29.      * @return void 
  30.      */
  31.     public function __construct($name$moduleDocument $document,  array $params null{
  32.         $params['active'false;
  33.         parent::__construct($name$module$document,  $params);
  34.         $this->setParam('recordsPerPage'false);
  35.     }
  36.     /**
  37.      * Убираем DescriptionRtf
  38.      *
  39.      * @return DataDescription 
  40.      * @access protected
  41.      */
  42.  
  43.      protected function createDataDescription({
  44.         $result parent::createDataDescription();
  45.         $result->removeFieldDescription($result->getFieldDescriptionByName('DescriptionRtf'));
  46.         return $result;
  47.      }
  48.     /**
  49.      * Переопределенный метод загрузки данных
  50.      *
  51.      * @return mixed 
  52.      * @access protected
  53.      */
  54.  
  55.     protected function loadData({
  56.         $sitemap Sitemap::getInstance();
  57.  
  58.  
  59.         if (!$this->getParam('id')) {
  60.             $id $this->document->getID();
  61.         }
  62.         else {
  63.             $id $this->getParam('id');
  64.         }
  65.         $parentID $sitemap->getDocumentInfo($id);
  66.         $parentID $parentID['Pid'];
  67.         if (isset($parentID)) {
  68.             $data $sitemap->getChilds($parentID);
  69.         }
  70.  
  71.  
  72.         $data (empty($data))?false:$data;
  73.         if(is_array($data)) {
  74.             foreach ($data as $id => $current{
  75.                 $data[$idarray(
  76.                 'Id' => $id,
  77.                 'Segment' => $current['Segment'],
  78.                 'Name' => $current['Name']
  79.                 );
  80.             }
  81.  
  82.         }
  83.  
  84.         return $data;
  85.     }
  86. }
В создании документации нам помог: phpDocumentor