本文整理汇总了PHP中Varien_Data_Form_Element_Text类的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form_Element_Text类的具体用法?PHP Varien_Data_Form_Element_Text怎么用?PHP Varien_Data_Form_Element_Text使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Varien_Data_Form_Element_Text类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: render
public function render(Varien_Data_Form_Element_Abstract $element)
{
$html = $this->_getHeaderHtml($element);
$renderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
$attributes = Mage::getConfig()->getNode(self::XML_PATH_IMAGE_TYPES)->asArray();
foreach ($attributes as $key => $attribute) {
/**
* Watermark size field
*/
$field = new Varien_Data_Form_Element_Text();
$field->setName("groups[watermark][fields][{$key}_size][value]")->setForm($this->getForm())->setLabel(Mage::helper('adminhtml')->__('Size for %s', $attribute['title']))->setRenderer($renderer);
$html .= $field->toHtml();
/**
* Watermark upload field
*/
$field = new Varien_Data_Form_Element_Imagefile();
$field->setName("groups[watermark][fields][{$key}_image][value]")->setForm($this->getForm())->setLabel(Mage::helper('adminhtml')->__('Watermark File for %s', $attribute['title']))->setRenderer($renderer);
$html .= $field->toHtml();
/**
* Watermark position field
*/
$field = new Varien_Data_Form_Element_Select();
$field->setName("groups[watermark][fields][{$key}_position][value]")->setForm($this->getForm())->setLabel(Mage::helper('adminhtml')->__('Position of Watermark for %s', $attribute['title']))->setRenderer($renderer)->setValues(Mage::getSingleton('adminhtml/system_config_source_catalog_product_watermark_position')->toOptionArray());
$html .= $field->toHtml();
}
$html .= $this->_getFooterHtml($element);
return $html;
}
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:28,代码来源:Watermark.php
示例2: testRender
public function testRender()
{
$element = new Varien_Data_Form_Element_Text();
$element->setLegend('I am legend');
$block = new Netresearch_OPS_Block_System_Config_Kwixoconfiguration();
$block->render($element);
$this->assertEquals('I am legend', $block->getData('fieldset_label'));
}
开发者ID:roshu1980,项目名称:add-computers,代码行数:8,代码来源:KwixoconfigurationTest.php
示例3: getAttributeMappingsHtml
protected function getAttributeMappingsHtml()
{
$element = new Varien_Data_Form_Element_Text(array("name" => "attributes", "label" => $this->__("Additional Attributes"), "comment" => $this->__('Here you can set optional product attributes sent to Klevu by mapping them to your Magento attributes. If you specify multiple mappings for the same Klevu attribute, only the first mapping found on the product sent will be used, except for the "Other" attribute where all existing mappings are used.'), "tooltip" => "", "hint" => "", "value" => Mage::helper("klevu_search/config")->getAdditionalAttributesMap($this->getStore()), "inherit" => false, "class" => "", "can_use_default_value" => false, "can_use_website_value" => false));
$element->setForm(new Varien_Data_Form());
/** @var Klevu_Search_Block_Adminhtml_Form_Field_Attribute_Mappings $renderer */
$renderer = Mage::getBlockSingleton("klevu_search/adminhtml_form_field_attribute_mappings");
$renderer->setTemplate("klevu/search/wizard/form/field/array.phtml");
return $renderer->render($element);
}
开发者ID:mSupply,项目名称:runnable_test_repo,代码行数:9,代码来源:Attributes.php
示例4: getCmsMappingsHtml
/**
* Return the list of stores that can be selected to be configured (i.e. haven't
* been configured already), organised by website name and group name.
*
* @return array
*/
protected function getCmsMappingsHtml()
{
$element = new Varien_Data_Form_Element_Text(array("name" => "excludedpages", "label" => $this->__("Exclude CMS pages from search"), "tooltip" => "", "hint" => "", "value" => Mage::helper("content")->getCmsPageMap($this->getStore()), "inherit" => false, "class" => "", "can_use_default_value" => false, "can_use_website_value" => false));
$element->setForm(new Varien_Data_Form());
/** @var Klevu_Search_Block_Adminhtml_Form_Field_Attribute_Mappings $renderer */
$renderer = Mage::getBlockSingleton("content/adminhtml_form_cmspages");
$renderer->setTemplate("klevu/search/wizard/form/field/array.phtml");
return $renderer->render($element);
}
开发者ID:klevu,项目名称:klevu-smart-search-M1,代码行数:15,代码来源:Store.php
示例5: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$html = '<script type="text/javascript" src="' . Mage::getBaseUrl('js') . 'chartmap/systemcolorpicker/procolor-1.0/procolor.compressed.js' . '"></script>';
$input = new Varien_Data_Form_Element_Text();
$input->setForm($element->getForm())->setElement($element)->setValue($element->getValue())->setHtmlId($element->getHtmlId())->setName($element->getName())->setStyle('width: 100px')->addClass('validate-hex');
$html .= $input->getHtml();
$html .= $this->_getProcolorJs($element->getHtmlId());
$html .= $this->_addHexValidator();
return $html;
}
开发者ID:vijays91,项目名称:Magento-Chart-Map,代码行数:10,代码来源:Colorpicker.php
示例6: renderWithoutFormElement
/**
* Render Media Chooser HTML without form element as parameter
* Can be useful for dynamic fields integration like it is done in Mage_Poll module for example
*
* @param $id
* @param null $value
*
* @return string
*/
public function renderWithoutFormElement($id, $value = null)
{
$dummyForm = new Varien_Data_Form();
$dummyElement = new Varien_Data_Form_Element_Text();
$dummyElement->setHtmlId($id);
$dummyElement->setValue($value);
$dummyElement->setForm($dummyForm);
$html = $this->render($dummyElement);
return $html->getAfterElementHtml();
}
开发者ID:christinecardoso,项目名称:AntoineK_MediaChooserField,代码行数:19,代码来源:Data.php
示例7: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$helper = Mage::helper('netzarbeiter_groupscatalog2');
if ($helper->getConfig('show_multiselect_field')) {
$html = parent::_getElementHtml($element);
} else {
$label = new Varien_Data_Form_Element_Text();
$label->setData($element->getData())->setType('text')->setExtType('textfield')->addClass('input-text')->setReadOnly(true)->setForm($element->getForm())->setId($element->getId());
$value = explode(',', (string) $label->getValue());
$groups = $helper->getGroupNamesAsString($value);
$label->setValue($groups);
$html = $label->getElementHtml();
}
return $html;
}
开发者ID:gewaechshaus,项目名称:groupscatalog2,代码行数:15,代码来源:Customergroup.php
示例8: prepareElementHtml
public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$config = $this->getConfig();
$chooseButton = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button')->setClass('scalable btn-chooser')->setLabel($config['button']['open'])->setOnclick('MediabrowserUtility.openDialog(\'' . $this->getUrl('*/cms_wysiwyg_images/index', array('target_element_id' => $element->getName())) . '\')')->setDisabled($element->getReadonly());
$text = new Varien_Data_Form_Element_Text();
$text->setForm($element->getForm())->setId($element->getName())->setName($element->getName())->setClass('widget-option input-text');
if ($element->getRequired()) {
$text->addClass('required-entry');
}
if ($element->getValue()) {
$text->setValue($element->getValue());
}
$element->setData('after_element_html', $text->getElementHtml() . $chooseButton->toHtml());
return $element;
}
开发者ID:jahvi,项目名称:magento-study-group,代码行数:15,代码来源:Chooser.php
示例9: _getElementHtml
/**
* Generate HTML code for color picker
*
* @param Varien_Data_Form_Element_Abstract $element
* @return string
*/
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
// Include Procolor library JS file which is in [magento_base_dir]/js/herve/systemcolorpicker/procolor-1.0/procolor.compressed.js
$html = '<script type="text/javascript" src="' . Mage::getBaseUrl('js') . 'herve/systemcolorpicker/procolor-1.0/procolor.compressed.js' . '"></script>';
// Use Varien text element as a basis
$input = new Varien_Data_Form_Element_Text();
// Set data from config element on Varien text element
$input->setForm($element->getForm())->setElement($element)->setValue($element->getValue())->setHtmlId($element->getHtmlId())->setName($element->getName())->setStyle('width: 60px')->addClass('validate-hex');
// Add some Prototype validation to make sure color code is correct
// Inject uddated Varien text element HTML in our current HTML
$html .= $input->getHtml();
// Inject Procolor JS code to display color picker
$html .= $this->_getProcolorJs($element->getHtmlId());
// Inject Prototype validation
$html .= $this->_addHexValidator();
return $html;
}
开发者ID:simkea,项目名称:Herve_SystemColorpicker,代码行数:23,代码来源:Colorpicker.php
示例10: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
if (!class_exists('Conekta')) {
error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive [email protected]:conekta/conekta-magento.git'", 0);
throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
}
Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
Conekta::setApiVersion("1.0.0");
Conekta::setLocale(Mage::app()->getLocale()->getLocaleCode());
$url = new Varien_Data_Form_Element_Text();
$data = array('name' => $element->getName(), 'html_id' => $element->getId());
$url->setData($data);
$webhook_url = Mage::getBaseUrl() . "index.php/webhook/ajax/listener";
if (!empty($element->getValue())) {
$url_string = $element->getValue();
} else {
$url_string = $webhook_url;
}
$url->setValue($url_string);
$events = array("events" => array("charge.created", "charge.paid", "charge.under_fraud_review", "charge.fraudulent", "charge.refunded", "charge.created", "customer.created", "customer.updated", "customer.deleted", "webhook.created", "webhook.updated", "webhook.deleted", "charge.chargeback.created", "charge.chargeback.updated", "charge.chargeback.under_review", "charge.chargeback.lost", "charge.chargeback.won", "payout.created", "payout.retrying", "payout.paid_out", "payout.failed", "plan.created", "plan.updated", "plan.deleted", "subscription.created", "subscription.paused", "subscription.resumed", "subscription.canceled", "subscription.expired", "subscription.updated", "subscription.paid", "subscription.payment_failed", "payee.created", "payee.updated", "payee.deleted", "payee.payout_method.created", "payee.payout_method.updated", "payee.payout_method.deleted"));
$error = false;
$error_message = null;
try {
$different = true;
$webhooks = Conekta_Webhook::where();
foreach ($webhooks as $webhook) {
if (strpos($webhook->webhook_url, $url_string) !== false) {
$different = false;
}
}
if ($different) {
$webhook = Conekta_Webhook::create(array_merge(array("url" => $url_string), $events));
}
} catch (Exception $e) {
$error = true;
$error_message = $e->getMessage();
}
$url->setForm($element->getForm());
$html = $url->getElementHtml();
$javaScript = "\n <script type=\"text/javascript\">\n Event.observe(window, 'load', function() {\n alert('" . $error_message . "');\n });\n </script>";
if ($error) {
$html .= $javaScript;
}
return $html;
}
开发者ID:intfrr,项目名称:conekta-magento,代码行数:45,代码来源:Url.php
示例11: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$color = new Varien_Data_Form_Element_Text();
$data = array('name' => $element->getName(), 'html_id' => $element->getId());
$color->setData($data);
$color->setValue($element->getValue(), $format);
$color->setForm($element->getForm());
$color->addClass('color ' . $element->getClass());
return $color->getElementHtml();
}
开发者ID:kanotest15,项目名称:cbmagento,代码行数:10,代码来源:Jscolorblock.php
示例12: getAfterElementHtml
public function getAfterElementHtml()
{
$html = Varien_Data_Form_Element_Text::getAfterElementHtml();
$addJsObserver = false;
if ($attribute = $this->getEntityAttribute()) {
$store = $this->getStore();
$html .= '<strong>[' . (string) $store->getBaseCurrencyCode() . ']</strong>';
if (Mage::helper('tax')->priceIncludesTax($store)) {
if ($attribute->getAttributeCode() !== 'cost') {
$addJsObserver = true;
$html .= ' <strong>[' . Mage::helper('tax')->__('Inc. Tax') . '<span id="' . $this->getTaxObservingSpanId() . '"></span>]</strong>';
}
}
}
if ($addJsObserver) {
$html .= $this->_getTaxObservingCode($attribute);
}
return $html;
}
开发者ID:aram93,项目名称:mage-enhanced-admin-grids,代码行数:19,代码来源:Price.php
示例13: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$days = new Varien_Data_Form_Element_Text();
$data = array('name' => $element->getName(), 'html_id' => $element->getId());
$days->setData($data);
if (is_numeric($element->getValue())) {
$days->setValue($element->getValue());
} else {
$days->setValue(30);
}
$days->setForm($element->getForm());
$html = $days->getElementHtml();
$javaScript = "\n <script type=\"text/javascript\">\n Event.observe(window, 'load', function() {\n days=\$('{$element->getHtmlId()}').value;\n if (isNaN(days)) {\n \$('{$element->getHtmlId()}').value = '';\n }\n });\n Event.observe('{$element->getHtmlId()}', 'change', function(){\n days=\$('{$element->getHtmlId()}').value;\n if (isNaN(days)) {\n \$('{$element->getHtmlId()}').value = '';\n }\n });\n </script>";
$html .= $javaScript;
return $html;
}
开发者ID:sjonmx,项目名称:conekta-magento,代码行数:16,代码来源:Days.php
示例14: getDatabaseExists
/**
* @return bool
*/
public function getDatabaseExists()
{
if (strpos($this->_currentElement->getHtmlId(), 'dbName2') !== false) {
$value1 = Mage::registry('system_fastindexer_dbName1');
if (strtolower($this->_currentElement->getValue()) === strtolower($value1)) {
return false;
}
}
$dbName = $this->_currentElement->getData('value');
if (empty($dbName)) {
return false;
}
$result = $this->_connection->fetchOne('SELECT SCHEMA_NAME FROM `INFORMATION_SCHEMA`.`SCHEMATA` WHERE SCHEMA_NAME=:db', ['db' => $dbName]);
return $result !== false;
}
开发者ID:ThomasNegeli,项目名称:Magento-FastIndexer,代码行数:18,代码来源:Database.php
示例15: getAfterElementHtml
public function getAfterElementHtml()
{
$html = parent::getAfterElementHtml();
/**
* getEntityAttribute - use __call
*/
$addJsObserver = false;
if ($attribute = $this->getEntityAttribute()) {
if (!($storeId = $attribute->getStoreId())) {
$storeId = $this->getForm()->getDataObject()->getStoreId();
}
$store = Mage::app()->getStore($storeId);
$html .= '<strong>[' . (string) $store->getBaseCurrencyCode() . ']</strong>';
if (Mage::helper('tax')->priceIncludesTax($store)) {
if ($attribute->getAttributeCode() !== 'cost') {
$addJsObserver = true;
$html .= ' <strong>[' . Mage::helper('tax')->__('Inc. Tax') . '<span id="dynamic-tax-' . $attribute->getAttributeCode() . '"></span>]</strong>';
}
}
}
if ($addJsObserver) {
$html .= $this->_getTaxObservingCode($attribute);
}
return $html;
}
开发者ID:cnglobal-sl,项目名称:caterez,代码行数:25,代码来源:Price.php
示例16: getEscapedValue
/**
* Hide value to make sure it will not show in HTML
*
* @param string $index
* @return string
*/
public function getEscapedValue($index = null)
{
$value = parent::getEscapedValue($index);
if (!empty($value)) {
return $this->_obscuredValue;
}
return $value;
}
开发者ID:codercv,项目名称:urbansurprisedev,代码行数:14,代码来源:Obscure.php
示例17: getElementHtml
public function getElementHtml()
{
$html = '
<div class="target-control">
' . parent::getElementHtml() . '
' . $this->getOptionsHtml() . '
</div>
';
return $html;
}
开发者ID:beejhuff,项目名称:rootd-link,代码行数:10,代码来源:Targetselector.php
示例18: _disableFields
/**
* Disable fields depending on product type
*
* @return Mage_CatalogInventory_Block_Adminhtml_Form_Field_Stock
*/
protected function _disableFields()
{
if (!$this->_isProductComposite() && null === $this->_qty->getValue()) {
$this->setDisabled('disabled');
}
if ($this->_isProductComposite()) {
$this->_qty->setDisabled('disabled');
}
return $this;
}
开发者ID:nickimproove,项目名称:magento2,代码行数:15,代码来源:Stock.php
示例19: getHtml
public function getHtml()
{
$hidden = new Varien_Data_Form_Element_Hidden($this->getData());
$hidden->setData('label', null);
$hidden->setForm($this->getForm());
$this->setId($this->getId() . '_query');
$this->setName($this->getId());
$this->setValue($this->_value);
return $hidden->getHtml() . parent::getHtml() . $this->_getJs();
}
开发者ID:praxigento,项目名称:mage_app_prxgt_store,代码行数:10,代码来源:Autocompleter.php
示例20: getAfterElementHtml
public function getAfterElementHtml()
{
$html = parent::getAfterElementHtml();
$html .= '<style>
.type_link:hover {
text-decoration: underline;
cursor: pointer;
}
</style>';
$html .= '<div id="type_product" style="position: absolute; z-index: 99; background-color: #ffffff" ></div>';
return $html . " <script>\n\n var typeloader;\n \$('" . $this->getHtmlId() . "').observe('keyup', function(event){\n clearTimeout(typeloader);\n typeloader = setTimeout(function(){ respondToClick(event); }, 750);\n });\n\n function setIdValue(el) {\n\n \$('shiphawk_type_of_product').value = el.innerHTML;\n \$('shiphawk_type_of_product_value').value = el.id;\n \$('type_product').hide();\n }\n\n function respondToClick(event) {\n\n var element = event.element();\n\n var minlength = 3;\n\n var url = '" . $this->getTypeUrl() . "';\n var parameters = {\n search_tag: element.value\n };\n\n if(element.value.length >= minlength ) {\n new Ajax.Request(url, {\n method: 'post',\n parameters: parameters,\n onSuccess: function(transport) {\n \$('type_product').update(transport.responseText);\n \$('type_product').show();\n },\n onLoading:function(transport)\n {\n }\n });\n }\n }\n \t\t\t\t</script>";
}
开发者ID:Nas1k,项目名称:shiphawk-magento-plugin,代码行数:12,代码来源:Type.php
注:本文中的Varien_Data_Form_Element_Text类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论