Example #1
0
 protected function showAdminPanel()
 {
     if (!fx::isAdmin()) {
         return;
     }
     // initialize the admin panel
     $p = fx::page();
     $js_config = new Admin\Configjs();
     $p->addJsText("\$fx.init(" . $js_config->getConfig() . ");");
     $p->setAfterBody(Admin\Controller\Adminpanel::panelHtml());
 }
Example #2
0
 /**
  * @return string
  */
 public function adminOffice()
 {
     self::addAdminFiles();
     if (fx::isAdmin()) {
         $panel = Adminpanel::panelHtml();
         $res = fx::template('@admin:back_office')->render(array('panel' => $panel));
         $js_config = new FxAdmin\Configjs();
         fx::page()->addJsText("\$fx.init(" . $js_config->getConfig() . ");");
     } else {
         $auth_form = fx::controller('user:auth_form')->render('user:auth_form');
         $recover_form = fx::controller('user:recover_form', array('email' => isset($_POST['email']) ? $_POST['email'] : null))->render('user:recover_form');
         $res = fx::template('@admin:authorize')->render(array('auth_form' => $auth_form, 'recover_form' => $recover_form));
     }
     return fx::page()->postProcess($res);
 }