PHP Varien_Data_Form_Element_Abstract Code Examples

This page contains top rated real world PHP examples of Varien_Data_Form_Element_Abstract extracted from open source projects. You can rate examples to help us improve the quality of examples
Example #1
Show file File: Button.php Project: shebin512/Magento_Zoff
0
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $url_params = $this->getStoreId() ? array("store" => $this->getStoreId()) : array();
     $label_suffix = $this->getStoreId() ? " for This Store" : "";
     $this->addData(array("html_id" => $element->getHtmlId(), "button_label" => sprintf("Sync All Products%s", $label_suffix), "destination_url" => $this->getUrl("adminhtml/klevu_search/sync_all", $url_params)));
     return $this->_toHtml();
 }
Example #2
Show file File: Flatcatalog.php Project: SalesOneGit/s1_magento
0
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     if (!Mage::helper('catalog/category_flat')->isBuilt()) {
         $element->setDisabled(true)->setValue(0);
     }
     return parent::_getElementHtml($element);
 }
Example #3
Show file File: Addressbook.php Project: dotmailer/dotmailer-magento-extension
0
 /**
  * Ajax Create the addressbooks.
  *
  * @param Varien_Data_Form_Element_Abstract $element
  *
  * @return string
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $url = Mage::helper('adminhtml')->getUrl('*/connector/createnewaddressbook');
     $website = Mage::app()->getRequest()->getParam('website', 0);
     $element->setData('after_element_html', "<script>\n                function createAddressbook(form, element) {\n                    var name       = \$('connector_sync_settings_dynamic_addressbook_addressbook_name').value;\n                    var visibility = \$('connector_sync_settings_dynamic_addressbook_visibility').value;\n                    var reloadurl  = '{$url}';\n                    if(name && visibility){\n                        new Ajax.Request(reloadurl, {\n                            method: 'post',\n                            parameters: {'name' : name, 'visibility' : visibility, 'website': '{$website}'},\n                            onComplete: function(transport) {\n                                window.location.reload();\n                            }\n                        });\n                    }\n                    return false;\n                }\n            </script>");
     return parent::_getElementHtml($element);
 }
Example #4
Show file File: Demo.php Project: ausger/myporto
0
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $el)
 {
     $data = $el->getOriginalData();
     if (isset($data['process'])) {
         $process = $data['process'];
     } else {
         return '<div>Action was not specified</div>';
     }
     if (isset($data['demo'])) {
         $demo = $data['demo'];
     } else {
         return '<div>Demo param was not specified</div>';
     }
     $buttonSuffix = '';
     if (isset($data['label'])) {
         $buttonSuffix = ' ' . $data['label'];
     }
     $url = $this->getUrl('adminhtml/porto_demo/' . $process) . 'demoversion/' . $demo;
     if (strlen($code = Mage::getSingleton('adminhtml/config_data')->getWebsite())) {
         $url .= "/website/" . $code;
     }
     if (strlen($code = Mage::getSingleton('adminhtml/config_data')->getStore())) {
         $url .= "/store/" . $code;
     }
     $html = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button')->setClass('import-cms')->setLabel('Import' . $buttonSuffix)->setOnClick("setLocation('{$url}')")->toHtml();
     return $html;
 }
