Exemple #1
0
 public function before()
 {
     parent::before();
     $this->template->scripts[] = 'media/js/jquery-1.6.2.min.js';
     $this->template->scripts[] = 'media/js/jquery.MultiFile.pack.js';
     $this->template->scripts[] = 'media/js/upload.js';
 }
Exemple #2
0
 public function before()
 {
     parent::before();
     if ($this->current_user->group->id != 6) {
         \Response::redirect('admin');
     }
 }
Exemple #3
0
 public function before()
 {
     parent::before();
     if (!$this->auth->logged_in('admin')) {
         header('Location: /auto/login');
         exit;
     }
 }
Exemple #4
0
 public function before()
 {
     parent::before();
     if (is_null($this->_model)) {
         throw new Extasy_Exception('Model not defined');
     }
     $this->template->set_layout(Kohana::$config->load('layout')->admin);
 }
Exemple #5
0
 public function before()
 {
     Core::close_buffers(false);
     $this->phprpc = PHPRPC::server();
     $this->auto_add_action();
     $this->before_start();
     if (IS_DEBUG) {
         $this->phprpc->setDebugMode(true);
     }
     $this->phprpc->start();
     parent::before();
 }
 function setDefaultValiesToView($viewName)
 {
     $session = Session::instance();
     $view = parent::getView($viewName);
     $itemCreated = $session->get($this->createdKey, false);
     $session->delete($this->createdKey);
     $view->set($this->createdKey, $itemCreated);
     $itemUpdated = $session->get($this->updatedKey, false);
     $session->delete($this->updatedKey);
     $view->set($this->updatedKey, $itemUpdated);
     $itemDeleted = $session->get($this->deletedKey, false);
     $session->delete($this->deletedKey);
     $view->set($this->deletedKey, $itemDeleted);
     $view->set('submenu', $this->submenu);
     $view->set('currentSubPage', $this->currentSubPage);
     return $view;
 }
 public function action_index()
 {
     $data['settings'] = Settings::get_all();
     if (\Input::method() == 'POST') {
         Controller_Settings::update(Input::Post());
         $data['settings'] = Settings::get_all(true);
     }
     $data['blocked'] = $blacklist_item = Model_Blacklist::query()->get();
     $keys = \Settings::Get('character_set');
     if (empty($keys) === true) {
         $keys = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
     }
     $random_length = \Settings::Get('random_url_length');
     if (empty($random_length) === true) {
         $random_length = 5;
     }
     $url_sample_space = DB::select(DB::expr('count(id) as count'))->from('urls')->where(DB::expr('char_length(short_url)'), $random_length)->limit(1)->execute()->as_array();
     $data['urls_left'] = Controller_Admin::mathFact(strlen($keys)) / (Controller_Admin::mathFact(strlen($keys) - $random_length) * Controller_Admin::mathFact($random_length)) - $url_sample_space[0]['count'];
     $this->template->content = View::Forge('admin/index', $data);
 }
Exemple #8
0
 public function before()
 {
     parent::before();
     \View::set_global('subnav', array('competitions' => 'active'));
     $this->template->title = "Сезоны";
 }
Exemple #9
0
 public function before()
 {
     parent::before();
     list(, $this->user_id) = Auth::get_user_id();
 }
Exemple #10
0
 public function before()
 {
     parent::before();
     $menu = Request::factory('widgets/menu')->execute();
     $this->template->block_left = array($menu);
 }
Exemple #11
0
 public function before()
 {
     //parent::before();
     $this->_paginationConfig = array('prev_img' => Asset::img('pagination/prev.png', array("alt" => "Previous", 'class' => "prev-img")), 'prev_img_active' => Asset::img('pagination/prev.png', array("alt" => "Previous", 'class' => "prev-img-active")), 'first_img' => Asset::img('pagination/first.png', array("alt" => "first", 'class' => "first-img")), 'first_img_active' => Asset::img('pagination/first.png', array("alt" => "first", 'class' => "first-img-active")), 'next_img' => Asset::img('pagination/next.png', array("alt" => "Next", 'class' => "next-img")), 'next_img_active' => Asset::img('pagination/next.png', array("alt" => "Next", 'class' => "next-img-active")), 'last_img' => Asset::img('pagination/last.png', array("alt" => "Last", 'class' => "last-img")), 'last_img_active' => Asset::img('pagination/last.png', array("alt" => "Last", 'class' => "last-img-active")), 'css_id_prefix' => 'Dates', 'ajax_method' => 'loadDatesGrid', 'limit_default' => 30, 'limiter_choices' => array(30, 60, 100), 'limiter_prefix' => 'Dates');
     parent::before();
 }
