public function validation($data, $files) {

        $pluginman = core_plugin_manager::instance();
        $errors = parent::validation($data, $files);

        if (!empty($data['plugintype'])) {
            if (!$pluginman->is_plugintype_writable($data['plugintype'])) {
                $path = $pluginman->get_plugintype_root($data['plugintype']);
                $errors['plugintype'] = get_string('permcheckresultno', 'tool_installaddon', array('path' => $path));
            }
        }

        return $errors;
    }
public function validation($data, $files) {

        $pluginman = core_plugin_manager::instance();
        $errors = parent::validation($data, $files);

        if (!empty($data['plugintype'])) {
            if (!$pluginman->is_plugintype_writable($data['plugintype'])) {
                $path = $pluginman->get_plugintype_root($data['plugintype']);
                $errors['plugintype'] = get_string('permcheckresultno', 'tool_installaddon', array('path' => $path));
            }
        }

        return $errors;
    }
public function validation ( $ data , $ files ) { $ pluginman = core_plugin_manager :: instance ( ) ; $ errors = parent :: validation ( $ data , $ files ) ; if ( ! empty ( $ data [ 'plugintype' ] ) ) { if ( ! $ pluginman -> is_plugintype_writable ( $ data [ 'plugintype' ] ) ) { $ path = $ pluginman -> get_plugintype_root ( $ data [ 'plugintype' ] ) ; $ errors [ 'plugintype' ] = get_string ( 'permcheckresultno' , 'tool_installaddon' , array ( 'path' => $ path ) ) ; } } return $ errors ; }
Validate the form fields

@param array $data
@param array $files
@return array (string)field name => (string)validation error text
Validate the form fields