Exemple #1
0
 public function __construct()
 {
     parent::__construct();
     $this->auth = Auth::getInstance();
     $this->session = \Uno\Session::getInstance();
     $this->template->user = $this->auth;
 }
Exemple #2
0
 public function __construct()
 {
     parent::__construct();
     $this->auth = Auth::getInstance();
     if (!$this->auth->hasIdentity()) {
         $this->redirect('/');
     }
     $this->session = \Uno\Session::getInstance();
     $current = \URI::getInstance()->segment(2);
     $this->template->header = new \View('header');
     $topmenu = array(array('name' => _('Dashboard'), 'link' => '/admin', 'active' => '' == $current), array('name' => _('Menus'), 'link' => '/admin/menus', 'active' => 'menus' == $current), array('name' => _('Layouts'), 'link' => '', 'active' => 'layouts' == $current), array('name' => _('Widgets'), 'link' => '', 'active' => 'widgets' == $current), array('name' => _('Modules'), 'link' => '/admin/modules', 'active' => strpos($current, 'module') !== FALSE));
     $this->template->header->topmenu = $topmenu;
     $this->template->jscript('/admin/index/resource/admin.js');
 }
Exemple #3
0
 protected function __construct()
 {
     $this->fields = array();
     $this->params = array('identity' => array('field' => NULL, 'value' => NULL), 'credential' => array('field' => NULL, 'value' => NULL));
     $this->error = self::SUCCESS;
     $this->db = \Database::getInstance();
     $this->session = \Uno\Session::getInstance();
     $this->cookie = \Uno\Cookie::getInstance();
     if ($this->session->exists(self::USER)) {
         $this->fields = $this->session->get(self::USER);
     } else {
         if ($this->cookie->exists(self::USER)) {
             $this->fields = $this->cookie->get(self::USER);
             $this->session->set(self::USER, $this->fields);
         }
     }
 }
Exemple #4
0
<script type="text/javascript">
/* <![CDATA[ */
$(function() {
$('.error a').click(function(e) {e.stopPropagation();e.preventDefault();$('.error').fadeOut();});
$('.success a').click(function(e) {e.stopPropagation();e.preventDefault();$('.success').fadeOut();});
$('.info a').click(function(e) {e.stopPropagation();e.preventDefault();$('.info').fadeOut();});
$('.notice a').click(function(e) {e.stopPropagation();e.preventDefault();$('.notice').fadeOut();});
});
/* ]]> */
</script>

<?php 
$ses = \Uno\Session::getInstance();
$error = $ses->getOnce('error', FALSE);
$success = $ses->getOnce('success', FALSE);
$info = $ses->getOnce('info', FALSE);
$notice = $ses->getOnce('notice', FALSE);
if (!empty($error)) {
    ?>
<div class="error">
  <div style="float:right;">
    <a href="#"><img src="/admin/resource/error-close.gif" alt="<?php 
    echo _('Close');
    ?>
" /></a>
  </div>
  <div style="float:left:">
    <?php 
    echo is_array($error) ? implode('<br />', $error) : $error;
    ?>
  </div>