Exemple #12
0
 public function before()
 {
     parent::before();
     $this->template->scripts = array('media/js/jquery-1.7.2.min.js', 'media/tinymce/tinymce.min.js', 'media/js/edit_tech.js');
     $this->template->submenu = Widget::load('SubMenuMain');
 }
Exemple #13
0
 public function before()
 {
     parent::before();
     $this->template->submenu = null;
 }
Exemple #14
0
 /**
  * The before() method is called before controller action
  *
  * @uses  ACL::required
  */
 public function before()
 {
     ACL::required('administer users');
     parent::before();
 }
Exemple #15
0
 private function getPageData($total_rows, $entity, $page, $opt_conditions = NULL)
 {
     //If $page is not a number, getMultiplier will return 0.
     $start = Controller_Admin::getMultiplier($page) * Controller_Admin::ROWS_PER_PAGE;
     $rows = ORM::factory($entity)->limit(Controller_Admin::ROWS_PER_PAGE)->offset($start);
     if ($opt_conditions) {
         foreach ($opt_conditions as $field => $value) {
             $rows->where($field, '=', $value);
         }
     }
     $rows = $rows->find_all();
     //Error conditions.
     if (count($rows) == 0 && $total_rows > 0) {
         $this->addError(__('Invalid page number'));
     } else {
         if (!count($rows)) {
             $this->addError(__("You should probably create an {$entity} to start with."));
         }
     }
     return $rows;
 }
Exemple #16
0
 protected function htmlView($template)
 {
     $view = parent::htmlView($template);
     $view->groups = new Model_List_Group($this->getStorage(), '');
     return $view;
 }
Exemple #17
0
 /**
  * The after() method is called after controller action.
  *
  * @uses  Route::url
  */
 public function after()
 {
     $this->_tabs = array(array('link' => Route::get('admin/blog')->uri(array('action' => 'index')), 'text' => __('Statistics')), array('link' => Route::get('admin/blog')->uri(array('action' => 'list')), 'text' => __('List')), array('link' => Route::get('admin/blog')->uri(array('action' => 'settings')), 'text' => __('Settings')));
     parent::after();
 }
Exemple #18
0
 public function before()
 {
     parent::before();
     $config_main = (array) Kohana::$config->load('main');
     $this->admin_url = $config_main['admin_url'];
 }
Exemple #19
0
 public function before()
 {
     parent::before();
     $this->template->title = 'Голосования';
     \View::set_global('subnav', array('votes' => 'active'));
 }
Exemple #20
0
        if (empty($_GET['id_art'])) {
            header("Location: exo-circulaire/admin/index.php?c=article&a=list");
            die;
        } else {
            $idArt = intval($_GET['id_art']);
            require_once $_SERVER['DOCUMENT_ROOT'] . 'exo-circulaire/controllers/admin.php';
            $controller_admin = new controller_admin();
            $controller_admin->updateArticle($idArt);
        }
    } elseif ($controller == "admin" && $action == "deleteArticle") {
        if (empty($_GET['id_art'])) {
            header("Location: exo-circulaire/admin/index.php?c=article&a=list");
            die;
        } else {
            $idArt = intval($_GET['id_art']);
            require_once $_SERVER['DOCUMENT_ROOT'] . 'exo-circulaire/controllers/admin.php';
            $controller_admin = new controller_admin();
            $controller_admin->deleteArticle($idArt);
        }
    } elseif ($controller == "admin" && $action == "disconnect") {
        require_once $_SERVER['DOCUMENT_ROOT'] . 'exo-circulaire/controllers/admin.php';
        $controller_admin = new Controller_Admin();
        $controller_admin->disconnectAdmin();
    } elseif ($controller == "" && $action == "") {
        require_once $_SERVER['DOCUMENT_ROOT'] . 'exo-circulaire/views/admin/panel.php';
    }
} else {
    require_once $_SERVER['DOCUMENT_ROOT'] . 'exo-circulaire/views/admin/connect.php';
    echo '<h2>Si vous n\'êtes pas admin, il vous serait plus judicieux de vous rendre 
		à la page de connexion précédente, celle pour client.</h2>';
}
Exemple #21
0
 public function before()
 {
     $this->template = Session::get('template');
     parent::before();
 }
