示例#1
0
 public function __construct(EventManager $em)
 {
     $this->crud = new Crud($this->daoname);
     $this->connection = $this->crud->getDao()->getDatabase();
     if (null !== $this->urlbase) {
         $this->crud->setUrlbase($this->urlbase);
     }
     $this->dao = $this->crud->getDao();
     $this->session = Session::getInstance();
     parent::__construct($em);
 }
 /**
  * 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;
 }