Exemplo n.º 1
0
 private function _validateForm($group)
 {
     if (!$this->user->canModify('setting/setting_quick_form')) {
         $this->error['warning'] = $this->language->get('error_permission');
     }
     $this->load->library('config_manager');
     $config_mngr = new AConfigManager();
     $result = $config_mngr->validate($group, $this->request->post);
     $this->error = $result['error'];
     $this->request->post = $result['validated'];
     // for changed data saving
     $this->extensions->hk_ValidateData($this);
     if (!$this->error) {
         return TRUE;
     } else {
         return FALSE;
     }
 }
Exemplo n.º 2
0
 private function _validateField($group, $field, $value)
 {
     $this->load->library('config_manager');
     $config_mngr = new AConfigManager();
     $result = $config_mngr->validate($group, array($field => $value));
     return is_array($result['error']) ? current($result['error']) : $result['error'];
 }
Exemplo n.º 3
0
 /**
  * @param string $group
  * @return bool
  */
 private function _validate($group)
 {
     if (!$this->user->canModify('design/template')) {
         $this->error['warning'] = $this->language->get('error_permission');
     }
     $this->load->library('config_manager');
     $config_mngr = new AConfigManager();
     $result = $config_mngr->validate($group, $this->request->post);
     $this->error = $result['error'];
     $this->request->post = $result['validated'];
     // for changed data saving
     $this->extensions->hk_ValidateData($this);
     if (!$this->error) {
         return true;
     } else {
         if (!isset($this->error['warning'])) {
             $this->error['warning'] = $this->language->get('error_required_data');
         }
         return false;
     }
 }