Example #5
Show file File: Default.php Project: QiuLihua83/magento-enterprise-1.13.1.0
0
 /**
  * Render Default Product Price field as disabled if user does not have enough permissions
  *
  * @param Varien_Data_Form_Element_Abstract $element
  * @return string
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     if (!Mage::helper('enterprise_pricepermissions')->getCanAdminEditProductPrice()) {
         $element->setReadonly(true, true);
     }
     return parent::_getElementHtml($element);
 }
Example #6
Show file File: Information.php Project: quanghuynt93/VesSmartshop
0
    public function render(Varien_Data_Form_Element_Abstract $element)
    {
        $useContainerId = $element->getData('use_container_id');
        return sprintf('<tr class="system-fieldset-sub-head" id="row_%s"><td colspan="5" class="ves-description">
					   <h3>	<a href="http://www.venustheme.com"><b>Magento - Venus Product Categories Block</b></a>  </h3>
								Show List Categories.<br>
							<br>
							
							<h4><b>Guide</b></h4>
							<ul>
								<li><a href="http://www.venustheme.com"> 1) Forum Support</a></li>
								<li><a href="http://www.venustheme.com"> 2) Submit A Request</a></li>
								<li><a href="http://www.venustheme.com"> 3) Submit A Ticket</a></li>
							</ul>
							<div>
								<h4>How to implement</h4>
								<ul>
									<li>&ltblock type="ves_productcategories/list" name="ves.list" /&gt</li>
									<li>{{block type="ves_productcategories/list" name="ves.list"}}</li>
								</ul>
								
							</div>
							<br>
							<div style="font-size:11px">@Copyright: <i><a href="http://www.venustheme.com" target="_blank">VenusTheme.Com</a></i></div>
					   </td></tr>', $element->getHtmlId(), $element->getHtmlId(), $element->getLabel());
    }
Example #7
Show file File: Allowsplitpayment.php Project: hipay/hipay-fullservice-sdk-magento1
0
 /**
  *
  * @param Varien_Data_Form_Element_Abstract $element
  * @return string
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $javaScript = "\n            <script type=\"text/javascript\">\n                Event.observe('{$element->getId()}', 'change', function(){\n                    split_payment=\$('{$element->getId()}').value;\n                    \$('{$this->_getSplitPaymentElementId($element)}').disabled = (!split_payment || split_payment!=1);\n                });\n            </script>";
     $element->setData('after_element_html', $javaScript . $element->getAfterElementHtml());
     $this->toggleDisabled($element);
     return parent::_getElementHtml($element);
 }
Example #8
Show file File: Wysiwyg.php Project: santhosh400/ecart
0
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $editor = new TM_Core_Block_Adminhtml_Widget_Form_Element_Wysiwyg($element->getData());
     $editor->setId($element->getId());
     $editor->setForm($element->getForm());
     return parent::render($editor);
 }
Example #9
Show file
0
 /**
  * Retrieve Element HTML
  *
  * @param Varien_Data_Form_Element_Abstract $element
  * @return string
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     if (!$this->helper('Mage_Catalog_Helper_Product_Flat')->isBuilt()) {
         $element->setDisabled(true)->setValue(0);
     }
     return parent::_getElementHtml($element);
 }
Example #10
Show file File: Option.php Project: igorvasiliev4/magento_code
0
 public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $targetId = $this->getFieldsetId() . '_' . $this->getConfig('target');
     $block = $this->getLayout()->createBlock('mtwidget/adminhtml_widget_renderer_depend', '', array('target' => $targetId, 'url' => $this->getUrl('mtwidget/adminhtml_widget_attribute/option'), 'me' => $element->getHtmlId(), 'value' => implode(',', (array) $element->getValue())));
     $element->setData('after_element_html', $block->toHtml());
     return $element;
 }
Example #11
Show file File: Customer_Edit_Renderer_Region.php Project: ronseigel/agent-ohm
0
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     if ($country = $element->getForm()->getElement('country_id')) {
         $countryId = $country->getValue();
     } else {
         return $element->getDefaultHtml();
     }
     $regionId = $element->getForm()->getElement('region_id')->getValue();
     $html = '<tr>';
     $element->setClass('input-text');
     $html .= '<td class="label">' . $element->getLabelHtml() . '</td><td class="value">';
     $html .= $element->getElementHtml();
     $selectName = str_replace('region', 'region_id', $element->getName());
     $selectId = $element->getHtmlId() . '_id';
     $html .= '<select id="' . $selectId . '" name="' . $selectName . '" class="select required-entry" style="display:none">';
     $html .= '<option value="">' . AO::helper('customer')->__('Please select') . '</option>';
     $html .= '</select>';
     $html .= '<script type="text/javascript">
     if ($("' . $country->getHtmlId() . '") != undefined) {
         new regionUpdater("' . $country->getHtmlId() . '", "' . $element->getHtmlId() . '", "' . $selectId . '", ' . $this->helper('directory')->getRegionJson() . ');
     }
     </script>';
     $html .= '</td></tr>' . "\n";
     return $html;
 }
Example #12
Show file File: Flatcatalog.php Project: natxetee/magento2
0
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     if (!Mage::helper('Mage_Catalog_Helper_Category_Flat')->isRebuilt()) {
         $element->setDisabled('disabled')->setValue(0);
     }
     return parent::_getElementHtml($element);
 }
Example #13
Show file File: Column.php Project: igorvasiliev4/magento_code
0
 public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $html = '<script type="text/javascript">' . 'function showHideColumn(){ if(jQuery("select[name=\'parameters[widget_type]\']").val() == \'block\' && jQuery("select[name=\'parameters[scroll]\']").val() == 0) jQuery("input[name=\'parameters[column]\']").closest( "tr").hide(); else jQuery("input[name=\'parameters[column]\']").closest( "tr").show();}</script>';
     $element->setOnchange('showHideColumn();');
     $element->setData('after_element_html', $html);
     return $element;
 }
Example #14
Show file File: Enabledisable.php Project: bogdy2p/apstufgnto
0
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $websites = Mage::helper('auspost')->getAllWebsites();
     if (!empty($websites)) {
         $website_id = $this->getRequest()->getParam('website');
         $website = Mage::getModel('core/website')->load($website_id, 'code');
         if ($website && in_array($website->getWebsiteId(), $websites)) {
             $html = $element->getElementHtml();
         } elseif (!$website_id) {
             $html = $element->getElementHtml();
         } else {
             $html = '<strong class="required">' . $this->__('Please buy additional domains') . '</strong>';
         }
     } else {
         $websitecode = Mage::app()->getRequest()->getParam('website');
         $websiteId = Mage::getModel('core/store')->load($websitecode)->getWebsiteId;
         $isenabled = Mage::app()->getWebsite($websiteId)->getConfig('auspost/activation/key');
         if ($isenabled != null || $isenabled != '') {
             $html = '<strong class="required">' . $this->__(' Please select a website') . '</strong>';
             $modulestatus = new Mage_Core_Model_Config();
             $modulestatus->saveConfig('carriers/auspost/active', 0);
         } else {
             $html = '<strong class="required">' . $this->__('Please enter a valid key') . '</strong>';
         }
     }
     return $html;
 }
Example #15
Show file File: Clone.php Project: billadams/forever-frame
0
 /**
  * Enter description here...
  *
  * @param Varien_Data_Form_Element_Abstract $element
  * @return string
  */
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $fieldConfig = $element->getFieldConfig();
     $clonePath = (string) $fieldConfig->clone_path;
     $clonePaths = explode('/', $clonePath);
     // Prepare value for cloned element
     $name = 'groups[' . $clonePaths[1] . '][fields][' . $clonePaths[2] . '][value]';
     if (isset($this->_affiliateConfigData[$clonePath])) {
         $data = $this->_affiliateConfigData[$clonePath];
         $inherit = false;
     } else {
         $data = $this->_affiliateConfigRoot->descend($clonePath);
         $inherit = true;
     }
     if ($fieldConfig->backend_model) {
         $model = Mage::getModel((string) $fieldConfig->backend_model);
         if (!$model instanceof Mage_Core_Model_Config_Data) {
             Mage::throwException('Invalid config field backend model: ' . (string) $fieldConfig->backend_model);
         }
         $model->setPath($clonePath)->setValue($data)->afterLoad();
         $data = $model->getValue();
     }
     $element->setName($name)->setValue($data)->setInherit($inherit);
     // Render Element to HTML
     $html = parent::render($element);
     // Prepare Javascript for cloned element
     $cloneId = $element->getHtmlId();
     $origId = implode('_', $clonePaths);
     $html .= "<script type='text/javascript'>\r\nEvent.observe(window, 'load', function() {\r\n    \$('{$cloneId}').observe('change', function(){\r\n        Form.Element.setValue(\$('{$origId}'), Form.Element.getValue(\$('{$cloneId}')));\r\n    });\r\n    \$('{$origId}').observe('change', function(){\r\n        Form.Element.setValue(\$('{$cloneId}'), Form.Element.getValue(\$('{$origId}')));\r\n    });";
     if ($element->getCanUseWebsiteValue() || $element->getCanUseDefaultValue()) {
         $html .= "\r\n    \$('{$cloneId}_inherit').observe('click', function(){\r\n        var el = \$('{$origId}_inherit');\r\n        el.checked = \$('{$cloneId}_inherit').checked;\r\n        toggleValueElements(el, Element.previous(el.parentNode));\r\n    });\r\n    \$('{$origId}_inherit').observe('click', function(){\r\n        var el = \$('{$cloneId}_inherit');\r\n        el.checked = \$('{$origId}_inherit').checked;\r\n        toggleValueElements(el, Element.previous(el.parentNode));\r\n    });";
     }
     $html .= "\r\n});\r\n</script>";
     return $html;
 }
