public function delete($id) { if ($id == 1) { return false; } if (!isset($this->items[$id])) { return false; } if (dbversion) { $db = litepublisher::$db; foreach ($this->tables as $table) { $db->table = $table; $db->update('idperm = 0', "idperm = {$id}"); } } return parent::delete($id); }
protected function create() { $this->dbversion = false; parent::create(); $this->addevents('onwidget', 'onadminlogged', 'onadminpanel', 'ongetwidgets', 'onsidebar'); $this->basename = 'widgets'; $this->currentsidebar = 0; $this->idurlcontext = 0; $this->addmap('classes', array()); }
public function delete($id) { if ($id == 1) { return $this->error('You cant delete default view'); } foreach ($this->defaults as $name => $iddefault) { if ($id == $iddefault) { $this->defaults[$name] = 1; } } return parent::delete($id); }