本文整理汇总了PHP中Mage_Adminhtml_Controller_Action::getRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Adminhtml_Controller_Action::getRequest方法的具体用法?PHP Mage_Adminhtml_Controller_Action::getRequest怎么用?PHP Mage_Adminhtml_Controller_Action::getRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Adminhtml_Controller_Action
的用法示例。
在下文中一共展示了Mage_Adminhtml_Controller_Action::getRequest方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareItemSave
/**
* @param Open_Gallery_Model_Item $item
* @param Mage_Adminhtml_Controller_Action $controller
* @return $this|Open_Gallery_Helper_Item_Interface
* @throws Exception
* @throws Mage_Core_Exception
* @throws Open_Gallery_Exception
*/
public function prepareItemSave(Open_Gallery_Model_Item $item, Mage_Adminhtml_Controller_Action $controller)
{
$data = $controller->getRequest()->getPost('item');
if (isset($data['thumbnail'], $data['thumbnail']['delete']) && !empty($data['thumbnail']['delete'])) {
$item->deleteThumbnail();
$item->setData('thumbnail', '');
} else {
if (isset($_FILES['item']['tmp_name']['thumbnail']) && $_FILES['item']['tmp_name']['thumbnail']) {
try {
$savedFilePath = $this->_saveFile('item[thumbnail]', array('jpg', 'jpeg', 'png', 'gif'), 'thumbnail');
$item->setData('thumbnail', $savedFilePath);
} catch (Mage_Core_Exception $e) {
throw $e;
} catch (Exception $e) {
Mage::logException($e);
throw new Open_Gallery_Exception($this->__("Can't save thumbnail."));
}
}
}
unset($data['thumbnail'], $data['value']);
$item->addData($data);
return $this;
}
示例2: validateCmsHierarchyAction
/**
* Block editing of Hierarchy if GWS permissions are applicable
*
* @param Mage_Adminhtml_Controller_Action $controller
* @return bool|void
*/
public function validateCmsHierarchyAction($controller)
{
if (!$this->_role->getIsAll()) {
$requestAction = $this->_request->getActionName();
if ($requestAction == 'delete' || $requestAction == 'copy') {
$scopesParam = $this->_request->getParam('scopes');
$scopesParamIsArray = true;
if (!is_array($scopesParam)) {
$scopesParam = array($scopesParam);
$scopesParamIsArray = false;
}
$validatedScopes = array();
foreach (array_unique($scopesParam) as $value) {
if (0 === strpos($value, Enterprise_Cms_Helper_Hierarchy::SCOPE_PREFIX_WEBSITE)) {
$scopeId = (int) str_replace(Enterprise_Cms_Helper_Hierarchy::SCOPE_PREFIX_WEBSITE, '', $value);
if ($this->_role->hasExclusiveAccess((array) $scopeId)) {
$validatedScopes[] = $value;
}
} elseif (0 === strpos($value, Enterprise_Cms_Helper_Hierarchy::SCOPE_PREFIX_STORE)) {
$scopeId = (int) str_replace(Enterprise_Cms_Helper_Hierarchy::SCOPE_PREFIX_STORE, '', $value);
if ($this->_role->hasExclusiveStoreAccess((array) $scopeId)) {
$validatedScopes[] = $value;
}
}
}
if (count($validatedScopes) > 0) {
if ($requestAction == 'delete' && !$scopesParamIsArray && count($validatedScopes) == 1 && isset($validatedScopes[0])) {
$validatedScopes = $validatedScopes[0];
}
$this->_request->setParam('scopes', $validatedScopes);
} else {
$this->_forward();
return false;
}
} else {
$websiteCode = $controller->getRequest()->getParam('website');
$website = Mage::app()->getWebsite($websiteCode);
$websiteId = $website->getId();
if (!$this->_role->hasExclusiveAccess((array) $websiteId)) {
$storeCode = $controller->getRequest()->getParam('store');
$store = Mage::app()->getStore($storeCode);
$storeId = $store->getId();
if (!$this->_role->hasExclusiveStoreAccess((array) $storeId)) {
$this->_forward();
return false;
}
}
}
}
return true;
}
示例3: validateRmaAttributeSaveAction
/**
* Block deleting of options of attributes for all GWS enabled users
*
* @param Mage_Adminhtml_Controller_Action $controller
* @return bool
*/
public function validateRmaAttributeSaveAction($controller)
{
$option = $controller->getRequest()->getPost('option');
if (!empty($option['delete'])) {
unset($option['delete']);
$controller->getRequest()->setPost('option', $option);
}
return $this->validateRmaAttributeEditAction($controller);
}
示例4: validateRmaEditAction
/**
* Block editing of RMA on disallowed stores
*
* @param Mage_Adminhtml_Controller_Action $controller
* @return bool|void
*/
public function validateRmaEditAction($controller)
{
$id = $controller->getRequest()->getParam('id');
if (!$id) {
$this->_forward();
return false;
}
$store = $this->_getEnterpriseRMA($id)->getStoreId();
try {
if (empty($store) || !$this->_role->hasStoreAccess($store)) {
$this->_forward();
return false;
}
} catch (Mage_Core_Exception $e) {
$this->_forward();
return false;
}
return true;
}
示例5: updateConfigLayout
/**
* Update layout of inventory configuration page
*
* @param Mage_Adminhtml_Controller_Action $controller
*/
public function updateConfigLayout($controller, $layout)
{
$request = $controller->getRequest();
$fullRequest = $controller->getFullActionName();
$applied = false;
if ($fullRequest == 'adminhtml_system_config_edit' && $request->getParam('section') == 'inventoryplus') {
$applied = true;
}
if ($fullRequest == 'adminhtml_sales_order_shipment_new' && $request->getParam('inventoryplus') == '1') {
$applied = true;
}
if ($fullRequest == 'adminhtml_sales_order_shipment_view' && $request->getParam('inventoryplus') == '1') {
$applied = true;
}
if ($applied) {
$layout->getUpdate()->addHandle('inventoryplusadmin_adminhtml_inventory_menu');
}
if ($fullRequest == 'adminhtml_sales_order_view' && $request->getParam('inventoryplus') == '1') {
$layout->getUpdate()->addHandle('inventoryshipmentadmin_adminhtml_sales_order_view');
}
}
示例6: validateTransactionalEmails
/**
* Validate misc Transactional Emails
*
* @param Mage_Adminhtml_Controller_Action $controller
*/
public function validateTransactionalEmails($controller)
{
if (in_array($controller->getRequest()->getActionName(), array('delete', 'save', 'new'))) {
$this->_forward();
return false;
}
}