1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-09 15:47:09 +02:00

Version 1.2.6: Visual Editor

This commit is contained in:
Sebastian
2018-10-30 17:36:25 +01:00
parent 9b16a17d0b
commit 8179baf8f1
107 changed files with 1542 additions and 4364 deletions

View File

@@ -187,13 +187,14 @@ class Validation
{
$v = new Validator($params);
$v->rule('required', ['title', 'author', 'copyright', 'year']);
$v->rule('required', ['title', 'author', 'copyright', 'year', 'editor']);
$v->rule('lengthBetween', 'title', 2, 20);
$v->rule('lengthBetween', 'author', 2, 40);
$v->rule('regex', 'title', '/^[\pL0-9_ \-]*$/u');
$v->rule('regex', 'author', '/^[\pL_ \-]*$/u');
$v->rule('integer', 'year');
$v->rule('length', 'year', 4);
$v->rule('in', 'editor', ['raw', 'visual']);
$v->rule('in', 'copyright', $copyright);
return $this->validationResult($v, $name);
@@ -224,6 +225,24 @@ class Validation
return $v->errors();
}
}
public function blockInput(array $params)
{
$v = new Validator($params);
$v->rule('required', ['markdown', 'block_id', 'url']);
$v->rule('markdownSecure', 'markdown');
$v->rule('regex', 'block_id', '/^[0-9.]+$/i');
if($v->validate())
{
return true;
}
else
{
return $v->errors();
}
}
/**
* validation for resort navigation