本文整理汇总了PHP中Varien_Data_Form_Element_Abstract::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form_Element_Abstract::setId方法的具体用法?PHP Varien_Data_Form_Element_Abstract::setId怎么用?PHP Varien_Data_Form_Element_Abstract::setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Data_Form_Element_Abstract
的用法示例。
在下文中一共展示了Varien_Data_Form_Element_Abstract::setId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$html = '';
$data = Mage::getStoreConfig('auspost/activation/data');
$ele_value = explode(',', str_replace($data, '', Mage::helper('core')->decrypt($element->getValue())));
$ele_name = $element->getName();
$ele_id = $element->getId();
$element->setName($ele_name . '[]');
$data_info = Mage::helper('auspost')->getDataInfo();
if (isset($data_info['dom']) && intval($data_info['c']) > 0 && intval($data_info['suc']) == 1) {
foreach (Mage::app()->getWebsites() as $website) {
$url = $website->getConfig('web/unsecure/base_url');
$url = Mage::helper('auspost')->getFormatUrl(trim(preg_replace('/^.*?\\/\\/(.*)?\\//', '$1', $url)));
foreach ($data_info['dom'] as $web) {
if ($web['dom'] == $url && $web['suc'] == 1) {
$element->setChecked(false);
$id = $website->getId();
$name = $website->getName();
$element->setId($ele_id . '_' . $id);
$element->setValue($id);
if (in_array($id, $ele_value) !== false) {
$element->setChecked(true);
}
if ($id != 0) {
$html .= '<div><label>' . $element->getElementHtml() . ' ' . $name . ' </label></div>';
}
}
}
}
} else {
$html = sprintf('<strong class="required">%s</strong>', $this->__('Please enter a valid key'));
}
return $html;
}
示例2: _integrate
/**
* @return $this
*/
protected function _integrate()
{
$uniqueEntityId = $this->_getUniqueEntityId($this->_currentElement);
$idPrefix = $this->_currentElement->getForm()->getHtmlIdPrefix();
$this->_currentElement->setId(str_replace($idPrefix, '', $this->_currentElement->getHtmlId()) . $uniqueEntityId);
// adds to every Element the MD buttons at the bottom of the textarea
return $this->_getMarkdownButtons()->_addEpicEditorHtml()->_mergeAfterElementHtml();
}
示例3: addElement
/**
* Add form element
*
* @param Varien_Data_Form_Element_Abstract $element
* @param boolean|string $after also can be '^'
* @return Varien_Data_Form
*/
public function addElement(Varien_Data_Form_Element_Abstract $element, $after = false)
{
$element->setId($element->getData('name'));
parent::addElement($element, $after);
}
示例4: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$html = '';
$r = Mage::getStoreConfig('gomage_activation/advancednavigation/ar');
$value = explode(',', str_replace($r, '', Mage::helper('core')->decrypt($element->getValue())));
$nameprefix = $element->getName();
$idprefix = $element->getId();
$element->setName($nameprefix . '[]');
$info = Mage::helper('gomage_navigation')->ga();
if (isset($info['d']) && isset($info['c']) && intval($info['c']) > 0) {
foreach (Mage::app()->getWebsites() as $website) {
$element->setChecked(false);
$id = $website->getId();
$name = $website->getName();
$element->setId($idprefix . '_' . $id);
$element->setValue($id);
$element->setClass('gomage-navigation-available-sites');
if (in_array($id, $value) !== false) {
$element->setChecked(true);
}
if ($id != 0) {
$html .= '<div><label>' . $element->getElementHtml() . ' ' . $name . ' </label></div>';
}
}
$html .= '
<input id="' . $idprefix . '_diasbled" type="hidden" disabled="disabled" name="' . $nameprefix . '" />
<script type="text/javascript">
function updateGomageNavigationWebsites(){
$("' . $idprefix . '_diasbled").disabled = "disabled";
if($$(".gomage-navigation-available-sites:checked").length >= ' . intval($info['c']) . '){
$$(".gomage-navigation-available-sites").each(function(e){
if(!e.checked){
e.disabled = "disabled";
}
});
}else {
$$(".gomage-navigation-available-sites").each(function(e){
if(!e.checked){
e.disabled = "";
}
});
if($$(".gomage-navigation-available-sites:checked").length == 0){
$("' . $idprefix . '_diasbled").disabled = "";
}
}
}
$$(".gomage-navigation-available-sites").each(function(e){
e.observe("click", function(){
updateGomageNavigationWebsites();
});
});
updateGomageNavigationWebsites();
</script>';
} else {
$html = sprintf('<strong class="required">%s</strong>', $this->__('Please enter a valid key'));
}
return $html;
}
示例5: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$html = '';
$nameprefix = $element->getName();
$idprefix = $element->getId();
$element->setName($nameprefix . '[]');
$info = array();
$info['c'] = '5';
$info['d'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
if (isset($info['d']) && isset($info['c']) && intval($info['c']) > 0) {
foreach (Mage::app()->getWebsites() as $website) {
$element->setChecked(false);
$id = $website->getId();
$name = $website->getName();
$element->setId($idprefix . '_' . $id);
$element->setValue($id);
$element->setClass('gomage-checkout-available-sites');
if ($id !== false) {
$element->setChecked(true);
}
if ($id != 0) {
$html .= '<div><label>' . $element->getElementHtml() . ' ' . $name . ' </label></div>';
}
}
$html .= '
<input id="' . $idprefix . '_diasbled" type="hidden" disabled="disabled" name="' . $nameprefix . '" />
<script type="text/javascript">
function updateGomageCheckoutWebsites(){
$("' . $idprefix . '_diasbled").disabled = "disabled";
if($$(".gomage-checkout-available-sites:checked").length >= ' . intval($info['c']) . '){
$$(".gomage-checkout-available-sites").each(function(e){
if(!e.checked){
e.disabled = "disabled";
}
});
}else {
$$(".gomage-checkout-available-sites").each(function(e){
if(!e.checked){
e.disabled = "";
}
});
if($$(".gomage-checkout-available-sites:checked").length == 0){
$("' . $idprefix . '_diasbled").disabled = "";
}
}
}
$$(".gomage-checkout-available-sites").each(function(e){
e.observe("click", function(){
updateGomageCheckoutWebsites();
});
});
updateGomageCheckoutWebsites();
</script>';
} else {
$html = sprintf('<strong class="required">%s</strong>', $this->__('Please enter a valid key'));
}
return $html;
}