<?php

$controller = "";
$action = "";
require_once $_SERVER['DOCUMENT_ROOT'] . '/boutique/admin/views/header.php';
if (!empty($_GET['c']) && !empty($_GET['a'])) {
    $controller = $_GET['c'];
    $action = $_GET['a'];
}
if ($controller == '' && $action == '') {
    require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/controllers/home_admin.php';
    $articleUser = new Controller_Admin();
    $articleUser->listLastArticleUser();
} elseif ($controller == "articles" && $action == "add") {
    require_once $_SERVER['DOCUMENT_ROOT'] . "/boutique/controllers/article.php";
    $article = new Controller_Article();
    $article->addArticle();
} elseif ($controller == 'categorie' && $action == 'add') {
    require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/controllers/categorie.php';
    $categorie = new Controller_Categorie();
    $categorie->addCatLic();
} elseif ($controller == 'admin' && $action == 'article') {
    require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/controllers/article.php';
    $article = new Controller_Article();
    $article->listArticleAdmin();
} elseif ($controller == 'admin' && $action == 'users') {
    require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/controllers/utilisateur.php';
    $users = new Controller_Utilisateur();
    $listUsers = $users->listUsersAdmin();
    require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/admin/views/list_users.php';
} elseif ($controller == 'admin' && $action == 'modify') {
Exemple #23
0
 public function before()
 {
     parent::before();
     \View::set_global('subnav', array('media' => 'active'));
 }
Exemple #24
0
 /**
  * Get upload base
  */
 public function before()
 {
     parent::before();
     $this->_base = DOCROOT . Kohana::config('cms.upload.folder') . '/';
 }
Exemple #25
0
 public function before()
 {
     parent::before();
     $this->template->title = 'Видео';
     \View::set_global('subnav', array('videos' => 'active'));
 }
Exemple #26
0
        $controller_categorie = new Controller_Categorie();
        $controller_categorie->deleteCategories($id_categories);
    }
    // Page Suppression des categories
} elseif ($controller == "articlecateg" && $action == "delete") {
    if (empty($_GET['id_articles']) and empty($_GET['id_categories'])) {
        echo "<p>Il manque l'identifiant de la categorie ou de l'article ou les deux</p>";
    } else {
        $id_categories = intval($_GET['id_categories']);
        $id_articles = intval($_GET['id_articles']);
        require_once $_SERVER['DOCUMENT_ROOT'] . "/ecommerce/controllers/categorie.php";
        $controller_categorie = new Controller_Categorie();
        $controller_categorie->deleteAsso_Art_Categ($id_categories, $id_articles);
    }
    // Page Suppression des association articles et categories
} elseif ($controller == "admin" && $action == "home") {
    require_once $_SERVER['DOCUMENT_ROOT'] . "/ecommerce/controllers/admin.php";
    $controller_admin = new Controller_Admin();
    $controller_admin->dashboard();
    // Page Tableau de bord
} elseif ($controller == "admin" && $action == "deconnexion") {
    require_once $_SERVER['DOCUMENT_ROOT'] . "/ecommerce/controllers/admin.php";
    $controller_deconnectadmin = new Controller_Admin();
    $controller_deconnectadmin->deconnectAdmin();
    // Page Deconnexion
} elseif ($controller == "" && $action == "") {
    require_once $_SERVER['DOCUMENT_ROOT'] . "/ecommerce/controllers/admin.php";
    $controller_admin = new Controller_Admin();
    $controller_admin->connectAdmin();
    // Page de Connexion Admin
}
 /**
  * The index action.
  *
  * @access  public
  * @return  void
  */
 public function action_index()
 {
     $this->template->title = 'Dashboard';
     $this->template->content = View::forge('user/dashboard', Controller_Admin::get_admin_dashboard_stats());
 }
 public function before()
 {
     parent::before();
     Breadcrumbs::instance()->add('Management', 'admin')->add('Announcements', 'admin/announcements');
 }
Exemple #29
0
 public function before()
 {
     parent::before();
 }
Exemple #30
0
 public function before()
 {
     parent::before();
     $this->template->title = "Команда";
     \View::set_global('subnav', array('players' => 'active'));
 }