Example #16
Show file File: Method.php Project: nosto/nosto-magento-extension
0
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $store = null;
     $disabled = false;
     if ($code = $this->getRequest()->getParam('store')) {
         $store = Mage::getModel('core/store')->load($code);
     }
     if ($store instanceof Mage_Core_Model_Store) {
         /* @var Nosto_Tagging_Helper_Account $accountHelper */
         $accountHelper = Mage::helper('nosto_tagging/account');
         /* @var NostoAccount $nostoAccount */
         $nostoAccount = $accountHelper->find($store);
         if ($nostoAccount instanceof NostoAccountInterface) {
             foreach (NostoApiToken::getApiTokenNames() as $token) {
                 if (!$nostoAccount->getApiToken($token)) {
                     $disabled = true;
                     break;
                 }
             }
         }
     }
     if ($disabled === true) {
         /** @noinspection PhpUndefinedMethodInspection */
         $element->setDisabled('disabled');
         $metaOauth = new Nosto_Tagging_Model_Meta_Oauth();
         /** @noinspection PhpUndefinedVariableInspection */
         $metaOauth->loadData($store, $nostoAccount);
         $client = new NostoOAuthClient($metaOauth);
         $comment = sprintf('Your Nosto account is missing required tokens' . ' for updating settings to Nosto. Please click <a href="%s">' . ' here to re-connect</a> your account.', $client->getAuthorizationUrl());
         $element->setData('comment', $comment);
     }
     return parent::_getElementHtml($element);
 }
