Exemplo n.º 1
0
 public function bindData($array = array())
 {
     $this->_data_array = array();
     // set raw input for textarea
     $post = JRequest::get('post', JREQUEST_ALLOWRAW);
     foreach ($array as $index => $instance_data) {
         if (isset($post['elements'][$this->identifier][$index]['value'])) {
             $array[$index]['value'] = $post['elements'][$this->identifier][$index]['value'];
         }
     }
     // set data
     foreach ($array as $instance_data) {
         $data = ElementData::newInstance($this);
         foreach ($instance_data as $key => $value) {
             $data->set($key, $value);
         }
         $this->_data_array[] = $data;
     }
     if (empty($this->_data_array)) {
         $this->_data_array[0] = ElementData::newInstance($this);
     }
     $this->_data = $this->_data_array[0];
 }
Exemplo n.º 2
0
 public function bindData($array = array())
 {
     $this->_data_array = array();
     foreach ($array as $instance_data) {
         $data = ElementData::newInstance($this);
         foreach ($instance_data as $key => $value) {
             $data->set($key, $value);
         }
         $this->_data_array[] = $data;
     }
     if (empty($this->_data_array)) {
         $this->_data_array[0] = ElementData::newInstance($this);
     }
     $this->_data = $this->_data_array[0];
 }
Exemplo n.º 3
0
 public function bindData($data = array())
 {
     $this->_data = ElementData::newInstance($this);
     foreach ($data as $key => $value) {
         $this->_data->set($key, $value);
     }
 }