public function _delete() { $operation_status = $this->crud->delete($this->id); //em sucesso esta retornando 1 $status = $operation_status == 1; $this->session->setData("submit_status", $status); if (!$status) { $this->session->setData("submit_error", $operation_status); } $this->posSubmit(); //@todo ainda não está exibindo as mensagem de sucesso ou erro return $this->_list(); }
public function _main() { if (empty($this->method) && !Session::singleton()->isAdmin()) { redirect('/'); } else { if (!empty($this->method)) { $this->showPage(); } else { $this->_browse(); } } return true; }
/** * Retorna os dados gerados pela página (resultado de todo o processamento da página) * * @return array */ public function getPagedata() { if ($this->responseType == ResponseType::HTML && $this->htmlFull) { $this->pagedata = array_merge($this->pagedata, array('html' => array('pagetitle' => MemoryPage::getTitle(trim(PAGE_TITLE_PREFIX . ' ' . $this->pageTitle)), 'urlbase' => DOMAIN, 'css' => MemoryPage::getCss(), 'js' => MemoryPage::getJs(), 'extraheader' => MemoryPage::getExtraHeader()), '_page' => get_class($this), '_pagename' => strtolower(getClassNameFromNamespace(get_class($this))), '_action' => $this->method)); } $this->pagedata = array_merge($this->pagedata, MemoryPage::getAttributes()); $s = Session::getInstance(); if ($s->isLogged()) { $this->pagedata['isLogged'] = true; $this->pagedata['isAdmin'] = $s->isAdmin(); foreach ($s->getGroups() as $group) { $this->pagedata['is' . ucfirst($group)] = true; } $this->pagedata['session'] = array('id' => $s->getUserId(), 'nome' => $s->getUserName(), 'email' => $s->getData('email')); } $this->pagedata[SERVER_MODE] = true; $this->pagedata['error'] = LoggerApp::getErrors(); //$this->pagedata["___get___"] = $_GET; return $this->pagedata; }
public function _sair() { Session::singleton()->logout(); redirect('/'); }