本文整理汇总了PHP中AdminController类的典型用法代码示例。如果您正苦于以下问题:PHP AdminController类的具体用法?PHP AdminController怎么用?PHP AdminController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AdminController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveTpl
public function saveTpl()
{
$this->siteparas->saveTpl();
$this->getParasFile();
$adminController = new AdminController();
$adminController->publishStaticIndex();
}
示例2: login
public function login()
{
$view = new ViewModel('admin/login');
if (isset($_SESSION['user']) && $_SESSION['user'] != 'admin') {
$view->assign('user', $_SESSION['user']);
header('Location: yourAccount');
return;
}
if (isset($_POST['user']) && $_POST['user'] == 'admin') {
$admin = new AdminController();
$admin->login();
}
if (isset($_POST['user'])) {
$customer = new CustomerModel();
$logged = $customer->selectWithPassword($_POST['user'], $_POST['pass']);
if (!$logged) {
$view->assign('message-type', 'error');
$view->assign('message', 'Błędne dane');
$view->display();
return;
}
$_SESSION['user'] = $_POST['user'];
$view->assign('user', $_SESSION['user']);
$view->setTemplate('customer/index');
header('Location: yourAccount');
}
$view->display();
}
示例3: route
function route($controller, $query)
{
$controllers = array("News", "Contact", "Admin");
if (in_array(@$controller, $controllers)) {
switch ($controller) {
case "News":
$myController = new NewsController($query);
break;
case "Contact":
$myController = new ContactController($query);
break;
case "Admin":
$myController = new AdminController($query);
break;
}
$myController->render($query);
} else {
$myController = new NewsController('News');
$myController->render($query);
if (@$controller != null) {
$message = "Site which you want to connect does not exists";
echo "<script type='text/javascript'>alert('{$message}');</script>";
}
}
}
示例4: dispatch
public static function dispatch(&$request)
{
session_start();
if (isset($request["page"])) {
switch ($request["page"]) {
case "login":
$controller = new BaseController();
$controller->handle_input($request);
break;
case "cliente":
$controller = new ClienteController();
if (isset($_SESSION[BaseController::role]) && $_SESSION[BaseController::role] != User::Cliente) {
self::write403();
}
$controller->handle_input($request);
break;
case "admin":
$controller = new AdminController();
if (isset($_SESSION[BaseController::role]) && $_SESSION[BaseController::role] != User::Admin) {
self::write403();
}
$controller->handle_input($request);
break;
default:
self::write404();
break;
}
} else {
self::write404();
}
// include 'php/view/master.php';
}
示例5: update
public function update($id)
{
$rules = array('name' => 'required', 'description' => 'required', 'title' => 'required', 'route' => 'required', 'menu_image' => 'mimes:jpeg,bmp,png');
$validator = Validator::make(Input::all(), $rules);
// process the login
if ($validator->fails()) {
return Redirect::to('admin/admin_menu/' . $id . '/edit')->withErrors($validator)->withInput();
} else {
// store
$filename = "";
if (Input::hasFile('menu_image')) {
if (Input::file('menu_image')->isValid()) {
Input::file('menu_image')->move(AdminController::imagePath());
$filename = Input::file('menu_image')->getClientOriginalName();
}
}
$adminMenu = new AdministrationMenu();
$adminMenu->name = Input::get('name');
$adminMenu->description = Input::get('description');
if ($filename !== "") {
$adminMenu->image = AdminController::imagePath() . $filename;
}
$adminMenu->title = Input::get('title');
$adminMenu->route = Input::get('route');
$adminMenu->save();
// redirect
Session::flash('message', 'Successfully updated admin_menu!');
return Redirect::to('admin/admin_menu');
}
}
示例6: __construct
public function __construct()
{
$this->bootstrap = true;
$this->table = 'order_invoice';
$this->className = 'OrderInvoice';
$this->addRowAction('view');
$this->context = Context::getContext();
$this->_select = '`id_order_invoice` AS `id_invoice`,
`id_order_invoice` AS `outstanding`,
CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`,
c.`outstanding_allow_amount`,
r.`color`,
rl.`name` AS `risk`';
$this->_join = 'LEFT JOIN `' . _DB_PREFIX_ . 'orders` o ON (o.`id_order` = a.`id_order`)
LEFT JOIN `' . _DB_PREFIX_ . 'customer` c ON (c.`id_customer` = o.`id_customer`)
LEFT JOIN `' . _DB_PREFIX_ . 'risk` r ON (r.`id_risk` = c.`id_risk`)
LEFT JOIN `' . _DB_PREFIX_ . 'risk_lang` rl ON (r.`id_risk` = rl.`id_risk` AND rl.`id_lang` = ' . (int) $this->context->language->id . ')';
$this->_where = 'AND number > 0';
$risks = array();
foreach (Risk::getRisks() as $risk) {
$risks[$risk->id] = $risk->name;
}
$this->fields_list = array('number' => array('title' => $this->l('Invoice')), 'date_add' => array('title' => $this->l('Date'), 'type' => 'date', 'align' => 'right', 'filter_key' => 'a!date_add'), 'customer' => array('title' => $this->l('Customer'), 'filter_key' => 'customer', 'tmpTableFilter' => true), 'company' => array('title' => $this->l('Company'), 'align' => 'center'), 'risk' => array('title' => $this->l('Risk'), 'align' => 'center', 'orderby' => false, 'type' => 'select', 'color' => 'color', 'list' => $risks, 'filter_key' => 'r!id_risk', 'filter_type' => 'int'), 'outstanding_allow_amount' => array('title' => $this->l('Outstanding Allow'), 'align' => 'center', 'prefix' => '<b>', 'suffix' => '</b>', 'type' => 'price'), 'outstanding' => array('title' => $this->l('Current Outstanding'), 'align' => 'center', 'callback' => 'printOutstandingCalculation', 'orderby' => false, 'search' => false), 'id_invoice' => array('title' => $this->l('Invoice'), 'align' => 'center', 'callback' => 'printPDFIcons', 'orderby' => false, 'search' => false));
parent::__construct();
}
开发者ID:carloslastresDev,项目名称:HealthyTaiwan_UsingPrestaShop,代码行数:25,代码来源:AdminOutstandingController.php
示例7: initContent
public function initContent()
{
$this->errors[] = Tools::displayError('Controller not found');
$tpl_vars['controller'] = Tools::getvalue('controllerUri', Tools::getvalue('controller'));
$this->context->smarty->assign($tpl_vars);
parent::initContent();
}
示例8: initContent
public function initContent()
{
if ((empty($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'off') && Configuration::get('PS_SSL_ENABLED')) {
// You can uncomment these lines if you want to force https even from localhost and automatically redirect
// header('HTTP/1.1 301 Moved Permanently');
// header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']);
// exit();
$clientIsMaintenanceOrLocal = in_array(Tools::getRemoteAddr(), array_merge(array('127.0.0.1'), explode(',', Configuration::get('PS_MAINTENANCE_IP'))));
// If ssl is enabled, https protocol is required. Exception for maintenance and local (127.0.0.1) IP
if ($clientIsMaintenanceOrLocal) {
$this->errors[] = Tools::displayError('SSL is activated. However, your IP is allowed to use unsecure mode (Maintenance or local IP).');
} else {
$warningSslMessage = Tools::displayError('SSL is activated. Please connect using the following url to log in in secure mode (https).');
$warningSslMessage .= '<a href="https://' . Tools::safeOutput(Tools::getServerName()) . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">https://' . Tools::safeOutput(Tools::getServerName()) . Tools::safeOutput($_SERVER['REQUEST_URI']) . '</a>';
$this->context->smarty->assign(array('warningSslMessage' => $warningSslMessage));
}
}
if (file_exists(_PS_ADMIN_DIR_ . '/../install') || file_exists(_PS_ADMIN_DIR_ . '/../admin')) {
$this->context->smarty->assign(array('randomNb' => rand(100, 999), 'wrong_folder_name' => true));
}
// Redirect to admin panel
if (Tools::isSubmit('redirect') && Validate::isControllerName(Tools::getValue('redirect'))) {
$this->context->smarty->assign('redirect', Tools::getValue('redirect'));
} else {
$tab = new Tab((int) $this->context->employee->default_tab);
$this->context->smarty->assign('redirect', $this->context->link->getAdminLink($tab->class_name));
}
if ($nb_errors = count($this->errors)) {
$this->context->smarty->assign(array('errors' => $this->errors, 'nbErrors' => $nb_errors, 'shop_name' => Tools::safeOutput(Configuration::get('PS_SHOP_NAME')), 'disableDefaultErrorOutPut' => true));
}
$this->setMedia();
$this->initHeader();
parent::initContent();
$this->initFooter();
}
示例9: initPageHeaderToolbar
public function initPageHeaderToolbar()
{
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_order_message'] = array('href' => self::$currentIndex . '&addorder_message&token=' . $this->token, 'desc' => $this->l('Add new order message'), 'icon' => 'process-icon-new');
}
parent::initPageHeaderToolbar();
}
示例10: initContent
public function initContent()
{
$this->errors[] = $this->trans('Controller not found', array(), 'Admin.Notifications.Error');
$tpl_vars['controller'] = Tools::getvalue('controllerUri', Tools::getvalue('controller'));
$this->context->smarty->assign($tpl_vars);
parent::initContent();
}
示例11: init
function init()
{
parent::init();
if (true !== YII_DEBUG) {
exit('access deny!');
}
}
示例12: __construct
public function __construct()
{
parent::__construct();
$this->load->model('customer_rent_model');
$this->load->model('customer_express_rule_model');
$this->load->model('customer_express_rule_item_model');
}
示例13: createTemplate
public function createTemplate($tpl_name)
{
if (file_exists($this->getTemplatePath() . $this->override_folder . $tpl_name) && $this->viewAccess()) {
return $this->context->smarty->createTemplate($this->getTemplatePath() . $this->override_folder . $tpl_name, $this->context->smarty);
}
return parent::createTemplate($tpl_name);
}
示例14:
function __construct($view_class = null)
{
if ($view_class === null) {
$view_class = "BlogAdminViewSocieties";
}
parent::__construct($view_class);
}
示例15: __construct
public function __construct()
{
$this->className = 'Configuration';
$this->table = 'configuration';
parent::__construct();
$this->fields_options = array('general' => array('title' => $this->l('General'), 'icon' => 'tab-preferences', 'fields' => array('PS_SHOP_ENABLE' => array('title' => $this->l('Enable Shop'), 'desc' => $this->l('Activate or deactivate your shop. It is a good idea to deactivate your shop while you perform maintenance on it. Please note that the webservice will not be disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_MAINTENANCE_IP' => array('title' => $this->l('Maintenance IP'), 'desc' => $this->l('IP addresses allowed to access the Front Office even if the shop is disabled. Use a comma to separate them (e.g. 42.24.4.2,127.0.0.1,99.98.97.96)'), 'validation' => 'isGenericName', 'type' => 'maintenance_ip', 'size' => 30, 'default' => '')), 'submit' => array('title' => $this->l('Save'), 'class' => 'button')));
}