本文整理匯總了PHP中Varien_Data_Form_Element_Abstract::getScope方法的典型用法代碼示例。如果您正苦於以下問題:PHP Varien_Data_Form_Element_Abstract::getScope方法的具體用法?PHP Varien_Data_Form_Element_Abstract::getScope怎麽用?PHP Varien_Data_Form_Element_Abstract::getScope使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Varien_Data_Form_Element_Abstract
的用法示例。
在下文中一共展示了Varien_Data_Form_Element_Abstract::getScope方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: render
public function render(Varien_Data_Form_Element_Abstract $element)
{
$this->setData('scope', $element->getScope());
// Remove the inheritance checkbox
$element->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
return parent::render($element);
}
示例2: render
public function render(Varien_Data_Form_Element_Abstract $element)
{
if ($element->getScope() == "stores") {
$this->setStoreId($element->getScopeId());
}
// Remove the scope information so it doesn't get printed out
$element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
return parent::render($element);
}
示例3: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$scope = $element->getScope();
$scope_id = $element->getScopeId();
$inherit = $element->getInherit();
$factoryName = (string) $element->getFieldConfig()->source_model;
$sourceModel = Mage::getSingleton($factoryName);
$optionArray = $sourceModel->toOptionArray(True, $scope, $scope_id);
$element->setValues($optionArray);
$html = $this->getElementHtml($element);
return $html;
// return parent::_getElementHtml($element);
}
示例4: render
public function render(Varien_Data_Form_Element_Abstract $element)
{
// Only show the current scope hasn't been configured yet
switch ($element->getScope()) {
case "stores":
if ($this->hasApiKeys($element->getScopeId())) {
return "";
}
break;
case "websites":
$website = Mage::app()->getWebsite($element->getScopeId());
if ($this->hasApiKeys($website->getStores())) {
return "";
}
break;
default:
if ($this->hasApiKeys()) {
return "";
}
}
// Remove the scope information so it doesn't get printed out
$element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
return parent::render($element);
}
示例5: _renderScopeLabel
/**
* Render scope label
*
* @param Varien_Data_Form_Element_Abstract $element
* @return Mage_Adminhtml_Block_System_Config_Form_Field
*/
protected function _renderScopeLabel(Varien_Data_Form_Element_Abstract $element)
{
$html = '<td class="scope-label">';
if ($element->getScope() && !Mage::app()->isSingleStoreMode()) {
$html .= $element->getScopeLabel();
}
$html .= '</td>';
return $html;
}