Example #17
Show file File: Date.php Project: rcclaudrey/dev
0
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $element->setFormat(Varien_Date::DATE_INTERNAL_FORMAT);
     //or other format
     $element->setImage($this->getSkinUrl('images/grid-cal.gif'));
     return parent::render($element);
 }
Example #18
Show file File: Toggle.php Project: uibar/peggysgift
0
 /**
  * Render element html
  *
  * @param Varien_Data_Form_Element_Abstract $element
  * @return string
  */
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $script = '$("row_payment_paymentnetwork_pnsofortueberweisung_display_settings_heading").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_checkout_presentation").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_customer_protection").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_allowspecific").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_specificcountry").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_sort_order").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_usage_settings_heading").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_usage_text_one").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_usage_text_two").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_status_settings_heading").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_order_status").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_order_status_pending_not_credited_yet").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_order_status_loss_not_credited").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_order_status_received_credited").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_create_invoice").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_status_config_text_one").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_status_config_text_two").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_create_creditmemo").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_send_order_confirmation").toggle();
                $("row_payment_paymentnetwork_pnsofortueberweisung_send_mail").toggle();';
     $labelText = Mage::helper('sofort')->__("Adjust the SOFORT Banking module properties here. <a onclick='%s'>(Click to open)</a>");
     $label = sprintf($labelText, $script);
     return sprintf('<tr class="system-fieldset-sub-head" id="row_%s"><td colspan="5"><div id="%s">%s</div></td></tr>', $element->getHtmlId(), $element->getHtmlId(), $label . $element->getLabel());
 }
