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>';
|
||||
|
@@ -14,9 +14,9 @@
|
||||
<?php
|
||||
|
||||
echo Form::label('menu_item_name', __('Item name', 'menu'));
|
||||
echo Form::input('menu_item_name', $menu_item_name, array('class' => 'span3'.$error_class));
|
||||
echo Form::input('menu_item_name', $menu_item_name, array('class' => (isset($errors['menu_item_name_empty']) || isset($errors['menu_item_name_empty'])) ? 'span3 error-field' : 'span3'));
|
||||
|
||||
if (isset($errors['menu_item_name_empty'])) echo Html::nbsp(4).'<span class="error">'.$errors['menu_item_name_empty'].'</span>';
|
||||
if (isset($errors['menu_item_name_empty'])) echo Html::nbsp(4).'<span style="color:red;">'.$errors['menu_item_name_empty'].'</span>';
|
||||
|
||||
echo (
|
||||
Form::label('menu_item_link', __('Item link', 'menu')).
|
||||
|
@@ -14,9 +14,9 @@
|
||||
<?php
|
||||
|
||||
echo Form::label('menu_item_name', __('Item name', 'menu'));
|
||||
echo Form::input('menu_item_name', $menu_item_name, array('class' => 'span3'.$error_class));
|
||||
echo Form::input('menu_item_name', $menu_item_name, array('class' => (isset($errors['menu_item_name_empty']) || isset($errors['menu_item_name_empty'])) ? 'span3 error-field' : 'span3'));
|
||||
|
||||
if (isset($errors['menu_item_name_empty'])) echo Html::nbsp(4).'<span class="error">'.$errors['menu_item_name_empty'].'</span>';
|
||||
if (isset($errors['menu_item_name_empty'])) echo Html::nbsp(4).'<span style="color:red;">'.$errors['menu_item_name_empty'].'</span>';
|
||||
|
||||
echo (
|
||||
Form::label('menu_item_link', __('Item link', 'menu')).
|
||||
|
@@ -14,7 +14,7 @@
|
||||
<?php echo (Form::label('name', __('Name', 'snippets'))); ?>
|
||||
|
||||
<div class="input-append">
|
||||
<?php echo (Form::input('name', $name, array('class' => 'input-xlarge'))); ?><span class="add-on">.snippet.php</span>
|
||||
<?php echo (Form::input('name', $name, array('class' => (isset($errors['snippets_empty_name']) || isset($errors['snippets_exists'])) ? 'input-xlarge error-field' : 'input-xlarge'))); ?><span class="add-on">.snippet.php</span>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
@@ -20,7 +20,7 @@
|
||||
<?php echo (Form::label('name', __('Name', 'snippets'))); ?>
|
||||
|
||||
<div class="input-append">
|
||||
<?php echo (Form::input('name', $name, array('class' => 'input-xlarge'))); ?><span class="add-on">.snippet.php</span>
|
||||
<?php echo (Form::input('name', $name, array('class' => (isset($errors['snippets_empty_name']) || isset($errors['snippets_exists'])) ? 'input-xlarge error-field' : 'input-xlarge'))); ?><span class="add-on">.snippet.php</span>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
@@ -15,7 +15,7 @@
|
||||
<?php echo (Form::label('name', __('Name', 'themes'))); ?>
|
||||
|
||||
<div class="input-append">
|
||||
<?php echo (Form::input('name', $name, array('class' => 'input-xlarge'))); ?>
|
||||
<?php echo (Form::input('name', $name, array('class' => (isset($errors['file_empty_name']) || isset($errors['file_exists'])) ? 'input-xlarge error-field' : 'input-xlarge'))); ?>
|
||||
<?php if ($action == 'chunk') { ?><span class="add-on">.chunk.php</span><?php } ?>
|
||||
<?php if ($action == 'template') { ?><span class="add-on">.template.php</span><?php } ?>
|
||||
<?php if ($action == 'styles') { ?><span class="add-on">.css</span><?php } ?>
|
||||
|
@@ -26,7 +26,7 @@
|
||||
<?php echo (Form::label('name', __('Name', 'themes'))); ?>
|
||||
|
||||
<div class="input-append">
|
||||
<?php echo (Form::input('name', $name, array('class' => 'input-xlarge'))); ?>
|
||||
<?php echo (Form::input('name', $name, array('class' => (isset($errors['file_empty_name']) || isset($errors['file_exists'])) ? 'input-xlarge error-field' : 'input-xlarge'))); ?>
|
||||
<?php if ($action == 'chunk') { ?><span class="add-on">.chunk.php</span><?php } ?>
|
||||
<?php if ($action == 'template') { ?><span class="add-on">.template.php</span><?php } ?>
|
||||
<?php if ($action == 'styles') { ?><span class="add-on">.css</span><?php } ?>
|
||||
|
@@ -7,18 +7,18 @@
|
||||
Form::open().
|
||||
Form::hidden('csrf', Security::token()).
|
||||
Form::label('login', __('Username', 'users')).
|
||||
Form::input('login', null, array('class' => 'span3'))
|
||||
Form::input('login', null, array('class' => (isset($errors['users_this_user_alredy_exists']) || isset($errors['users_empty_login'])) ? 'span3 error-field' : 'span3'))
|
||||
);
|
||||
|
||||
if (isset($errors['users_this_user_alredy_exists'])) echo Html::nbsp(3).'<span class="error">'.$errors['users_this_user_alredy_exists'].'</span>';
|
||||
if (isset($errors['users_empty_login'])) echo Html::nbsp(3).'<span class="error">'.$errors['users_empty_login'].'</span>';
|
||||
if (isset($errors['users_empty_login'])) echo Html::nbsp(3).'<span style="color:red">'.$errors['users_empty_login'].'</span>';
|
||||
|
||||
echo (
|
||||
Form::label('password', __('Password', 'users')).
|
||||
Form::password('password', null, array('class' => 'span3'))
|
||||
Form::password('password', null, array('class' => (isset($errors['users_empty_password'])) ? 'span3 error-field' : 'span3'))
|
||||
);
|
||||
|
||||
if (isset($errors['users_empty_password'])) echo Html::nbsp(3).'<span class="error">'.$errors['users_empty_password'].'</span>';
|
||||
if (isset($errors['users_empty_password'])) echo Html::nbsp(3).'<span style="color:red">'.$errors['users_empty_password'].'</span>';
|
||||
|
||||
echo (
|
||||
Form::label('email', __('Email', 'users')).
|
||||
|
Reference in New Issue
Block a user