• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP HTML_QuickForm_element类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: HTML_QuickForm_datepicker

    /**
     * Constructor
     */
    public function HTML_QuickForm_datepicker($elementName = null, $elementLabel = null, $attributes = null, $optionIncrement = null)
    {
        $js_form_name = api_get_unique_id();
        HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
        $this->_persistantFreeze = true;
        $this->_appendName = true;
        $this->_type = 'datepicker';
        $popup_link = '<a href="javascript:openCalendar(\'' . $js_form_name . '\',\'' . $elementName . '\')">
		<img src="' . api_get_path(WEB_IMG_PATH) . 'calendar_select.gif" style="vertical-align:middle;" alt="Select Date" /></a>';
        $hour_minute_devider = get_lang("HourMinuteDivider");
        $special_chars = array('D', 'l', 'd', 'M', 'F', 'm', 'y', 'H', 'a', 'A', 's', 'i', 'h', 'g', ' ');
        foreach ($special_chars as $char) {
            $popup_link = str_replace($char, "\\" . $char, $popup_link);
            $hour_minute_devider = str_replace($char, "\\" . $char, $hour_minute_devider);
        }
        $lang_code = api_get_language_isocode();
        // If translation not available in PEAR::HTML_QuickForm_date, add the Chamilo-translation
        if (!array_key_exists($lang_code, $this->_locale)) {
            $this->_locale[$lang_code]['months_long'] = api_get_months_long();
        }
        $this->_options['format'] = 'dFY ' . $popup_link . '   H ' . $hour_minute_devider . ' i';
        $this->_options['minYear'] = date('Y') - 5;
        $this->_options['maxYear'] = date('Y') + 10;
        $this->_options['language'] = $lang_code;
        if (isset($optionIncrement)) {
            $this->_options['optionIncrement']['i'] = intval($optionIncrement);
        }
    }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:datepicker_old.php


示例2: __construct

 /**
  * constructor
  *
  * @param string $elementName Element's name
  * @param mixed $elementLabel Label(s) for an element
  * @param array $options Options to control the element's display
  * @param mixed $attributes Either a typical HTML attribute string or an associative array
  */
 public function __construct($elementName = null, $elementLabel = null, $options = array(), $attributes = null)
 {
     // Get the calendar type used - see MDL-18375.
     $calendartype = \core_calendar\type_factory::get_calendar_instance();
     $this->_options = array('startyear' => $calendartype->get_min_year(), 'stopyear' => $calendartype->get_max_year(), 'defaulttime' => 0, 'timezone' => 99, 'step' => 5, 'optional' => false);
     // TODO MDL-52313 Replace with the call to parent::__construct().
     HTML_QuickForm_element::__construct($elementName, $elementLabel, $attributes);
     $this->_persistantFreeze = true;
     $this->_appendName = true;
     $this->_type = 'date_selector';
     // set the options, do not bother setting bogus ones
     if (is_array($options)) {
         foreach ($options as $name => $value) {
             if (isset($this->_options[$name])) {
                 if (is_array($value) && is_array($this->_options[$name])) {
                     $this->_options[$name] = @array_merge($this->_options[$name], $value);
                 } else {
                     $this->_options[$name] = $value;
                 }
             }
         }
     }
     // The YUI2 calendar only supports the gregorian calendar type.
     if ($calendartype->get_name() === 'gregorian') {
         form_init_date_js();
     }
 }
开发者ID:evltuma,项目名称:moodle,代码行数:35,代码来源:dateselector.php