Example #19
Show file File: ApiWizard.php Project: SalesOneGit/s1_magento
0
 /**
  * Get the button and scripts contents
  *
  * @param Varien_Data_Form_Element_Abstract $element
  * @return string
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $originalData = $element->getOriginalData();
     $elementHtmlId = $element->getHtmlId();
     $this->addData(array_merge($this->_getButtonData($elementHtmlId, $originalData), $this->_getSandboxButtonData($elementHtmlId, $originalData)));
     return $this->_toHtml();
 }
Example #20
Show file File: Checkall.php Project: chigusa/ChigusaVerticalMenu
0
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $element->setOnclick('launchExample();');
     $html = $element->getElementHtml();
     $html .= '<script type="text/javascript">function launchExample(){ alert("This is an example"); }</script>';
     return $html;
 }
Example #21
Show file File: Date.php Project: aniljaiswal/order-confirmation
0
    protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
    {
        $res = '';
        $divId = $element->getId();
        $res .= <<<EOD
\t\t<input name="{$element->getName()}" id="{$divId}_date" value="{$element->getValue()}" type="text" style="width:130px !important;" /> <img src="{$this->getSkinUrl('images/grid-cal.gif')}" alt="" id="{$divId}_date_trig" title="{$this->__('Select Date')}" style="" />
\t\t<script type="text/javascript">
\t\t//<![CDATA[
\t\t\t//this example uses dd.MM.yyyy hh:mm format.
\t\t\tCalendar.setup({
\t\t\t\tinputField: "{$divId}_date",
\t\t\t\tifFormat: "%Y-%m-%d %H:%M:%S",
\t\t\t\tshowsTime: true,
\t\t\t\tfirstDay: 1,
\t\t\t\ttimeFormat: "24",
\t\t\t\tbutton: "{$divId}_date_trig",
\t\t\t\talign: "Bl",
\t\t\t\tsingleClick : true
\t\t\t});
\t\t\t
\t\t//]]>
\t\t</script>
EOD;
        return $res;
    }
Example #22
Show file File: Chooser.php Project: RapidCampaign/rapid-magento-extension
0
 /**
  * Prepare chooser element HTML
  *
  * @param Varien_Data_Form_Element_Abstract $element Form Element
  * @return Varien_Data_Form_Element_Abstract
  */
 public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $uniqId = Mage::helper('core')->uniqHash($element->getId());
     $sourceUrl = $this->getUrl('adminhtml/rapidcampaign_chooser/chooser', array('uniq_id' => $uniqId));
     $chooser = $this->getLayout()->createBlock('widget/adminhtml_widget_chooser')->setElement($element)->setTranslationHelper($this->getTranslationHelper())->setConfig($this->getConfig())->setFieldsetId($this->getFieldsetId())->setSourceUrl($sourceUrl)->setUniqId($uniqId);
     $errorMessage = '';
     /** @var RapidCampaign_Promotions_Model_Storage $promotionsStorage */
     $promotionsStorage = Mage::getModel('rapidcampaign_promotions/storage');
     try {
         $promotionModel = $promotionsStorage->getPromotionsModel();
     } catch (Exception $e) {
         $errorMessage = $this->__($e->getMessage());
         $promotionModel = $promotionsStorage->getCachedPromotionsModel();
     }
     if ($element->getValue()) {
         $promotion = $promotionModel->load($element->getValue());
         if ($promotion->getId()) {
             $chooser->setLabel($promotion->getName());
         }
     }
     $chooserHtml = $chooser->toHtml();
     if ($errorMessage) {
         // Wrap error message
         $chooserHtml .= '<div class="validation-advice">' . $errorMessage . '</div>';
     }
     $element->setData('after_element_html', $chooserHtml);
     return $element;
 }
