public function validation($data, $files) {
        global $DB;

        $errors = array();
        if ($DB->count_records('portfolio_instance', array('name' => $data['name'], 'plugin' => $data['plugin'])) > 1) {
            $errors = array('name' => get_string('err_uniquename', 'portfolio'));
        }

        $pluginerrors = array();
        $pluginerrors = portfolio_static_function($this->plugin, 'admin_config_validation', $data);
        if (is_array($pluginerrors)) {
            $errors = array_merge($errors, $pluginerrors);
        }
        return $errors;
    }
public function validation($data, $files) {
        global $DB;

        $errors = array();
        if ($DB->count_records('portfolio_instance', array('name' => $data['name'], 'plugin' => $data['plugin'])) > 1) {
            $errors = array('name' => get_string('err_uniquename', 'portfolio'));
        }

        $pluginerrors = array();
        $pluginerrors = portfolio_static_function($this->plugin, 'admin_config_validation', $data);
        if (is_array($pluginerrors)) {
            $errors = array_merge($errors, $pluginerrors);
        }
        return $errors;
    }
public function validation ( $ data , $ files ) { global $ DB ; $ errors = array ( ) ; if ( $ DB -> count_records ( 'portfolio_instance' , array ( 'name' => $ data [ 'name' ] , 'plugin' => $ data [ 'plugin' ] ) ) > 1 ) { $ errors = array ( 'name' => get_string ( 'err_uniquename' , 'portfolio' ) ) ; } $ pluginerrors = array ( ) ; $ pluginerrors = portfolio_static_function ( $ this -> plugin , 'admin_config_validation' , $ data ) ; if ( is_array ( $ pluginerrors ) ) { $ errors = array_merge ( $ errors , $ pluginerrors ) ; } return $ errors ; }
Validate admin config form

@param stdObject $data form data
@return array
Validate admin config form