示例3: __construct

 /**
  * Constructor
  *
  * @param string $elementname Element's name
  * @param mixed $elementlabel Label(s) for an element
  * @param array $options Options to control the element's display. Required - must contain the following options:
  *              'isupdate' - is this a new module or are we editing an existing one?
  *              'currentgrade' - the current grademax in the database for this gradeitem
  *              'hasgrades' - whether or not the grade_item has existing grade_grades
  *              'canrescale' - whether or not the activity supports rescaling grades
  * @param mixed $attributes Either a typical HTML attribute string or an associative array
  */
 public function __construct($elementname = null, $elementlabel = null, $options = array(), $attributes = null)
 {
     // TODO MDL-52313 Replace with the call to parent::__construct().
     HTML_QuickForm_element::__construct($elementname, $elementlabel, $attributes);
     $this->_persistantFreeze = true;
     $this->_appendName = true;
     $this->_type = 'modgrade';
     $this->isupdate = !empty($options['isupdate']);
     if (isset($options['currentgrade'])) {
         $this->currentgrade = $options['currentgrade'];
     }
     if (isset($options['currentgradetype'])) {
         $gradetype = $options['currentgradetype'];
         switch ($gradetype) {
             case GRADE_TYPE_NONE:
                 $this->currentgradetype = 'none';
                 break;
             case GRADE_TYPE_SCALE:
                 $this->currentgradetype = 'scale';
                 break;
             case GRADE_TYPE_VALUE:
                 $this->currentgradetype = 'point';
                 break;
         }
     }
     if (isset($options['currentscaleid'])) {
         $this->currentscaleid = $options['currentscaleid'];
     }
     $this->hasgrades = !empty($options['hasgrades']);
     $this->canrescale = !empty($options['canrescale']);
     $this->useratings = !empty($options['useratings']);
 }
开发者ID:kevin-bruton,项目名称:moodle,代码行数:44,代码来源:modgrade.php