Example #23
Show file File: Version.php Project: QiuLihua83/Magento_China_Integration
0
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $_htmlId = $element->getHtmlId();
     // Get the default HTML for this option
     //$html = parent::_getElementHtml($element);
     $html = "";
     $modules = Mage::getConfig()->getNode()->modules;
     $cosmomodules = array();
     foreach ($modules[0] as $module) {
         if (strpos($module->getName(), 'CosmoCommerce') !== FALSE) {
             $cosmomodules[] = $module;
         }
     }
     foreach ($cosmomodules as $cosmomodule) {
         $html .= $cosmomodule->getName() . "  <b>" . $cosmomodule->version . "</b><br />";
     }
     //print_r($activityPath);
     return $html;
     /*
     $html.="<br />";
     chdir(Mage::getBaseDir('base'));
     $last_line = exec('/var/www/bin/modman status', $output,$retval);
     $html.=implode("<br />",$output);
     */
 }
Example #24
Show file File: Information.php Project: quanghuynt93/VesSmartshop
0
    public function render(Varien_Data_Form_Element_Abstract $element)
    {
        $useContainerId = $element->getData('use_container_id');
        return sprintf('<tr class="system-fieldset-sub-head" id="row_%s"><td colspan="5" class="ves-description">
					   <h3>	<a href="http://www.venustheme.com"><b>Magento - Venus Deals Block</b></a>  </h3>
								The most elegant way to show list products of your magento store inside the smooth ProductCarousel. 
								the module supports multiple themes for fitting your design, easy to make owner themes by yourself, 
								and many kind of selecting products sources. 
								When you used, sure you will get highest effects while introducing your customers great products, featured products .<br>
							<br>
							
							<h4><b>Guide</b></h4>
							<ul>
								<li><a href="http://www.venustheme.com"> 1) Forum Support</a></li>
								<li><a href="http://www.venustheme.com"> 2) Submit A Request</a></li>
								<li><a href="http://www.venustheme.com"> 3) Submit A Ticket</a></li>
							</ul>
							<div>
								<h4>How to implement</h4>
								<ul>
									<li>&lt block type="ves_deals/deal_productlist" name="deals.list" /&gt</li>
									<li>{{block type="ves_deals/deal_productlist" name="deals.list"}}</li>
								</ul>
								
							</div>
							<br>
							<div style="font-size:11px">@Copyright: <i><a href="http://www.venustheme.com" target="_blank">VenusTheme.Com</a></i></div>
					   </td></tr>', $element->getHtmlId(), $element->getHtmlId(), $element->getLabel());
    }
