本文整理匯總了PHP中Varien_Event_Observer::getConfig方法的典型用法代碼示例。如果您正苦於以下問題:PHP Varien_Event_Observer::getConfig方法的具體用法?PHP Varien_Event_Observer::getConfig怎麽用?PHP Varien_Event_Observer::getConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Varien_Event_Observer
的用法示例。
在下文中一共展示了Varien_Event_Observer::getConfig方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: disableWysiwyg
public function disableWysiwyg(Varien_Event_Observer $observer)
{
/** @var Varien_Object $config */
$config = $observer->getConfig();
$handles = Mage::app()->getLayout()->getUpdate()->getHandles();
if (in_array('MARKDOWN_ENABLED', $handles)) {
$config->setData('enabled', false);
}
}
示例2: addDevSystemConfig
/**
* Adds extra parameters for developers
*
* @param Varien_Event_Observer $observer
* @return $this
*/
public function addDevSystemConfig(Varien_Event_Observer $observer)
{
$hasDevParam = Mage::app()->getRequest()->getParam('dev');
if (!(Mage::getIsDeveloperMode() || $hasDevParam)) {
return $this;
}
/**
* Hidden API field declaration in Website/Store view
*
* @var Mage_Core_Model_Config_Element $optionTab
*/
$config = $observer->getConfig();
$optionTab = $config->getNode('sections/shopgate/groups/option/fields');
$devConfig = new Mage_Core_Model_Config_Element('
<fields>
<customer_number translate="label comment tooltip">
<label>Customer number</label>
<frontend_type>text</frontend_type>
<sort_order>11</sort_order>
<show_in_default>0</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<validate>validate-number validate-length
minimum-length-5
</validate>
</customer_number>
<shop_number translate="label comment tooltip">
<label>Shop number</label>
<frontend_type>text</frontend_type>
<sort_order>13</sort_order>
<show_in_default>0</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<validate>validate-number validate-length
minimum-length-5
</validate>
</shop_number>
<api_key translate="label comment tooltip">
<label>API key</label>
<frontend_type>text</frontend_type>
<sort_order>15</sort_order>
<show_in_default>0</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<validate>validate-alphanum validate-length
minimum-length-20 maximum-length-20
</validate>
</api_key>
</fields>
');
$optionTab->extend($devConfig);
/**
* Hidden oAuth token declaration in Store View
*
* @var Mage_Core_Model_Config_Element $shopgateSection
*/
$shopgateSection = $config->getNode('sections/shopgate/groups');
$hiddenGroup = new Mage_Core_Model_Config_Element('
<hidden translate="label">
<label>Developer Only Section</label>
<sort_order>15</sort_order>
<show_in_default>0</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<oauth_access_token translate="label tooltip">
<label>Oauth Access Token</label>
<frontend_type>text</frontend_type>
<sort_order>10</sort_order>
<show_in_default>0</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>1</show_in_store>
<tooltip>Use Shopgate connect button unless you know what you are doing</tooltip>
</oauth_access_token>
</fields>
</hidden>
');
$shopgateSection->appendChild($hiddenGroup);
return $this;
}