mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-07-31 02:10:37 +02:00
Add .error-field class on all areas #10
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
|
||||
if (Security::check(Request::post('csrf'))) {
|
||||
|
||||
if (trim(Request::post('name')) == '') $errors['blocks_empty_name'] = __('This field should not be empty', 'blocks');
|
||||
if (trim(Request::post('name')) == '') $errors['blocks_empty_name'] = __('Required field', 'blocks');
|
||||
if (file_exists($blocks_path.Security::safeName(Request::post('name')).'.block.html')) $errors['blocks_exists'] = __('This block already exists', 'blocks');
|
||||
|
||||
if (count($errors) == 0) {
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
if (Security::check(Request::post('csrf'))) {
|
||||
|
||||
if (trim(Request::post('name')) == '') $errors['blocks_empty_name'] = __('This field should not be empty', 'blocks');
|
||||
if (trim(Request::post('name')) == '') $errors['blocks_empty_name'] = __('Required field', 'blocks');
|
||||
if ((file_exists($blocks_path.Security::safeName(Request::post('name')).'.block.html')) and (Security::safeName(Request::post('blocks_old_name')) !== Security::safeName(Request::post('name')))) $errors['blocks_exists'] = __('This block already exists', 'blocks');
|
||||
|
||||
// Save fields
|
||||
|
@@ -13,7 +13,7 @@
|
||||
'Save' => 'Save',
|
||||
'Save and exit' => 'Save and exit',
|
||||
'Actions' => 'Actions',
|
||||
'This field should not be empty' => 'This field should not be empty',
|
||||
'Required field' => 'Required field',
|
||||
'This block already exists' => 'This block already exists',
|
||||
'This block does not exist' => 'This block does not exist',
|
||||
'Delete block: :block' => 'Delete block: :block',
|
||||
|
@@ -13,12 +13,12 @@
|
||||
|
||||
<?php echo (Form::label('name', __('Name', 'blocks'))); ?>
|
||||
|
||||
<?php echo (Form::input('name', $name, array('class' => 'span5'))); ?>
|
||||
<?php echo (Form::input('name', $name, array('class' => (isset($errors['blocks_empty_name']) || isset($errors['blocks_exists'])) ? 'span5 error-field' : 'span5'))); ?>
|
||||
|
||||
<?php
|
||||
if (isset($errors['blocks_empty_name'])) echo ' <span style="color:red">'.$errors['blocks_empty_name'].'</span>';
|
||||
if (isset($errors['blocks_exists'])) echo ' <span style="color:red">'.$errors['blocks_exists'].'</span>';
|
||||
?>
|
||||
<?php
|
||||
if (isset($errors['blocks_empty_name'])) echo ' <span style="color:red">'.$errors['blocks_empty_name'].'</span>';
|
||||
if (isset($errors['blocks_exists'])) echo ' <span style="color:red">'.$errors['blocks_exists'].'</span>';
|
||||
?>
|
||||
|
||||
<br /><br />
|
||||
<?php
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
<?php echo (Form::label('name', __('Name', 'blocks'))); ?>
|
||||
|
||||
<?php echo (Form::input('name', $name, array('class' => 'span5'))); ?>
|
||||
<?php echo (Form::input('name', $name, array('class' => (isset($errors['blocks_empty_name']) || isset($errors['blocks_exists'])) ? 'span5 error-field' : 'span5'))); ?>
|
||||
|
||||
<?php
|
||||
if (isset($errors['blocks_empty_name'])) echo ' <span style="color:red">'.$errors['blocks_empty_name'].'</span>';
|
||||
|
Reference in New Issue
Block a user