Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_Rule_Block_Actions
  • Mage_Rule_Block_Conditions
  • Mage_Rule_Block_Editable
  • Mage_Rule_Block_Newchild
  • Mage_Rule_Block_Rule
  • Mage_Rule_Helper_Data
  • Mage_Rule_Model_Abstract
  • Mage_Rule_Model_Action_Abstract
  • Mage_Rule_Model_Action_Collection
  • Mage_Rule_Model_Condition_Abstract
  • Mage_Rule_Model_Condition_Combine
  • Mage_Rule_Model_Condition_Product_Abstract
  • Mage_Rule_Model_Environment
  • Mage_Rule_Model_Mysql4_Rule
  • Mage_Rule_Model_Mysql4_Rule_Collection
  • Mage_Rule_Model_Renderer_Actions
  • Mage_Rule_Model_Renderer_Conditions
  • Mage_Rule_Model_Resource_Abstract
  • Mage_Rule_Model_Resource_Rule_Collection_Abstract

Interfaces

  • Mage_Rule_Model_Action_Interface
  • Mage_Rule_Model_Condition_Interface
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Magento
 4:  *
 5:  * NOTICE OF LICENSE
 6:  *
 7:  * This source file is subject to the Open Software License (OSL 3.0)
 8:  * that is bundled with this package in the file LICENSE.txt.
 9:  * It is also available through the world-wide-web at this URL:
10:  * http://opensource.org/licenses/osl-3.0.php
11:  * If you did not receive a copy of the license and are unable to
12:  * obtain it through the world-wide-web, please send an email
13:  * to license@magentocommerce.com so we can send you a copy immediately.
14:  *
15:  * DISCLAIMER
16:  *
17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
18:  * versions in the future. If you wish to customize Magento for your
19:  * needs please refer to http://www.magentocommerce.com for more information.
20:  *
21:  * @category    Mage
22:  * @package     Mage_Rule
23:  * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24:  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
25:  */
26: 
27: 
28: class Mage_Rule_Block_Editable extends Mage_Core_Block_Abstract
29:     implements Varien_Data_Form_Element_Renderer_Interface
30: {
31:     /**
32:      * Render element
33:      *
34:      * @param Varien_Data_Form_Element_Abstract $element
35:      * @see Varien_Data_Form_Element_Renderer_Interface::render()
36:      * @return string
37:      */
38:     public function render(Varien_Data_Form_Element_Abstract $element)
39:     {
40:         $element->addClass('element-value-changer');
41:         $valueName = $element->getValueName();
42: 
43:         if ($valueName === '') {
44:             $valueName = '...';
45:         }
46: 
47:         if ($element->getShowAsText()) {
48:             $html = ' <input type="hidden" class="hidden" id="' . $element->getHtmlId()
49:                 . '" name="' . $element->getName() . '" value="' . $element->getValue() . '"/> '
50:                 . htmlspecialchars($valueName) . '&nbsp;';
51:         } else {
52:             $html = ' <span class="rule-param"'
53:                 . ($element->getParamId() ? ' id="' . $element->getParamId() . '"' : '') . '>'
54:                 . '<a href="javascript:void(0)" class="label">';
55: 
56:             $translate = Mage::getSingleton('core/translate_inline');
57: 
58:             $html .= $translate->isAllowed() ? Mage::helper('core')->escapeHtml($valueName) :
59:                 Mage::helper('core')->escapeHtml(Mage::helper('core/string')->truncate($valueName, 33, '...'));
60: 
61:             $html .= '</a><span class="element"> ' . $element->getElementHtml();
62: 
63:             if ($element->getExplicitApply()) {
64:                 $html .= ' <a href="javascript:void(0)" class="rule-param-apply"><img src="'
65:                     . $this->getSkinUrl('images/rule_component_apply.gif') . '" class="v-middle" alt="'
66:                     . $this->__('Apply') . '" title="' . $this->__('Apply') . '" /></a> ';
67:             }
68: 
69:             $html .= '</span></span>&nbsp;';
70:         }
71: 
72:         return $html;
73:     }
74: }
75: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0