本文整理匯總了PHP中ModuleAdminController::initProcess方法的典型用法代碼示例。如果您正苦於以下問題:PHP ModuleAdminController::initProcess方法的具體用法?PHP ModuleAdminController::initProcess怎麽用?PHP ModuleAdminController::initProcess使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ModuleAdminController
的用法示例。
在下文中一共展示了ModuleAdminController::initProcess方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: initProcess
/**
* Adds no_follow toggle action to process routing
*/
public function initProcess()
{
parent::initProcess();
// @TODO Refactor 'if' statement to match other controllers, the way they add extra actions
if (empty($this->action) && Tools::getValue($this->identifier)) {
if (Tools::getIsset('no_follow' . $this->table) || Tools::getIsset('no_follow')) {
if ($this->tabAccess['edit'] === '1') {
$this->action = 'no_follow';
} else {
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
}
}
}
}
示例2: initProcess
/**
* @return mixed
*/
public function initProcess()
{
if (Tools::getIsset('detailsnow_block_cms_footer_column')) {
$this->list_id = 'details';
if (isset($_POST['submitReset' . $this->list_id])) {
$this->processResetFilters();
}
} elseif (Tools::getIsset('addnow_block_cms_footer') || Tools::getIsset('updatenow_block_cms_footer')) {
if ($this->tabAccess['add'] === '1') {
$this->action = 'new';
$this->display = 'add';
} else {
$this->errors[] = Tools::displayError('You do not have permission to add this.');
}
} else {
$this->list_id = 'column';
}
return parent::initProcess();
}
示例3: initProcess
public function initProcess()
{
parent::initProcess();
}
示例4: initProcess
/**
* @see ModuleAdminController::initProcess()
*/
public function initProcess()
{
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
parent::initProcess();
}
示例5: initProcess
public function initProcess()
{
if (!$this->action) {
parent::initProcess();
} else {
$this->id_object = (int) Tools::getValue($this->identifier);
}
}
示例6: initProcess
public function initProcess()
{
// Are we working on feature values?
if (Tools::getValue('id_feature_value') || Tools::isSubmit('deletefeature_value') || Tools::isSubmit('submitAddfeature_value') || Tools::isSubmit('addfeature_value') || Tools::isSubmit('updatefeature_value') || Tools::isSubmit('submitBulkdeletefeature_value')) {
$this->setTypeValue();
}
if (Tools::getIsset('viewfeature')) {
$this->list_id = 'feature_value';
$this->_defaultOrderBy = 'position';
$this->_defaultOrderWay = 'ASC';
if (isset($_POST['submitReset' . $this->list_id])) {
$this->processResetFilters();
}
} else {
$this->list_id = 'feature';
$this->_defaultOrderBy = 'position';
$this->_defaultOrderWay = 'ASC';
}
parent::initProcess();
}
示例7: initProcess
public function initProcess()
{
if (Tools::isSubmit('submitAddproduct_shopAndStay') || Tools::isSubmit('submitAddproduct_shop')) {
$id_product = (int) Tools::getValue('id_product');
$id_shop = (int) Tools::getValue('id_shop');
$this->object = new Product($id_product, false, (int) Context::getContext()->language->id, $id_shop);
}
if (!$this->action) {
parent::initProcess();
} else {
list($this->id_product, $this->id_shop) = explode('-', Tools::getValue('id_ps'));
$this->id_object = Tools::getValue('id_ps');
}
}
示例8: initProcess
public function initProcess()
{
parent::initProcess();
if (Tools::isSubmit('deleteImg') && Tools::getValue('id_img')) {
$this->action = 'postimage';
}
}
示例9: initProcess
public function initProcess()
{
// Shop images management
if (Tools::getValue('id_image') && Tools::getValue('ajax')) {
if ($this->tabAccess['edit'] === '1') {
$this->action = 'image';
} else {
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
}
} elseif (Tools::isSubmit('id_shop')) {
$post_max_size = Tools::getMaxUploadSize(Configuration::get('PS_LIMIT_UPLOAD_FILE_VALUE') * 1024 * 1024);
if ($post_max_size && isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['CONTENT_LENGTH'] && $_SERVER['CONTENT_LENGTH'] > $post_max_size) {
$this->errors[] = sprintf(Tools::displayError('The uploaded file exceeds the "Maximum size for a downloadable product" set in preferences (%1$dMB) or the post_max_size/ directive in php.ini (%2$dMB).'), number_format(Configuration::get('PS_LIMIT_UPLOAD_FILE_VALUE')), $post_max_size / 1024 / 1024);
}
}
if (!$this->action) {
parent::initProcess();
} else {
$this->id_object = (int) Tools::getValue($this->identifier);
}
if (isset($this->available_tabs[Tools::getValue('key_tab')])) {
$this->tab_display = Tools::getValue('key_tab');
}
// Set tab to display if not decided already
if (!$this->tab_display && $this->action) {
if (in_array($this->action, array_keys($this->available_tabs))) {
$this->tab_display = $this->action;
}
}
// And if still not set, use default
if (!$this->tab_display) {
if (in_array($this->default_tab, $this->available_tabs)) {
$this->tab_display = $this->default_tab;
} else {
$this->tab_display = key($this->available_tabs);
}
}
}
示例10: initProcess
public function initProcess()
{
// Product images management
if (Tools::getValue('id_image') && Tools::getValue('ajax')) {
if ($this->tabAccess['edit'] === '1') {
$this->action = 'image';
} else {
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
}
} elseif (Tools::isSubmit('id_product')) {
$post_max_size = Tools::getMaxUploadSize(Configuration::get('PS_LIMIT_UPLOAD_FILE_VALUE') * 1024 * 1024);
if ($post_max_size && isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['CONTENT_LENGTH'] && $_SERVER['CONTENT_LENGTH'] > $post_max_size) {
$this->errors[] = sprintf(Tools::displayError('The uploaded file exceeds the "Maximum size for a downloadable product" set in preferences (%1$dMB) or the post_max_size/ directive in php.ini (%2$dMB).'), number_format(Configuration::get('PS_LIMIT_UPLOAD_FILE_VALUE')), $post_max_size / 1024 / 1024);
}
}
if (!$this->action) {
parent::initProcess();
} else {
$this->id_object = (int) Tools::getValue($this->identifier);
}
}