Beispiel #1
0
 /**
  * エラー項目の背景色を設定する
  * (QuickFormの項目に対して、背景色を設定する)
  * @access public
  * @param HTML_QuickForm_element $element エラー項目
  */
 private function _setErrorAttribute(&$element)
 {
     if ('group' == $element->getType()) {
         $elements = $element->getElements();
         foreach ($elements as $value) {
             $this->_setErrorAttribute($value);
         }
     } else {
         $attr = $element->getAttributes();
         $attr['style'] = S4_ERROR_COLUMN_COLOR;
         $element->setAttributes($attr);
     }
 }
Beispiel #2
0
 /**
  * Returns the CSS id attribute that will be assigned by moodleform later to this element
  * @param stdClass $item
  * @param HTML_QuickForm_element $element
  */
 protected function guess_element_id($item, $element)
 {
     if (!($id = $element->getAttribute('id'))) {
         $attributes = $element->getAttributes();
         $id = $attributes['id'] = 'feedback_item_' . $item->id;
         $element->setAttributes($attributes);
     }
     if ($element->getType() === 'group') {
         return 'fgroup_' . $id;
     }
     return 'fitem_' . $id;
 }