Exemplo n.º 1
0
 public function init()
 {
     parent::init();
     $this->items_images_path = bff::buildPath('items', 'images');
     $this->items_images_url = bff::buildUrl('items', 'images');
     # nested sets tree
     $tree = $this->attachComponent('tree', new dbNestedSetsTree(TABLE_BBS_CATEGORIES));
     bff::i()->GetModule('Services');
     if (bff::$isFrontend) {
         return;
     }
     # !
     # проверяем наличие корневого элемента
     if ($tree->checkRootNode($nRootID)) {
         # если только-что создан, создаем категорию
         $this->db->execute('UPDATE ' . TABLE_BBS_CATEGORIES . ' 
                             SET title = ' . $this->db->str2sql('Корневой раздел') . ', created = ' . $this->db->getNOW() . '
                             WHERE id = ' . $nRootID);
     }
     $this->initDynprops();
 }