Esempio n. 1
0
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $step = $this->getCsHelper()->getStep();
     if ($step != Commercesciences_Base_Helper_Data::STEP_ZERO) {
         return '';
     }
     return parent::render($element);
 }
Esempio n. 2
0
 /**
  * @see parent
  */
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $exampleCode = 'ABC123';
     $store = Mage::app()->getStore();
     $helper = Mage::helper('bronto_common/coupon');
     $comment = $element->getComment();
     $comment = str_replace('{baseUrl}', $store->getUrl('/'), $comment);
     $comment = str_replace('{code}', $helper->getCouponParam(), $comment);
     $comment = str_replace('{example}', $exampleCode, $comment);
     $comment = str_replace('{error}', $helper->getErrorCodeParam(), $comment);
     $element->setComment($comment);
     return parent::render($element);
 }
Esempio n. 3
0
 /**
  * If all conditions described in <conditions> section of the group description are TRUE - render as it was
  * specified as <frontend_type>text</frontend_type>. Otherwise don't render anything.
  *
  * @param Varien_Data_Form_Element_Abstract $fieldset
  * @return string
  */
 public function render(Varien_Data_Form_Element_Abstract $fieldset)
 {
     $this->_currentGroupName = $fieldset->getLegend();
     $group = $this->getGroup();
     $doRender = !empty($group) && isset($group->conditions);
     if ($doRender) {
         foreach ($group->conditions as $conditionLabels) {
             /* @var $conditionLabels Mage_Core_Model_Config_Element */
             $xpath = '';
             $shouldBeEmpty = null;
             $value = '';
             foreach ($conditionLabels as $condition) {
                 foreach ($condition as $conditionElement) {
                     /* @var $conditionElement Mage_Core_Model_Config_Element */
                     switch ($conditionElement->getName()) {
                         case 'xpath':
                             $xpath = (string) $conditionElement;
                             break;
                         case 'empty':
                             $shouldBeEmpty = true;
                             break;
                         case 'non_empty':
                             $shouldBeEmpty = false;
                             break;
                         case 'value':
                             $value = (string) $conditionElement;
                             break;
                     }
                 }
                 $node = Mage::app()->getConfig()->getNode($xpath);
                 if ($shouldBeEmpty !== null) {
                     $doRender = $shouldBeEmpty ? empty($node) : !empty($node);
                 } else {
                     $doRender = (string) $node == $value;
                 }
                 if (!$doRender) {
                     break;
                 }
             }
         }
     }
     return $doRender ? parent::render($fieldset) : '';
 }
Esempio n. 4
0
 /**
  * Return header comment part of html for fieldset
  *
  * @param Varien_Data_Form_Element_Abstract $element
  *
  * @return string
  */
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $url = Mage::helper('adminhtml')->getUrl('*/system_email_template');
     $element->setComment("Additional configuration located at: <strong>System &rsaquo; <a href=\"{$url}\">Transactional Emails</a></strong><br/><br/>");
     return parent::render($element);
 }
Esempio n. 5
0
 /**
  * Return header comment part of html for fieldset
  *
  * @param Varien_Data_Form_Element_Abstract $element
  *
  * @return string
  */
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $url = Mage::helper('adminhtml')->getUrl('*/reminders');
     $element->setComment("Additional configuration located at: <strong>Promotions &rsaquo; <a href=\"{$url}\">Bronto Reminder Emails</a></strong><br/><br/>");
     return parent::render($element);
 }
Esempio n. 6
0
 /**
  * @param Varien_Data_Form_Element_Abstract $element
  *
  * @return string
  */
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $helper = $this->_getHelper();
     if (!$helper->validApiToken()) {
         // Route to API token
         $url = $helper->getScopeUrl('*/system_config/edit', array('section' => 'bronto'));
         $element->setComment("In order to receive <strong>{$element->getLegend()}</strong>, you must enter a valid <a href=\"{$url}\">API Token</a>.");
     } else {
         foreach ($this->_pullRssItems() as $rssItem) {
             $this->addItemToFieldset($element, $rssItem)->setRenderer($this->_getRenderer());
         }
     }
     return parent::render($element);
 }
Esempio n. 7
0
 /**
  * Returns the description for the module in a read-only html block
  *
  * @param Varien_Data_Form_Element_Abstract $element
  * @return string
  */
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $url = Mage::helper('adminhtml')->getUrl('*/recommendations');
     $element->setComment(str_replace('{url}', $url, $element->getComment()));
     return parent::render($element);
 }