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'; }
public function before() { parent::before(); if ($this->current_user->group->id != 6) { \Response::redirect('admin'); } }
public function before() { parent::before(); if (!$this->auth->logged_in('admin')) { header('Location: /auto/login'); exit; } }
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); }
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); }
public function before() { parent::before(); \View::set_global('subnav', array('competitions' => 'active')); $this->template->title = "Сезоны"; }
public function before() { parent::before(); list(, $this->user_id) = Auth::get_user_id(); }
public function before() { parent::before(); $menu = Request::factory('widgets/menu')->execute(); $this->template->block_left = array($menu); }
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(); }
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'); }
public function before() { parent::before(); $this->template->submenu = null; }
/** * The before() method is called before controller action * * @uses ACL::required */ public function before() { ACL::required('administer users'); parent::before(); }
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; }
protected function htmlView($template) { $view = parent::htmlView($template); $view->groups = new Model_List_Group($this->getStorage(), ''); return $view; }
/** * 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(); }
public function before() { parent::before(); $config_main = (array) Kohana::$config->load('main'); $this->admin_url = $config_main['admin_url']; }
public function before() { parent::before(); $this->template->title = 'Голосования'; \View::set_global('subnav', array('votes' => 'active')); }
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>'; }
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') {
public function before() { parent::before(); \View::set_global('subnav', array('media' => 'active')); }
/** * Get upload base */ public function before() { parent::before(); $this->_base = DOCROOT . Kohana::config('cms.upload.folder') . '/'; }
public function before() { parent::before(); $this->template->title = 'Видео'; \View::set_global('subnav', array('videos' => 'active')); }
$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'); }
public function before() { parent::before(); }
public function before() { parent::before(); $this->template->title = "Команда"; \View::set_global('subnav', array('players' => 'active')); }