Esempio n. 1
0
 /**
  * Create event handler.
  *
  * @param Zikula_Form_View $view Reference to Zikula_Form_View object.
  * @param array            &$params Parameters passed from the Smarty plugin function.
  *
  * @see    Zikula_Form_AbstractPlugin
  * @return void
  */
 public function create(Zikula_Form_View $view, &$params)
 {
     // All member variables are fetched automatically before create (as strings)
     // Here we afterwards load all special and non-string parameters
     $this->inputName = array_key_exists('inputName', $params) ? $params['inputName'] : $this->id;
     $this->textMode = array_key_exists('textMode', $params) ? $params['textMode'] : 'singleline';
     $this->dataField = array_key_exists('dataField', $params) ? $params['dataField'] : $this->id;
     $this->dataBased = array_key_exists('dataBased', $params) ? $params['dataBased'] : true;
     if (array_key_exists('maxLength', $params)) {
         $this->maxLength = $params['maxLength'];
     } elseif ($this->maxLength == null && !in_array(strtolower($this->textMode), array('multiline', 'hidden'))) {
         $view->formDie("Missing maxLength value in textInput plugin '{$this->id}'.");
     }
     if (array_key_exists('minLength', $params)) {
         $this->minLength = $params['minLength'];
     } else {
         $this->minLength = 0;
     }
 }