Example #1
0
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $output = '';
     foreach ($element->getSortedElements() as $field) {
         $id = $field->getHtmlId();
         $output .= '<div class="creativestyle-info" id="container_' . $id . '"' . (!$field->getValue() ? ' style="display:none;"' : '') . '>';
         $output .= '<div style="float:right;"><input id="amazon_show_signup_info" type="checkbox" class="checkbox" value="1" name="amazon_show_signup_info"' . (!$field->getValue() ? ' checked="checked"' : '') . '/> <label for="amazon_show_signup_info" style="font-size: 11px; color: #666666;">' . $this->__('Do not show again') . '</label></div>';
         $output .= '<p><strong>' . $this->__('Please note!') . '</strong> ';
         $output .= $this->__('If you do not have a Checkout by Amazon account yet please sign up.');
         $output .= '</p><ul>';
         $output .= '<li>DE: <a target="_blank" href="https://payments.amazon.de/business/?ld=INDECBAmagentoplugin">https://payments.amazon.de/business/</a></li>';
         $output .= '<li>UK: <a target="_blank" href="https://payments.amazon.co.uk/business/?ld=INUKCBAMagentoplugin">https://payments.amazon.co.uk/business/</a></li>';
         $output .= '</ul>';
         $output .= '<input type="hidden" id="' . $field->getHtmlId() . '" name="' . $field->getName() . '" value="' . $field->getEscapedValue() . '"/>';
         $output .= '<script type="text/javascript">//<![CDATA[' . "\n";
         $output .= '    Event.observe(\'amazon_show_signup_info\', \'click\', function() {' . "\n";
         $output .= '        if ($(\'amazon_show_signup_info\').checked) {' . "\n";
         $output .= '            if (confirm(\'' . $this->__('Are you sure?') . '\')) {' . "\n";
         $output .= '                $(\'container_' . $id . '\').hide();' . "\n";
         $output .= '                $(\'' . $field->getHtmlId() . '\').value = 0;' . "\n";
         $output .= '            } else {' . "\n";
         $output .= '                $(\'amazon_show_signup_info\').checked = false;' . "\n";
         $output .= '            };' . "\n";
         $output .= '        } else {' . "\n";
         $output .= '            $(\'container_' . $id . '\').show();' . "\n";
         $output .= '            $(\'' . $field->getHtmlId() . '\').value = 1;' . "\n";
         $output .= '        };' . "\n";
         $output .= '    });' . "\n";
         $output .= '//]]></script>' . "\n";
         $output .= '</div>';
         break;
     }
     return $output;
 }
 /**
  * Render fieldset html
  *
  * @param Varien_Data_Form_Element_Abstract $fieldset
  * @return string
  */
 public function render(Varien_Data_Form_Element_Abstract $fieldset)
 {
     foreach ($fieldset->getSortedElements() as $element) {
         $htmlId = $element->getHtmlId();
         $this->_elements[$htmlId] = $element;
     }
     $originalData = $fieldset->getOriginalData();
     $this->addData(array('fieldset_label' => $fieldset->getLegend(), 'fieldset_help_url' => isset($originalData['help_url']) ? $originalData['help_url'] : ''));
     return $this->toHtml();
 }
Example #3
0
 /**
  * Render fieldset html
  *
  * @param Varien_Data_Form_Element_Abstract $fieldset
  * @return string
  */
 public function render(Varien_Data_Form_Element_Abstract $fieldset)
 {
     foreach ($fieldset->getSortedElements() as $element) {
         $htmlId = $element->getHtmlId();
         $this->_elements[$htmlId] = $element;
     }
     $originalData = $fieldset->getOriginalData();
     $this->addData(array('fieldset_label' => $fieldset->getLegend(), 'fieldset_admin_label' => isset($originalData['admin_label']) ? $originalData['admin_label'] : '', 'fieldset_backend_url' => Mage::getModel('intraship/config')->getBackendUrl(), 'fieldset_help_url' => isset($originalData['help_url']) ? $originalData['help_url'] : '', 'fieldset_doc_url' => isset($originalData['doc_url']) ? $originalData['doc_url'] : '', 'fieldset_onlineretoure_doc_url' => isset($originalData['onlineretoure_doc_url']) ? $originalData['onlineretoure_doc_url'] : '', 'fieldset_partner_url' => isset($originalData['partner_url']) ? $originalData['partner_url'] : ''));
     return $this->toHtml();
 }
 /**
  * Return footer html for fieldset
  * Add extra tooltip comments to elements
  *
  * @param Varien_Data_Form_Element_Abstract $element
  * @return string
  */
 protected function _getFooterHtml($element)
 {
     $tooltipsExist = false;
     $html = '</tbody></table>';
     foreach ($element->getSortedElements() as $field) {
         if ($field->getTooltip()) {
             $tooltipsExist = true;
             $html .= sprintf('<div id="row_%s_comment" class="system-tooltip-box" style="display:none;">%s</div>', $field->getId(), $field->getTooltip());
         }
     }
     $html .= '</fieldset>' . $this->_getExtraJs($element, $tooltipsExist);
     return $html;
 }
Example #5
0
 /**
  * @param Varien_Data_Form_Element_Abstract $fieldset
  *
  * @return array
  */
 protected function _getUsedAttributeCodes(Varien_Data_Form_Element_Abstract $fieldset)
 {
     $usedAttributeCodes = array();
     foreach ($fieldset->getSortedElements() as $_element) {
         // Determine the *actual* name for this select box
         preg_match('/\\[(\\w+)\\]\\[value\\]/', $_element->getName(), $matches);
         if (isset($matches[1])) {
             // Add to list
             $usedAttributeCodes[] = $matches[1];
         }
     }
     // Merge in ignored attribute codes
     $usedAttributeCodes = array_merge($usedAttributeCodes, $this->_ignoreAttributes);
     return $usedAttributeCodes;
 }