Пример #1
0
 function _install()
 {
     global $tikilib;
     $this->fetchData();
     $this->replaceReferences($this->name);
     $this->replaceReferences($this->description);
     $this->replaceReferences($this->parent);
     $this->replaceReferences($this->migrateparent);
     $this->replaceReferences($this->items);
     $categlib = TikiLib::lib('categ');
     if ($id = $categlib->exist_child_category($this->parent, $this->name)) {
         $categlib->update_category($id, $this->name, $this->description, $this->parent);
     } else {
         $id = $categlib->add_category($this->parent, $this->name, $this->description);
     }
     if ($this->migrateparent && ($from = $categlib->exist_child_category($this->migrateparent, $this->name))) {
         $categlib->move_all_objects($from, $id);
     }
     foreach ($this->items as $item) {
         list($type, $object) = $item;
         $type = Tiki_Profile_Installer::convertType($type);
         $object = Tiki_Profile_Installer::convertObject($type, $object);
         $categlib->categorize_any($type, $object, $id);
     }
     return $id;
 }
Пример #2
0
 function _install()
 {
     global $tikilib;
     $this->fetchData();
     $this->replaceReferences($this->type);
     $this->replaceReferences($this->object);
     $this->replaceReferences($this->categories);
     $categlib = TikiLib::lib('categ');
     $type = Tiki_Profile_Installer::convertType($this->type);
     $object = Tiki_Profile_Installer::convertObject($type, $this->object);
     foreach ($this->categories as $categId) {
         $categlib->categorize_any($type, $object, $categId);
     }
     return true;
 }