Exemplo n.º 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());
 }
Exemplo n.º 2
0
 public function __construct()
 {
     $this->options['login'] = '******';
     $this->options['action_link'] = fx::config('path.admin');
     $this->addMoreMenu(Controller\Adminpanel::getMoreMenu());
     $this->addButtons(Controller\Adminpanel::getButtons());
     $main_menu = array('manage' => array('name' => fx::alang('Management', 'system'), 'key' => 'manage', 'href' => '/floxim/#admin.administrate.site.all'), 'develop' => array('name' => fx::alang('Development', 'system'), 'key' => 'develop', 'href' => '/floxim/#admin.component.all'));
     $site = fx::env('site');
     if ($site) {
         $main_menu['site'] = array('name' => fx::env('site')->getLocalDomain(), 'key' => 'site', 'href' => '/');
         $other_sites = fx::data('site')->where('id', $site['id'], '!=')->all();
         if (count($other_sites) > 0) {
             $main_menu['site']['children'] = array();
             foreach ($other_sites as $other_site) {
                 $domain = $other_site->getLocalDomain();
                 $main_menu['site']['children'][] = array('name' => $domain, 'href' => 'http://' . $domain . '/');
             }
         }
     }
     $this->addMainMenu($main_menu);
 }
Exemplo n.º 3
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);
 }