Exemple #1
0
 public static function getDisplayTypeList()
 {
     if (isset(self::$displaytypelist)) {
         return self::$displaytypelist;
     }
     self::$displaytypelist = array();
     foreach (self::$displaytypes as $key => $value) {
         self::$displaytypelist[$key] = array('id' => $key, 'name' => $value);
     }
     return self::$displaytypelist;
 }
Exemple #2
0
 /**
  * delete a plugin item
  *
  * @param array whith id [fieldname => value]
  * @param string name of the tag that is being deleted
  * @param integer id of the tree 
  * @return void
  */
 public function deletePlugin($values, $plugin_type)
 {
     $ref = $this->getObject($plugin_type);
     switch ($plugin_type) {
         case self::TYPE_DEFAULT:
             $key = array('tree_id' => $values['tree_id'], 'tag' => $values['tag']);
             // delete settings
             require_once 'LinksSettings.php';
             $settings = new LinksSettings($this);
             $settings->delete($key);
             // delete news items
             $list = $ref->getList($key);
             foreach ($list['data'] as $item) {
                 $key = $ref->getKey($item);
                 $ref->delete($key);
             }
             break;
         default:
             $key = $ref->getKey($values);
             $ref->delete($key);
     }
 }