本文整理汇总了PHP中ModuleAdminController类的典型用法代码示例。如果您正苦于以下问题:PHP ModuleAdminController类的具体用法?PHP ModuleAdminController怎么用?PHP ModuleAdminController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ModuleAdminController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
Yii::import('application.modules.advertising.models.AdvertArea');
$advertModel = new Advert();
$advertModel->publishAssets();
parent::init();
}
示例2: postProcess
public function postProcess()
{
if (($imgName = Tools::getValue('imgName', false)) !== false) {
unlink($this->img_path . $imgName);
}
parent::postProcess();
}
示例3: initToolbar
public function initToolbar()
{
parent::initToolbar();
// Remove "Add" button from toolbar
unset($this->toolbar_btn['new']);
unset($this->toolbar_btn['export']);
}
示例4: postProcess
public function postProcess()
{
if ($this->ajax) {
return parent::postProcess();
}
$this->redirect_after = $this->context->link->getAdminLink('AdminModules', true) . '&module_name=' . $this->module->name . '&tab_module=' . $this->module->tab . '&configure=' . $this->module->name;
}
示例5: renderList
public function renderList()
{
$this->initToolbar();
$this->addRowAction('edit');
$this->addRowAction('delete');
return parent::renderList();
}
示例6: initContent
public function initContent()
{
$info = '';
$query = 'SELECT `name` FROM `ps_hook`';
$sql = Db::getInstance()->executeS($query);
if (Tools::getAdminTokenLite('AdminModules') == Tools::getValue('token')) {
if (Tools::isSubmit('btnSubmit')) {
$info = $this->postProcess();
}
}
//Get links
$controller_link = Context::getContext()->link->getAdminLink('AdminPSMGen');
$this->context->smarty->assign('path', _MODULE_DIR_ . $this->module->name . '/');
$this->context->smarty->assign('controller_link', $controller_link);
$this->context->smarty->assign('info', $info);
$i = 0;
$array_installhooks = array();
//$array_check = array();
for ($i = 0; $i < count($sql); $i++) {
$hook = $sql[$i];
$hook['id'] = 'hooks_' . $hook['name'];
$hook['value'] = $hook['name'];
$hook['label'] = $hook['name'];
$sql[$i] = $hook;
$array_installhooks[$i] = array('name' => 'install_' . $hook['id'], 'id' => 'install_' . $hook['id'], 'value' => 'install_' . $hook['id'], 'label' => 'install_' . $hook['id']);
}
$this->context->smarty->assign('sql', $sql);
$this->context->smarty->assign('array_installhooks', $array_installhooks);
// $this->context->smarty->assign('content_only' => '1');
// $form = $this->displayForm($sql);
// $this->context->smarty->assign('form1', $form);
$this->setTemplate('../../../../modules/' . $this->module->name . '/views/templates/admin/admintemplate.tpl');
//$smarty->assign('items', $items_list);
parent::initContent();
}
示例7: getList
public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
{
parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop);
$nb_items = count($this->_list);
$this->tpl_list_vars['nb_items'] = $nb_items;
if ($nb_items > 0) {
for ($i = 0; $i < $nb_items; ++$i) {
$item =& $this->_list[$i];
$item['token'] = Tools::getAdminTokenLite($item['controller']);
}
}
$currentLanguage = Language::getIsoById((int) $this->context->language->id);
$urlEShop = URL_ESHOP_EN;
$urlTechnicalSupport = URL_TECHNICAL_SUPPORT_EN;
if ($currentLanguage == 'fr') {
$urlEShop = URL_ESHOP_FR;
$urlTechnicalSupport = URL_TECHNICAL_SUPPORT_FR;
} elseif ($currentLanguage == 'es') {
$urlTechnicalSupport = URL_TECHNICAL_SUPPORT_ES;
} elseif ($currentLanguage == 'it') {
$urlTechnicalSupport = URL_TECHNICAL_SUPPORT_IT;
}
$this->context->smarty->assign(array('token' => Tools::getValue('token'), 'urlEShop' => $urlEShop, 'urlTechnicalSupport' => $urlTechnicalSupport, 'licenceActive' => date('Y-m-d') > Configuration::get('ERP_WS_DATE_END') ? false : true));
// Configuration CSS/JS
if (version_compare(_PS_VERSION_, '1.6') == -1) {
$this->context->controller->addCSS(_MODULE_DIR_ . '/erpillicopresta/css/bs3.css');
}
$this->context->controller->addCSS(_MODULE_DIR_ . '/erpillicopresta/css/adminerp.css');
$this->context->controller->addJS(_MODULE_DIR_ . '/erpillicopresta/js/tools.js');
}
示例8: initContent
public function initContent()
{
$data = array();
$htm = $this->context->smarty->createTemplate(_PS_MODULE_DIR_ . 'smartblog/views/templates/admin/aboutus.tpl', $data)->fetch();
$this->content = $htm;
return parent::initContent();
}
示例9: setMedia
public function setMedia()
{
parent::setMedia();
Media::addJsDef(array('admin_fronteditor_ajax_url' => $this->context->link->getAdminLink('IqitFronteditor')));
$this->addCSS(array(_MODULE_DIR_ . 'iqitcontentcreator/css/bfronteditor.css'));
$this->addJS(array(_MODULE_DIR_ . 'iqitcontentcreator/js/bfronteditor.js'));
}
示例10: renderView
public function renderView()
{
$badges_feature = new Collection('badge', $this->context->language->id);
$badges_feature->where('type', '=', 'feature');
$badges_feature->orderBy('id_group');
$badges_feature->orderBy('group_position');
$badges_achievement = new Collection('badge', $this->context->language->id);
$badges_achievement->where('type', '=', 'achievement');
$badges_achievement->orderBy('id_group');
$badges_achievement->orderBy('group_position');
$badges_international = new Collection('badge', $this->context->language->id);
$badges_international->where('type', '=', 'international');
$badges_international->orderBy('id_group');
$badges_international->orderBy('group_position');
$groups = array();
$query = new DbQuery();
$query->select('DISTINCT(b.`id_group`), bl.group_name, b.type');
$query->from('badge', 'b');
$query->join('
LEFT JOIN `' . _DB_PREFIX_ . 'badge_lang` bl ON bl.`id_badge` = b.`id_badge`');
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
foreach ($result as $res) {
$groups['badges_' . $res['type']][$res['id_group']] = $res['group_name'];
}
$badges_type = array('badges_feature' => array('name' => $this->l('Features'), 'badges' => $badges_feature), 'badges_achievement' => array('name' => $this->l('Achievements'), 'badges' => $badges_achievement), 'badges_international' => array('name' => $this->l('International'), 'badges' => $badges_international));
$levels = array(1 => $this->l('1. Beginner'), 2 => $this->l('2. Pro'), 3 => $this->l('3. Expert'), 4 => $this->l('4. Wizard'), 5 => $this->l('5. Guru'), 6 => $this->l('6. Legend'));
$this->tpl_view_vars = array('badges_type' => $badges_type, 'current_level_percent' => (int) Configuration::get('GF_CURRENT_LEVEL_PERCENT'), 'current_level' => (int) Configuration::get('GF_CURRENT_LEVEL'), 'groups' => $groups, 'levels' => $levels);
return parent::renderView();
}
示例11: initContent
public function initContent()
{
$admin_seur = new AdminSeur(false);
if (!$admin_seur->module_enabled_and_configured) {
$admin_seur->displayModuleConfigurationWarning();
$this->content = $admin_seur->content;
return parent::initContent();
}
$this->display = 'view';
$this->module_instance = Module::getInstanceByName('seur');
Context::getContext()->controller->addJqueryUI('ui.datepicker');
if (Tools::getValue('verDetalle')) {
$response = Expedition::getExpeditions($admin_seur->getExpeditionData());
$this->tpl_view_vars = array('datos' => $admin_seur->displayFormDeliveries($response, true));
} elseif (Tools::getValue('createPickup')) {
$error_response = Pickup::createPickup();
if (!empty($error_response)) {
$this->tpl_view_vars = array('datos' => $admin_seur->displayFormDeliveries(null, null, $error_response));
} else {
$this->tpl_view_vars = array('datos' => $admin_seur->displayFormDeliveries());
}
} elseif (Tools::getValue('submitFilter')) {
$response = Expedition::getExpeditions($admin_seur->getExpeditionData());
$this->tpl_view_vars = array('datos' => $admin_seur->displayFormDeliveries($response, false));
} else {
$this->tpl_view_vars = array('datos' => $admin_seur->displayFormDeliveries());
}
$this->content = $admin_seur->content;
$this->fields_list = $admin_seur->fields_list;
parent::initContent();
}
示例12: __construct
public function __construct()
{
// Set variables
$this->table = 'mymod_comment';
$this->className = 'MyModComment';
$this->fields_list = array('id_mymod_comment' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'shop_name' => array('title' => $this->l('Shop'), 'width' => 120, 'filter_key' => 's!name'), 'firstname' => array('title' => $this->l('Firstname'), 'width' => 120), 'lastname' => array('title' => $this->l('Lastname'), 'width' => 140), 'email' => array('title' => $this->l('E-mail'), 'width' => 150), 'product_name' => array('title' => $this->l('Product'), 'width' => 100, 'filter_key' => 'pl!name'), 'grade_display' => array('title' => $this->l('Grade'), 'align' => 'right', 'width' => 80, 'filter_key' => 'a!grade'), 'comment' => array('title' => $this->l('Comment'), 'search' => false), 'date_add' => array('title' => $this->l('Date add'), 'type' => 'date'));
// Set fields form for form view
$this->context = Context::getContext();
$this->context->controller = $this;
$this->fields_form = array('legend' => array('title' => $this->l('Add / Edit Comment'), 'image' => '../img/admin/contact.gif'), 'input' => array(array('type' => 'text', 'label' => $this->l('Firstname'), 'name' => 'firstname', 'size' => 30, 'required' => true), array('type' => 'text', 'label' => $this->l('Lastname'), 'name' => 'lastname', 'size' => 30, 'required' => true), array('type' => 'text', 'label' => $this->l('E-mail'), 'name' => 'email', 'size' => 30, 'required' => true), array('type' => 'select', 'label' => $this->l('Product'), 'name' => 'id_product', 'required' => true, 'default_value' => 1, 'options' => array('query' => Product::getProducts($this->context->cookie->id_lang, 1, 1000, 'name', 'ASC'), 'id' => 'id_product', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('Grade'), 'name' => 'grade', 'size' => 30, 'required' => true, 'desc' => $this->l('Grade must be between 1 and 5')), array('type' => 'textarea', 'label' => $this->l('Comment'), 'name' => 'comment', 'cols' => 50, 'rows' => 5, 'required' => false)), 'submit' => array('title' => $this->l('Save')));
// Enable bootstrap
$this->bootstrap = true;
// Call of the parent constructor method
parent::__construct();
// Update the SQL request of the HelperList
$this->_select = "s.`name` as shop_name, pl.`name` as product_name, CONCAT(a.`grade`, '/5') as grade_display";
$this->_join = 'LEFT JOIN `' . _DB_PREFIX_ . 'product_lang` pl ON (pl.`id_product` = a.`id_product` AND pl.`id_lang` = ' . (int) $this->context->language->id . ' AND pl.`id_shop` = a.`id_shop`)
LEFT JOIN `' . _DB_PREFIX_ . 'shop` s ON (s.`id_shop` = a.`id_shop`)';
// Add actions
$this->addRowAction('view');
$this->addRowAction('delete');
$this->addRowAction('edit');
// Add bulk actions
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Would you like to delete the selected items?')), 'myaction' => array('text' => $this->l('My Action'), 'confirm' => $this->l('Are you sure?')));
// Define meta and toolbar title
$this->meta_title = $this->l('Comments on Product');
if (Tools::getIsset('viewmymod_comment')) {
$this->meta_title = $this->l('View comment') . ' #' . Tools::getValue('id_mymod_comment');
}
$this->toolbar_title[] = $this->meta_title;
}
示例13: renderForm
public function renderForm()
{
if (!($obj = $this->loadObject(true))) {
return;
}
$this->fields_form = array('legend' => array('title' => $this->l('Tag')), 'input' => array(array('type' => 'text', 'label' => $this->l('Name:'), 'name' => 'name', 'required' => true), array('type' => 'select', 'label' => $this->l('Language:'), 'name' => 'id_lang', 'required' => true, 'options' => array('query' => Language::getLanguages(false), 'id' => 'id_lang', 'name' => 'name'))), 'selects' => array('posts' => $obj->getPosts(true), 'posts_unselected' => $obj->getPosts(false)), 'submit' => array('title' => $this->l('Save'), 'class' => 'button'));
return parent::renderForm();
}
示例14: __construct
public function __construct()
{
$this->display_header = false;
$this->display_footer = false;
$this->content_only = true;
parent::__construct();
$this->_ajax_results['error_on'] = 0;
}
示例15: renderOptions
public function renderOptions()
{
$this->context->smarty->assign(array('marketing' => !Configuration::get('POWATAG_HMAC_KEY') || !Configuration::get('POWATAG_API_KEY')));
$before = $this->module->display(dirname(__FILE__) . '/../../' . $this->module->name . '.php', 'powatag_configuration_before.tpl');
$form = parent::renderOptions();
$after = $this->module->display(dirname(__FILE__) . '/../../' . $this->module->name . '.php', 'powatag_configuration_after.tpl');
return $before . $form . $after;
}