|
@@ -301,18 +301,12 @@ class BBCode extends Parser
|
|
'def_attr.format' => 'string:trim|max:1024',
|
|
'def_attr.format' => 'string:trim|max:1024',
|
|
'def_attr.body_format' => 'string:trim|max:1024',
|
|
'def_attr.body_format' => 'string:trim|max:1024',
|
|
'def_attr.text_only' => 'required|integer|in:0,1',
|
|
'def_attr.text_only' => 'required|integer|in:0,1',
|
|
- 'other_attrs.*.allowed' => 'required|integer|in:0,1',
|
|
|
|
- 'other_attrs.*.required' => 'required|integer|in:0,1',
|
|
|
|
- 'other_attrs.*.format' => 'string:trim|max:1024',
|
|
|
|
- 'other_attrs.*.body_format' => 'string:trim|max:1024',
|
|
|
|
- 'other_attrs.*.text_only' => 'required|integer|in:0,1',
|
|
|
|
'new_attr.name' => ['string:trim', 'regex:%^(?:|[a-z-]{2,15})$%'],
|
|
'new_attr.name' => ['string:trim', 'regex:%^(?:|[a-z-]{2,15})$%'],
|
|
'new_attr.allowed' => 'required|integer|in:0,1',
|
|
'new_attr.allowed' => 'required|integer|in:0,1',
|
|
'new_attr.required' => 'required|integer|in:0,1',
|
|
'new_attr.required' => 'required|integer|in:0,1',
|
|
'new_attr.format' => 'string:trim|max:1024',
|
|
'new_attr.format' => 'string:trim|max:1024',
|
|
'new_attr.body_format' => 'string:trim|max:1024',
|
|
'new_attr.body_format' => 'string:trim|max:1024',
|
|
'new_attr.text_only' => 'required|integer|in:0,1',
|
|
'new_attr.text_only' => 'required|integer|in:0,1',
|
|
- 'save' => 'check_all',
|
|
|
|
])->addAliases([
|
|
])->addAliases([
|
|
])->addArguments([
|
|
])->addArguments([
|
|
'token' => $pageArgs,
|
|
'token' => $pageArgs,
|
|
@@ -320,6 +314,20 @@ class BBCode extends Parser
|
|
])->addMessages([
|
|
])->addMessages([
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
+ if ($structure->other_attrs) {
|
|
|
|
+ $v->addRules([
|
|
|
|
+ 'other_attrs.*.allowed' => 'required|integer|in:0,1',
|
|
|
|
+ 'other_attrs.*.required' => 'required|integer|in:0,1',
|
|
|
|
+ 'other_attrs.*.format' => 'string:trim|max:1024',
|
|
|
|
+ 'other_attrs.*.body_format' => 'string:trim|max:1024',
|
|
|
|
+ 'other_attrs.*.text_only' => 'required|integer|in:0,1',
|
|
|
|
+ ]);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $v->addRules([
|
|
|
|
+ 'save' => 'check_all',
|
|
|
|
+ ]);
|
|
|
|
+
|
|
if ($v->validation($_POST)) {
|
|
if ($v->validation($_POST)) {
|
|
if ($id > 0) {
|
|
if ($id > 0) {
|
|
$this->c->bbcode->update($id, $structure);
|
|
$this->c->bbcode->update($id, $structure);
|