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


PHP HTML_QuickForm_input::onQuickFormEvent方法代码示例

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


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

示例1: onQuickFormEvent

 /**
  * Called by HTML_QuickForm whenever form event is made on this element
  *
  * @param     string    $event  Name of event
  * @param     mixed     $arg    event arguments
  * @param     object    &$caller calling object
  * @since     1.0
  * @access    public
  * @return    void
  */
 function onQuickFormEvent($event, $arg, &$caller)
 {
     switch ($event) {
         case 'updateValue':
             // constant values override both default and submitted ones
             // default values are overriden by submitted
             $value = $this->_findValue($caller->_constantValues);
             if (null === $value) {
                 // if no boxes were checked, then there is no value in the array
                 // yet we don't want to display default value in this case
                 if ($caller->isSubmitted()) {
                     $value = $this->_findValue($caller->_submitValues);
                 } else {
                     $value = $this->_findValue($caller->_defaultValues);
                 }
             }
             if (null !== $value || $caller->isSubmitted()) {
                 $this->setChecked($value);
             }
             break;
         case 'setGroupValue':
             $this->setChecked($arg);
             break;
         default:
             parent::onQuickFormEvent($event, $arg, $caller);
     }
     return true;
 }
开发者ID:laiello,项目名称:coopcrucial,代码行数:38,代码来源:checkbox.php

示例2: onQuickFormEvent

 /**
  * Called by HTML_QuickForm whenever form event is made on this element
  *
  * @param     string    $event  Name of event
  * @param     mixed     $arg    event arguments
  * @param     object    $caller calling object
  * @since     1.0
  * @access    public
  * @return    void
  */
 function onQuickFormEvent($event, $arg, &$caller)
 {
     switch ($event) {
         case 'updateValue':
             // constant values override both default and submitted ones
             // default values are overriden by submitted
             $value = $this->_findValue($caller->_constantValues);
             if (null === $value) {
                 $value = $this->_findValue($caller->_submitValues);
                 if (null === $value) {
                     $value = $this->_findValue($caller->_defaultValues);
                 }
             }
             if (!is_null($value) && $value == $this->getValue()) {
                 $this->setChecked(true);
             } else {
                 $this->setChecked(false);
             }
             break;
         case 'setGroupValue':
             if ($arg == $this->getValue()) {
                 $this->setChecked(true);
             } else {
                 $this->setChecked(false);
             }
             break;
         default:
             parent::onQuickFormEvent($event, $arg, $caller);
     }
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:saecommerce,代码行数:41,代码来源:radio.php

示例3: onQuickFormEvent

 /**
  * Called by HTML_QuickForm whenever form event is made on this element.
  * Adds necessary rules to the element and checks that coorenct instance of gradingform_instance
  * is passed in attributes
  *
  * @param string $event Name of event
  * @param mixed $arg event arguments
  * @param object $caller calling object
  * @return bool
  * @throws moodle_exception
  */
 public function onQuickFormEvent($event, $arg, &$caller)
 {
     if ($event == 'createElement') {
         $attributes = $arg[2];
         if (!is_array($attributes) || !array_key_exists('gradinginstance', $attributes) || !$attributes['gradinginstance'] instanceof gradingform_instance) {
             throw new moodle_exception('exc_gradingformelement', 'grading');
         }
     }
     $name = $this->getName();
     if ($name && $caller->elementExists($name)) {
         $caller->addRule($name, $this->get_gradinginstance()->default_validation_error_message(), 'gradingvalidated', $this->gradingattributes);
     }
     return parent::onQuickFormEvent($event, $arg, $caller);
 }
开发者ID:alanaipe2015,项目名称:moodle,代码行数:25,代码来源:grading.php

示例4: onQuickFormEvent

 /**
  * Called by HTML_QuickForm whenever form event is made on this element
  *
  * @param     string    $event  Name of event
  * @param     mixed     $arg    event arguments
  * @param     object    &$caller calling object
  * @since     1.0
  * @access    public
  * @return    void
  */
 function onQuickFormEvent($event, $arg, &$caller)
 {
     switch ($event) {
         case 'updateValue':
             // constant values override both default and submitted ones
             $value = $this->_findValue($caller->_constantValues);
             if (null === $value) {
                 // we should retrieve value from submitted values when form is submitted,
                 // else set value from defaults values
                 if ($caller->isSubmitted()) {
                     $value = $this->_findValue($caller->_submitValues);
                 } else {
                     $value = $this->_findValue($caller->_defaultValues);
                 }
             }
             if (!is_null($value) && $value == $this->getValue()) {
                 $this->setChecked(true);
             } else {
                 $this->setChecked(false);
             }
             break;
         case 'setGroupValue':
             if ($arg == $this->getValue()) {
                 $this->setChecked(true);
             } else {
                 $this->setChecked(false);
             }
             break;
         default:
             parent::onQuickFormEvent($event, $arg, $caller);
     }
     return true;
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:43,代码来源:radio.php

示例5: onQuickFormEvent

 function onQuickFormEvent($event, $arg, &$caller)
 {
     if ($event == 'updateValue' && is_callable(array($caller, 'applyFilter'))) {
         $caller->applyFilter($this->getName(), array($this, 'reg2time'));
     }
     return parent::onQuickFormEvent($event, $arg, $caller);
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:7,代码来源:datepicker.php


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