Example #25
Show file File: Color.php Project: klord9x/project-nam1
0
    /**
     * Add color picker
     *
     * @param Varien_Data_Form_Element_Abstract $element
     * @return String
     */
    protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
    {
        $html = $element->getElementHtml();
        //Default HTML
        $jsPath = $this->getJsUrl('infortis/jquery/jquery-for-admin.min.js');
        $mcPath = $this->getJsUrl('infortis/jquery/plugins/mcolorpicker/');
        if (Mage::registry('jqueryLoaded') == false) {
            $html .= '
			<script type="text/javascript" src="' . $jsPath . '"></script>
			<script type="text/javascript">jQuery.noConflict();</script>
			';
            Mage::register('jqueryLoaded', 1);
        }
        if (Mage::registry('colorPickerLoaded') == false) {
            $html .= '
			<script type="text/javascript" src="' . $mcPath . 'mcolorpicker.min.js"></script>
			<script type="text/javascript">
				jQuery.fn.mColorPicker.init.replace = false;
				jQuery.fn.mColorPicker.defaults.imageFolder = "' . $mcPath . 'images/";
				jQuery.fn.mColorPicker.init.allowTransparency = true;
				jQuery.fn.mColorPicker.init.showLogo = false;
			</script>
            ';
            Mage::register('colorPickerLoaded', 1);
        }
        $html .= '
			<script type="text/javascript">
				jQuery(function($){
					$("#' . $element->getHtmlId() . '").attr("data-hex", true).width("250px").mColorPicker();
				});
			</script>
        ';
        return $html;
    }
Example #26
Show file File: Textarea.php Project: sshegde123/wmp8
0
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $time = $element->getHtmlId();
     // Get the default HTML for this option
     $html = parent::_getElementHtml($element);
     return $html;
 }
Example #27
Show file File: Inblocktype.php Project: vstorm83/ausport
0
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $after_element_html = $element->getAfterElementHtml();
     $javaScript = "\r\n            <script type=\"text/javascript\">\r\n                Event.observe('{$element->getHtmlId()}', 'change', function(){\r\n                    var value = \$('{$element->getHtmlId()}').value;                    \r\n                    var elements = eval({$this->_getAssociatedElements()});\r\n\r\n                    if (value == " . GoMage_Navigation_Model_Adminhtml_System_Config_Source_Filter_Type_Inblock::TYPE_FIXED . "){\r\n                    \tfor (var i = 0; i < elements.length; i++) {\r\n                    \t\tvar id = '{$this->_getBasePartName($element)}' + elements[i]; \r\n                            if (\$(id)){\r\n                            \t\$(id).up('td').up('tr').show();\t\r\n    \t\t\t\t\t\t}\r\n                        }\r\n                        var id = '{$this->_getBasePartName($element)}' + 'max_inblock_height'; \r\n                        if (\$(id)){\r\n                        \t\$(id).up('td').up('tr').hide();\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar id = '{$this->_getBasePartName($element)}' + 'inblock_height';\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n                        if (\$(id) && \$('row_'+ '{$this->_getBasePartName($element)}' + 'inblock_type').visible() == true){\r\n                        \t\$(id).up('td').up('tr').show();\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\$(id).up('td').up('tr').hide();\r\n\t\t\t\t\t\t}\r\n    \t\t\t\t}else if (value == " . GoMage_Navigation_Model_Adminhtml_System_Config_Source_Filter_Type_Inblock::TYPE_AUTO . "){\r\n    \t\t\t\t\tfor (var i = 0; i < elements.length; i++) {\r\n                    \t\tvar id = '{$this->_getBasePartName($element)}' + elements[i]; \r\n                            if (\$(id)){\r\n                            \t\$(id).up('td').up('tr').hide();\t\r\n    \t\t\t\t\t\t}\r\n                        }\r\n    \t\t\t\t\tvar id = '{$this->_getBasePartName($element)}' + 'max_inblock_height';\r\n    \t\t\t\t\tvar filter_type = \$('{$this->_getBasePartName($element)}' + 'filter_type').value;\r\n                        if (\$(id) && filter_type == 9){\r\n                        \t\$(id).up('td').up('tr').show();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar id = '{$this->_getBasePartName($element)}' + 'inblock_height'; \r\n                        if (\$(id)){\r\n                        \t\$(id).up('td').up('tr').hide();\t\r\n\t\t\t\t\t\t}\r\n    \t\t\t\t}else{\r\n    \t\t\t\t\tfor (var i = 0; i < elements.length; i++) {\r\n                    \t\tvar id = '{$this->_getBasePartName($element)}' + elements[i]; \r\n                            if (\$(id)){\r\n                            \t\$(id).up('td').up('tr').hide();\t\r\n    \t\t\t\t\t\t}\r\n                        }\r\n                        var id = '{$this->_getBasePartName($element)}' + 'inblock_height'; \r\n                        if (\$(id)){\r\n                        \t\$(id).up('td').up('tr').hide();\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar id = '{$this->_getBasePartName($element)}' + 'max_inblock_height'; \r\n                        if (\$(id)){\r\n                        \t\$(id).up('td').up('tr').hide();\t\r\n\t\t\t\t\t\t}\r\n    \t\t\t\t}\r\n                });\r\n                document.observe('dom:loaded', function() {   \t\r\n                \tinit_{$element->getHtmlId()}();                \t\r\n                });\r\n                document.onreadystatechange = init_{$element->getHtmlId()};\r\n                \r\n                function init_{$element->getHtmlId()}() {\r\n                \tGomage_Navigation_fireEvent(\$('{$element->getHtmlId()}'), 'change');\r\n                }\r\n            </script>";
     $element->setData('after_element_html', $javaScript . $after_element_html);
     return $element->getElementHtml();
 }
