예제 #1
0
 /**
  * Allows to perform the attribute modifications to certain HTML
  * tags (that are in the "com" namespace), so that we can add there
  * extra CSS classes depending on the component state.
  *
  * @param String $nodeName The tag name.
  * @param Array $attributes The source attribute list
  * @return Array
  */
 public function manageAttributes($nodeName, array $attributes)
 {
     if ($this->_form->status() != Form::FORM_INVALID) {
         return $attributes;
     }
     if ($nodeName == 'div' && $this->_form->getValidationStatus($this->_params['name'])) {
         $attributes['class'] = $attributes['class'] . ' ' . $this->_view->getTemplateVar('formInvalidFieldRowClass');
     }
     return $attributes;
 }
예제 #2
0
 /**
  * Passes the OPT view to the widget.
  *
  * @param Opt_View $view The view.
  */
 public function setView(Opt_View $view)
 {
     $this->_view = $view;
     if ($this->_form === null) {
         $this->_form = $view->getTemplateVar('form');
         if ($this->_form === null) {
             throw new Opf_Exception('Item "form" not exists.');
         }
     }
 }