本文整理汇总了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;
}