Example #28
Show file File: Info.php Project: unifiedarts/Hackathon_MageMonitoring
0
    /**
     * Renders element
     *
     * @param  Varien_Data_Form_Element_Abstract $element Element to render
     * @return string
     */
    public function render(Varien_Data_Form_Element_Abstract $element)
    {
        $logoSrc = $this->getSkinUrl('monitoring/images/firegento.jpg');
        $html = '
<tr id="row_%s">
    <td colspan="2">
        <div class="box">
            <p>
                <a href="' . self::URL . '" target="_blank" title="' . $this->__('Go to Firegento Website') . '">
                    <img src="' . $logoSrc . '" alt="' . $this->__('Firegento') . '" />
                </a>
            </p>
            <p>%s</p>
            <ul>%s</ul>
        </div>
    </td>
</tr>
';
        $linksHtml = '';
        /** @var $links Mage_Core_Model_Config_Element */
        $links = $element->getFieldConfig()->links;
        if ($links) {
            foreach ($links->children() as $_link) {
                $_linkLabel = $this->__((string) $_link->label);
                $linksHtml .= sprintf('<li><a href="%s" target="_blank">%s</a>', $_link->url, $_linkLabel) . '</li>';
            }
        }
        return sprintf($html, $element->getHtmlId(), $element->getComment(), $linksHtml);
    }
Example #29
Show file File: Actions.php Project: codercv/urbansurprisedev
0
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     if ($element->getRule() && $element->getRule()->getActions()) {
         return $element->getRule()->getActions()->asHtmlRecursive();
     }
     return '';
 }
Example #30
Show file File: Notice.php Project: wouter90/sisowpayment
0
 /**
  * Render fieldset html
  *
  * @param Varien_Data_Form_Element_Abstract $element
  * @return string
  */
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $elementOriginalData = $element->getOriginalData();
     if (isset($elementOriginalData['help_link'])) {
         $this->setHelpLink($elementOriginalData['help_link']);
     }
     $js = '
         sisowToggleSolution = function(id, url) {
             var doScroll = false;
             Fieldset.toggleCollapse(id, url);
             if ($(this).hasClassName("open")) {
                 $$(".with-button button.button").each(function(anotherButton) {
                     if (anotherButton != this && $(anotherButton).hasClassName("open")) {
                         $(anotherButton).click();
                         doScroll = true;
                     }
                 }.bind(this));
             }
             if (doScroll) {
                 var pos = Element.cumulativeOffset($(this));
                 window.scrollTo(pos[0], pos[1] - 45);
             }
         }
     ';
     return $this->toHtml() . $this->helper('adminhtml/js')->getScript($js);
 }
Frequently Used Methods