示例4: HTML_QuickForm_datepickerdate

 /**
  * Constructor
  */
 function HTML_QuickForm_datepickerdate($elementName = null, $elementLabel = null, $attributes = null)
 {
     global $myMinYear, $myMaxYear;
     $js_form_name = $attributes['form_name'];
     unset($attributes['form_name']);
     HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
     $this->_persistantFreeze = true;
     $this->_appendName = true;
     $this->_type = 'datepicker';
     $popup_link = '<a href="javascript:openCalendar(\'' . $js_form_name . '\',\'' . $elementName . '\')"><img src="' . api_get_path(WEB_IMG_PATH) . 'calendar_select.gif" style="vertical-align:middle;" alt="Select Date" /></a>';
     $special_chars = array('D', 'l', 'd', 'M', 'F', 'm', 'y', 'H', 'a', 'A', 's', 'i', 'h', 'g', ' ');
     foreach ($special_chars as $index => $char) {
         $popup_link = str_replace($char, "\\" . $char, $popup_link);
     }
     $lang_code = api_get_language_isocode();
     // If translation not available in PEAR::HTML_QuickForm_date, add the Chamilo-translation
     if (!array_key_exists($lang_code, $this->_locale)) {
         $this->_locale[$lang_code]['months_long'] = api_get_months_long();
     }
     $this->_options['format'] = 'dFY ' . $popup_link;
     $this->_options['minYear'] = date('Y') - 5;
     $this->_options['maxYear'] = date('Y') + 10;
     $this->_options['language'] = $lang_code;
     //$this->_options['addEmptyOption'] = true;
     //$this->_options['emptyOptionValue'] = 0;
     //$this->_options['emptyOptionText'] = ' -- ';
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:30,代码来源:datepickerdate.php


示例5: MoodleQuickForm_editor

 /**
  * Constructor
  *
  * @param string $elementName (optional) name of the editor
  * @param string $elementLabel (optional) editor label
  * @param array $attributes (optional) Either a typical HTML attribute string
  *              or an associative array
  * @param array $options set of options to initalize filepicker
  */
 function MoodleQuickForm_editor($elementName = null, $elementLabel = null, $attributes = null, $options = null)
 {
     global $CFG, $PAGE;
     $options = (array) $options;
     foreach ($options as $name => $value) {
         if (array_key_exists($name, $this->_options)) {
             $this->_options[$name] = $value;
         }
     }
     if (!empty($options['maxbytes'])) {
         $this->_options['maxbytes'] = get_max_upload_file_size($CFG->maxbytes, $options['maxbytes']);
     }
     if (!$this->_options['context']) {
         // trying to set context to the current page context to make legacy files show in filepicker (e.g. forum post)
         if (!empty($PAGE->context->id)) {
             $this->_options['context'] = $PAGE->context;
         } else {
             $this->_options['context'] = context_system::instance();
         }
     }
     $this->_options['trusted'] = trusttext_trusted($this->_options['context']);
     parent::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
     // Note: for some reason the code using this setting does not like bools.
     $this->_options['subdirs'] = (int) ($this->_options['subdirs'] == 1);
     editors_head_setup();
 }
开发者ID:tyleung,项目名称:CMPUT401MoodleExams,代码行数:35,代码来源:editor.php


示例6: __construct

 /**
  * Class constructor
  *
  * @param string $elementName Select name attribute
  * @param mixed $elementLabel Label(s) for the select
  * @param mixed $attributes Either a typical HTML attribute string or an associative array
  * @param mixed $options ignored, not used.
  */
 public function __construct($elementName = null, $elementLabel = null, $attributes = null, $options = null)
 {
     // TODO MDL-52313 Replace with the call to parent::__construct().
     HTML_QuickForm_element::__construct($elementName, $elementLabel, $attributes, null);
     $this->_type = 'selectyesno';
     $this->_persistantFreeze = true;
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:15,代码来源:selectyesno.php


示例7: HTML_QuickForm_html_editor

 /**
  * Class constructor
  * @param   string  HTML editor name/id
  * @param   string  HTML editor  label
  * @param   string  Attributes for the textarea
  * @param array $editor_config	Optional configuration settings for the online editor.
  */
 function HTML_QuickForm_html_editor($elementName = null, $elementLabel = null, $attributes = null, $config = null)
 {
     // The global variable $fck_attribute has been deprecated. It stays here for supporting old external code.
     global $fck_attribute;
     HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
     $this->_persistantFreeze = true;
     $this->_type = 'html_editor';
     $this->fullPage = false;
     $name = $this->getAttribute('name');
     $this->fck_editor = new FCKeditor($name);
     $this->fck_editor->ToolbarSet = $fck_attribute['ToolbarSet'];
     $this->fck_editor->Width = !empty($fck_attribute['Width']) ? $fck_attribute['Width'] : '990';
     $this->fck_editor->Height = !empty($fck_attribute['Height']) ? $fck_attribute['Height'] : '400';
     //We get the optionnals config parameters in $fck_attribute array
     $this->fck_editor->Config = !empty($fck_attribute['Config']) ? $fck_attribute['Config'] : array();
     // This is an alternative (a better) way to pass configuration data to the editor.
     if (is_array($config)) {
         foreach ($config as $key => $value) {
             $this->fck_editor->Config[$key] = $config[$key];
         }
         if (isset($config['ToolbarSet'])) {
             $this->fck_editor->ToolbarSet = $config['ToolbarSet'];
         }
         if (isset($config['Width'])) {
             $this->fck_editor->Width = $config['Width'];
         }
         if (isset($config['Height'])) {
             $this->fck_editor->Height = $config['Height'];
         }
         if (isset($config['FullPage'])) {
             $this->fullPage = is_bool($config['FullPage']) ? $config['FullPage'] : $config['FullPage'] === 'true';
         }
     }
 }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:41,代码来源:html_editor.php


示例8: HTML_QuickForm_img

 /**
  * Class constructor
  * 
  * @param     string    $elementLabel   (optional)Img label
  * @param     string    $src            (optional)Img src
  * @param     string    $alt            (optional)Img alternative text
  * @param     mixed     $attributes     (optional)Either a typical HTML attribute string 
  *                                      or an associative array
  * @since     1.0
  * @access    public
  * @return    void
  * @throws    
  */
 function HTML_QuickForm_img($elementName = null, $elementLabel = null, $src = null, $alt = null, $attributes = null)
 {
     HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
     $this->_persistantFreeze = false;
     $this->_type = 'img';
     $this->setSrc($src);
     $this->setAlt($alt);
 }
开发者ID:BackupTheBerlios,项目名称:tip,代码行数:21,代码来源:img.php


示例9: __construct

 /**
  * Constructor
  *
  * @param string $elementname Element's name
  * @param mixed $elementlabel Label(s) for an element
  * @param array $options Options to control the element's display. Not used.
  * @param mixed $attributes Either a typical HTML attribute string or an associative array
  */
 public function __construct($elementname = null, $elementlabel = null, $options = array(), $attributes = null)
 {
     // TODO MDL-52313 Replace with the call to parent::__construct().
     HTML_QuickForm_element::__construct($elementname, $elementlabel, $attributes);
     $this->_persistantFreeze = true;
     $this->_appendName = true;
     $this->_type = 'modgrade';
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:16,代码来源:modgrade.php


示例10: HTML_QuickForm_link

 /**
  * Class constructor
  * 
  * @param     string    $elementLabel   (optional)Link label
  * @param     string    $href           (optional)Link href
  * @param     string    $text           (optional)Link display text
  * @param     mixed     $attributes     (optional)Either a typical HTML attribute string 
  *                                      or an associative array
  * @since     1.0
  * @access    public
  * @return    void
  * @throws    
  */
 function HTML_QuickForm_link($elementName = null, $elementLabel = null, $href = null, $text = null, $attributes = null)
 {
     HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
     $this->_persistantFreeze = false;
     $this->_type = 'link';
     $this->setHref($href);
     $this->_text = $text;
 }
开发者ID:laiello,项目名称:coopcrucial,代码行数:21,代码来源:link.php


示例11: __construct

 /**
  * Class constructor
  * 
  * @param     string    $elementLabel   (optional)Link label
  * @param     string    $href           (optional)Link href
  * @param     string    $text           (optional)Link display text
  * @param     mixed     $attributes     (optional)Either a typical HTML attribute string 
  *                                      or an associative array
  * @since     1.0
  * @access    public
  * @return    void
  * @throws    
  */
 public function __construct($elementName = null, $elementLabel = null, $href = null, $text = null, $attributes = null)
 {
     // TODO MDL-52313 Replace with the call to parent::__construct().
     HTML_QuickForm_element::__construct($elementName, $elementLabel, $attributes);
     $this->_persistantFreeze = false;
     $this->_type = 'link';
     $this->setHref($href);
     $this->_text = $text;
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:22,代码来源:link.php


示例12: DateTimePicker

 /**
  * Constructor
  */
 public function DateTimePicker($elementName = null, $elementLabel = null, $attributes = null)
 {
     if (!isset($attributes['id'])) {
         $attributes['id'] = $elementName;
     }
     HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
     $this->_appendName = true;
     $this->_type = 'date_time_picker';
 }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:12,代码来源:DateTimePicker.php


示例13: HTML_QuickForm_hiddenselect

 /**
  * Class constructor
  * 
  * @param     string    Select name attribute
  * @param     mixed     Label(s) for the select (not used)
  * @param     mixed     Data to be used to populate options
  * @param     mixed     Either a typical HTML attribute string or an associative array (not used)
  * @since     1.0
  * @access    public
  * @return    void
  */
 function HTML_QuickForm_hiddenselect($elementName = null, $elementLabel = null, $options = null, $attributes = null)
 {
     HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
     $this->_persistantFreeze = true;
     $this->_type = 'hiddenselect';
     if (isset($options)) {
         $this->load($options);
     }
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:20,代码来源:hiddenselect.php


示例14: __construct

 /**
  * Class constructor
  *
  * @param     string    Select name attribute
  * @param     mixed     Label(s) for the select (not used)
  * @param     mixed     Data to be used to populate options
  * @param     mixed     Either a typical HTML attribute string or an associative array (not used)
  * @since     1.0
  * @access    public
  * @return    void
  */
 public function __construct($elementName = null, $elementLabel = null, $options = null, $attributes = null)
 {
     // TODO MDL-52313 Replace with the call to parent::__construct().
     HTML_QuickForm_element::__construct($elementName, $elementLabel, $attributes);
     $this->_persistantFreeze = true;
     $this->_type = 'hiddenselect';
     if (isset($options)) {
         $this->load($options);
     }
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:21,代码来源:hiddenselect.php


示例15: DateRangePicker

 /**
  * Constructor
  */
 public function DateRangePicker($elementName = null, $elementLabel = null, $attributes = null)
 {
     if (!isset($attributes['id'])) {
         $attributes['id'] = $elementName;
     }
     $attributes['class'] = 'span3';
     HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
     $this->_appendName = true;
     $this->_type = 'date_range_picker';
 }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:13,代码来源:DateRangePicker.php


示例16: HTML_QuickForm_JoomlaEditor

 /**
  * Class constructor
  *
  * @param   string  Editor instance name
  * @param   string  Editor instance label
  * @param   array   Config settings for editor
  * @param   string  Attributes for the textarea
  * @access  public
  * @return  void
  */
 function HTML_QuickForm_JoomlaEditor($elementName = null, $elementLabel = null, $attributes = null, $options = array())
 {
     HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
     $this->_persistantFreeze = true;
     $this->_type = 'JoomlaEditor';
     // set editor height smaller if schema defines rows as 4 or less
     if (is_array($attributes) && array_key_exists('rows', $attributes) && $attributes['rows'] <= 4) {
         $this->height = 200;
     }
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:20,代码来源:joomlaeditor.php


示例17: __construct

 /**
  * Class constructor
  * 
  * @param     string    Input field name attribute
  * @param     mixed     Label(s) for a field
  * @param     string    Text to display near the radio
  * @param     string    Input field value
  * @param     mixed     Either a typical HTML attribute string or an associative array
  * @since     1.0
  * @access    public
  * @return    void
  */
 public function __construct($elementName = null, $elementLabel = null, $text = null, $value = null, $attributes = null)
 {
     // TODO MDL-52313 Replace with the call to parent::__construct().
     HTML_QuickForm_element::__construct($elementName, $elementLabel, $attributes);
     if (isset($value)) {
         $this->setValue($value);
     }
     $this->_persistantFreeze = true;
     $this->setType('radio');
     $this->_text = $text;
 }
开发者ID:evltuma,项目名称:moodle,代码行数:23,代码来源:radio.php


示例18: HTML_QuickForm_ckeditor

 function HTML_QuickForm_ckeditor($elementName = null, $elementLabel = null, $attributes = null)
 {
     load_js('modules/Libs/CKEditor/ckeditor/ckeditor.js', '');
     load_js('modules/Libs/CKEditor/ck.js', '');
     static $num = 0;
     HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
     $this->_persistantFreeze = true;
     $this->_type = 'text';
     $this->config = array();
     if (!isset($this->_attributes['id'])) {
         $this->_attributes['id'] = 'ckeditor_' . $elementName;
     }
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:13,代码来源:ckeditor.php


示例19: HTML_QuickForm_autoselect

 /**
  * Class constructor
  * 
  * @param     string    Select name attribute
  * @param     mixed     Label(s) for the select
  * @param     mixed     Data to be used to populate options
  * @param     mixed     Either a typical HTML attribute string or an associative array
  * @since     1.0
  * @access    public
  * @return    void
  */
 function HTML_QuickForm_autoselect($elementName = null, $elementLabel = null, $options = null, $more_opts_callback = null, $format = null, $attributes = null)
 {
     HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
     $this->_persistantFreeze = true;
     $this->_type = 'select';
     if (isset($options)) {
         $this->load($options);
         $this->__options = $options;
     }
     $this->more_opts_callback = $more_opts_callback[0];
     $this->more_opts_args = $more_opts_callback[1];
     $this->more_opts_format = $format;
 }
开发者ID:62BRAINS,项目名称:EPESI,代码行数:24,代码来源:autoselect.php


示例20: HTML_QuickForm_TinyMCE

 /**
  * Class constructor
  *
  * @param   string  TinyMCE instance name
  * @param   string  TinyMCE instance label
  * @param   array   Config settings for TinyMCE
  * @param   string  Attributes for the textarea
  * @access  public
  * @return  void
  */
 function HTML_QuickForm_TinyMCE($elementName = null, $elementLabel = null, $attributes = null, $options = array())
 {
     $attributes['class'] = 'tinymce';
     HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
     $this->_persistantFreeze = true;
     $this->_type = 'TinyMCE';
     if (is_array($attributes) && array_key_exists('rows', $attributes) && $attributes['rows'] <= 4) {
         $this->Height = 200;
     }
     if (is_array($options)) {
         $this->Config = $options;
     }
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:23,代码来源:tinymce.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP HTML_QuickForm_group类代码示例发布时间:2022-05-23
下一篇:
PHP HTML_QuickForm_RuleRegistry类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap