当前位置: 首页>>代码示例>>PHP>>正文


PHP ZurmoHtml::activeTextField方法代码示例

本文整理汇总了PHP中ZurmoHtml::activeTextField方法的典型用法代码示例。如果您正苦于以下问题:PHP ZurmoHtml::activeTextField方法的具体用法?PHP ZurmoHtml::activeTextField怎么用?PHP ZurmoHtml::activeTextField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ZurmoHtml的用法示例。


在下文中一共展示了ZurmoHtml::activeTextField方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 /**
  * This function overrides the run method from CJuiDatePicker and fixes the jQuery issue for the Datepicker showing
  * wrong language in the portlet views popup.
  */
 public function run()
 {
     list($name, $id) = $this->resolveNameID();
     if (isset($this->htmlOptions['id'])) {
         $id = $this->htmlOptions['id'];
     } else {
         $this->htmlOptions['id'] = $id;
     }
     if (isset($this->htmlOptions['name'])) {
         $name = $this->htmlOptions['name'];
     } else {
         $this->htmlOptions['name'] = $name;
     }
     if (!isset($this->options['currentText'])) {
         $this->options['currentText'] = ZurmoHtml::wrapLabel(Zurmo::t('Core', 'Now'));
     }
     if (!isset($this->options['closeText'])) {
         $this->options['closeText'] = ZurmoHtml::wrapLabel(Zurmo::t('Core', 'Done'));
     }
     if ($this->flat === false) {
         if ($this->hasModel()) {
             echo ZurmoHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions);
         } else {
             echo ZurmoHtml::textField($name, $this->value, $this->htmlOptions);
         }
     } else {
         if ($this->hasModel()) {
             echo ZurmoHtml::activeHiddenField($this->model, $this->attribute, $this->htmlOptions);
             $attribute = $this->attribute;
             $this->options['defaultDate'] = $this->model->{$attribute};
         } else {
             echo ZurmoHtml::hiddenField($name, $this->value, $this->htmlOptions);
             $this->options['defaultDate'] = $this->value;
         }
         if (!isset($this->options['onSelect'])) {
             $this->options['onSelect'] = "js:function( selectedDate ) { jQuery('#{$id}').val(selectedDate);}";
             // Not Coding Standard
         }
         $id = $this->htmlOptions['id'] = $this->htmlOptions['id'] . '_container';
         $this->htmlOptions['name'] = $this->htmlOptions['name'] . '_container';
         echo ZurmoHtml::tag('div', $this->htmlOptions, '');
     }
     $options = CJavaScript::encode($this->options);
     $js = "jQuery('#{$id}').datepicker({$options});";
     if ($this->language != '' && $this->language != 'en') {
         $this->registerScriptFile($this->i18nScriptFile);
         $js = "jQuery(function(){jQuery('#{$id}').datepicker(jQuery.extend({showMonthAfterYear:false}, jQuery.datepicker.regional['{$this->language}'], {$options}));})";
     }
     $cs = Yii::app()->getClientScript();
     if (isset($this->defaultOptions)) {
         $this->registerScriptFile($this->i18nScriptFile);
         $cs->registerScript(__CLASS__, $this->defaultOptions !== null ? 'jQuery.datepicker.setDefaults(' . CJavaScript::encode($this->defaultOptions) . ');' : '');
     }
     $cs->registerScript(__CLASS__ . '#' . $id, $js);
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:59,代码来源:JuiDatePicker.php

示例2: run

 /**
  * Run this widget.
  * This method registers necessary javascript and renders the needed HTML code.
  */
 public function run()
 {
     list($name, $id) = $this->resolveNameID();
     if (isset($this->htmlOptions['id'])) {
         $id = $this->htmlOptions['id'];
     } else {
         $this->htmlOptions['id'] = $id;
     }
     if (isset($this->htmlOptions['name'])) {
         $name = $this->htmlOptions['name'];
     } else {
         $this->htmlOptions['name'] = $name;
     }
     if ($this->hasModel()) {
         echo ZurmoHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions);
     } else {
         echo ZurmoHtml::textField($name, $this->value, $this->htmlOptions);
     }
     $this->registerScriptForNowButton();
     if (!isset($this->options['currentText'])) {
         $this->options['currentText'] = ZurmoHtml::wrapLabel(Zurmo::t('TimepickerExtension', 'Now'));
     }
     if (!isset($this->options['closeText'])) {
         $this->options['closeText'] = ZurmoHtml::wrapLabel(Zurmo::t('TimepickerExtension', 'Done'));
     }
     $options = CJavaScript::encode($this->options);
     if ($this->timePickerOnly) {
         $js = "jQuery('#{$id}').timepicker({$options});";
     } else {
         $js = "jQuery('#{$id}').datetimepicker({$options});";
     }
     if (isset($this->language)) {
         $this->registerScriptFile($this->i18nScriptFile);
         if ($this->timePickerOnly) {
             $js = "jQuery('#{$id}').timepicker(jQuery.extend({showMonthAfterYear:false}, jQuery.datepicker.regional['{$this->language}'], {$options}));";
         } else {
             $js = "jQuery('#{$id}').datetimepicker(jQuery.extend({showMonthAfterYear:false}, jQuery.datepicker.regional['{$this->language}'], {$options}));";
         }
     }
     Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $id, $js);
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:45,代码来源:EJuiDateTimePicker.php


注:本文中的ZurmoHtml::activeTextField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。