本文整理汇总了PHP中AdminController类的典型用法代码示例。如果您正苦于以下问题:PHP AdminController类的具体用法?PHP AdminController怎么用?PHP AdminController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AdminController类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: saveTpl
public function saveTpl()
{
$this->siteparas->saveTpl();
$this->getParasFile();
$adminController = new AdminController();
$adminController->publishStaticIndex();
}
开发者ID:puregamexyz,项目名称:bitdesign.github.io,代码行数:7,代码来源:SettingController.php
示例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();
}
开发者ID:davpal,项目名称:Kuriex,代码行数:28,代码来源:login.php
示例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>";
}
}
}
开发者ID:kajbrz,项目名称:PortfolioWebSite,代码行数:25,代码来源:routes.php
示例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';
}
开发者ID:Artorias91,项目名称:Progetto-AMM,代码行数:32,代码来源:index.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');
}
}
开发者ID:elioth010,项目名称:carretilla_online,代码行数:30,代码来源:AdminController.php
示例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();
}
开发者ID:zangles,项目名称:lennyba,代码行数:7,代码来源:AdminNotFoundController.php
示例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();
}
开发者ID:jicheng17,项目名称:pengwine,代码行数:35,代码来源:AdminLoginController.php
示例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();
}
开发者ID:dev-lav,项目名称:htdocs,代码行数:7,代码来源:AdminOrderMessageController.php
示例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();
}
开发者ID:M03G,项目名称:PrestaShop,代码行数:7,代码来源:AdminNotFoundController.php
示例11: init
function init()
{
parent::init();
if (true !== YII_DEBUG) {
exit('access deny!');
}
}
开发者ID:hiproz,项目名称:mincms,代码行数:7,代码来源:DefaultController.php
示例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');
}
开发者ID:EnzoLynn,项目名称:gugu-manager,代码行数:7,代码来源:CustomerExpressRule.php
示例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);
}
开发者ID:jicheng17,项目名称:vipinsg,代码行数:7,代码来源:ModuleAdminController.php
示例14:
function __construct($view_class = null)
{
if ($view_class === null) {
$view_class = "BlogAdminViewSocieties";
}
parent::__construct($view_class);
}
开发者ID:amanai,项目名称:next24,代码行数:7,代码来源:BlogAdminSocietiesController.php
示例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')));
}
开发者ID:jicheng17,项目名称:vipinsg,代码行数:7,代码来源:AdminMaintenanceController.php
示例16: __construct
public function __construct()
{
$this->className = 'Configuration';
$this->table = 'configuration';
parent::__construct();
$this->fields_options = array('products' => array('title' => $this->l('Products (general)'), 'fields' => array('PS_CATALOG_MODE' => array('title' => $this->l('Catalog mode'), 'desc' => $this->l('When active, all shopping features will be disabled.'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool'), 'PS_COMPARATOR_MAX_ITEM' => array('title' => $this->l('Product comparison'), 'desc' => $this->l('Set the maximum number of products that can be selected for comparison.') . ' ' . $this->l('Set to "0" to disable this feature.'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text'), 'PS_NB_DAYS_NEW_PRODUCT' => array('title' => $this->l('Number of days for which the product is considered \'new\''), 'validation' => 'isUnsignedInt', 'cast' => 'intval', 'type' => 'text'), 'PS_CART_REDIRECT' => array('title' => $this->l('Redirect after adding product to cart'), 'desc' => $this->l('Only for non-AJAX versions of the cart.'), 'cast' => 'intval', 'show' => true, 'required' => false, 'type' => 'radio', 'validation' => 'isBool', 'choices' => array(0 => $this->l('Previous page'), 1 => $this->l('Cart summary'))), 'PS_PRODUCT_SHORT_DESC_LIMIT' => array('title' => $this->l('Max size of short description'), 'desc' => $this->l('Set the maximum size of product short description (in characters).'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'suffix' => $this->l('characters')), 'PS_QTY_DISCOUNT_ON_COMBINATION' => array('title' => $this->l('Quantity discounts based on'), 'desc' => $this->l('How to calculate quantity discounts'), 'cast' => 'intval', 'show' => true, 'required' => false, 'type' => 'radio', 'validation' => 'isBool', 'choices' => array(0 => $this->l('Products:'), 1 => $this->l('Combinations'))))), 'order_by_pagination' => array('title' => $this->l('Pagination'), 'fields' => array('PS_PRODUCTS_PER_PAGE' => array('title' => $this->l('Products per page'), 'desc' => $this->l('Number of products displayed per page. Default is 10.'), 'validation' => 'isUnsignedInt', 'cast' => 'intval', 'type' => 'text'), 'PS_PRODUCTS_ORDER_BY' => array('title' => $this->l('Default order by'), 'desc' => $this->l('The order in which products are displayed in the product list.'), 'type' => 'select', 'list' => array(array('id' => '0', 'name' => $this->l('Product name')), array('id' => '1', 'name' => $this->l('Product price')), array('id' => '2', 'name' => $this->l('Product add date')), array('id' => '3', 'name' => $this->l('Product modified date')), array('id' => '4', 'name' => $this->l('Position inside category')), array('id' => '5', 'name' => $this->l('Manufacturer')), array('id' => '6', 'name' => $this->l('Product quantity'))), 'identifier' => 'id'), 'PS_PRODUCTS_ORDER_WAY' => array('title' => $this->l('Default order method'), 'desc' => $this->l('Default order method for product list'), 'type' => 'select', 'list' => array(array('id' => '0', 'name' => $this->l('Ascending')), array('id' => '1', 'name' => $this->l('Descending'))), 'identifier' => 'id'))), 'fo_product_page' => array('title' => $this->l('Product page'), 'fields' => array('PS_DISPLAY_QTIES' => array('title' => $this->l('Display available quantities on the product page'), 'desc' => '', 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool'), 'PS_LAST_QTIES' => array('title' => $this->l('Display remaining quantities when the qty is lower than'), 'desc' => $this->l('Set to "0" to disable this feature.'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text'), 'PS_DISPLAY_JQZOOM' => array('title' => $this->l('Enable JqZoom instead of Thickbox on the product page'), 'desc' => '', 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool'), 'PS_DISP_UNAVAILABLE_ATTR' => array('title' => $this->l('Display unavailable product attributes on the product page'), 'desc' => '', 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool'), 'PS_ATTRIBUTE_CATEGORY_DISPLAY' => array('title' => $this->l('Display the "add to cart" button when a product has attributes'), 'desc' => $this->l('Display or hide the "add to cart" button on category pages for products that have attributes forcing customers to see product details.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'))), 'stock' => array('title' => $this->l('Products stock'), 'fields' => array('PS_ORDER_OUT_OF_STOCK' => array('title' => $this->l('Allow ordering of out-of-stock products'), 'desc' => $this->l('Add to cart button is hidden when a product is unavailable'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool'), 'PS_STOCK_MANAGEMENT' => array('title' => $this->l('Enable stock management'), 'desc' => '', 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool', 'js' => array('on' => 'onchange="stockManagementActivationAuthorization()"', 'off' => 'onchange="stockManagementActivationAuthorization()"')), 'PS_ADVANCED_STOCK_MANAGEMENT' => array('title' => $this->l('Enable advanced-stock management'), 'desc' => $this->l('Allows you to manage physical stock, warehouses and supply orders.'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL)), 'bottom' => '<script type="text/javascript">stockManagementActivationAuthorization();</script>', 'submit' => array()));
}
开发者ID:FAVHYAN,项目名称:a3workout,代码行数:7,代码来源:AdminPPreferencesController.php
示例17: beforeFilter
public function beforeFilter()
{
AuthComponent::$sessionKey = 'Auth.admins';
parent::beforeFilter();
$view_flg = array('0' => '非表示', '1' => '表示');
$this->set('view_flg', $view_flg);
}
开发者ID:sanrentan,项目名称:sanrentan,代码行数:7,代码来源:ManageInformationsController.php
示例18: elseif
/**
* Store constructor
*
* @return void
**/
function __construct () {
parent::__construct();
if (!empty($_GET['id'])) {
wp_enqueue_script('jquery-ui-draggable');
wp_enqueue_script('suggest');
wp_enqueue_script('postbox');
if ( user_can_richedit() ) {
wp_enqueue_script('editor');
wp_enqueue_script('quicktags');
add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 20 );
}
ecart_enqueue_script('colorbox');
ecart_enqueue_script('editors');
ecart_enqueue_script('scalecrop');
ecart_enqueue_script('calendar');
ecart_enqueue_script('product-editor');
ecart_enqueue_script('priceline');
ecart_enqueue_script('ocupload');
ecart_enqueue_script('swfupload');
ecart_enqueue_script('ecart-swfupload-queue');
do_action('ecart_product_editor_scripts');
add_action('admin_head',array(&$this,'layout'));
} elseif (!empty($_GET['f']) && $_GET['f'] == 'i') {
do_action('ecart_inventory_manager_scripts');
add_action('admin_print_scripts',array(&$this,'inventory_cols'));
} else add_action('admin_print_scripts',array(&$this,'columns'));
add_action('load-ecart_page_ecart-products',array(&$this,'workflow'));
do_action('ecart_product_admin_scripts');
// Load the search model for indexing
require_once(ECART_MODEL_PATH."/Search.php");
new ContentParser();
add_action('ecart_product_saved',array(&$this,'index'),99,1);
}
开发者ID:robbiespire,项目名称:paQui,代码行数:40,代码来源:Warehouse.php
示例19: elseif
/**
* Categorize constructor
*
* @return void
**/
function __construct () {
parent::__construct();
if (!empty($_GET['id']) && !isset($_GET['a'])) {
wp_enqueue_script('postbox');
if ( user_can_richedit() ) {
wp_enqueue_script('editor');
wp_enqueue_script('quicktags');
add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 20 );
}
ecart_enqueue_script('colorbox');
ecart_enqueue_script('editors');
ecart_enqueue_script('category-editor');
ecart_enqueue_script('priceline');
ecart_enqueue_script('ocupload');
ecart_enqueue_script('swfupload');
ecart_enqueue_script('ecart-swfupload-queue');
do_action('ecart_category_editor_scripts');
add_action('admin_head',array(&$this,'layout'));
} elseif (!empty($_GET['a']) && $_GET['a'] == 'arrange') {
ecart_enqueue_script('category-arrange');
do_action('ecart_category_arrange_scripts');
add_action('admin_print_scripts',array(&$this,'arrange_cols'));
} elseif (!empty($_GET['a']) && $_GET['a'] == 'products') {
ecart_enqueue_script('products-arrange');
do_action('ecart_category_products_arrange_scripts');
add_action('admin_print_scripts',array(&$this,'products_cols'));
} else add_action('admin_print_scripts',array(&$this,'columns'));
do_action('ecart_category_admin_scripts');
add_action('load-ecart_page_ecart-categories',array(&$this,'workflow'));
}
开发者ID:robbiespire,项目名称:paQui,代码行数:39,代码来源:Categorize.php
示例20: edit
function edit($parameter)
{
$this->page_template_id = $this->getPTIFromId($parameter);
$this->set('page_template_id', $this->page_template_id);
$this->loadSubnav($parameter);
parent::edit($parameter);
}
开发者ID:nonfiction,项目名称:nterchange,代码行数:7,代码来源:page_template_containers_controller.php
注:本文中的AdminController类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论