mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-10 15:14:30 +02:00
Add Monstra from HG Commit 683dcb70c4cc
This commit is contained in:
32
plugins/box/users/views/backend/add.view.php
Normal file
32
plugins/box/users/views/backend/add.view.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<!-- Users_add -->
|
||||
<?php
|
||||
echo ( '<h2>'.__('New User Registration', 'users').'</h2>' );
|
||||
|
||||
echo (
|
||||
Html::br().
|
||||
Form::open().
|
||||
Form::hidden('csrf', Security::token()).
|
||||
Form::label('login', __('Username', 'users')).
|
||||
Form::input('login', null, array('class' => '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>';
|
||||
|
||||
echo (
|
||||
Form::label('password', __('Password', 'users')).
|
||||
Form::password('password', null, array('class' => 'span3'))
|
||||
);
|
||||
|
||||
if (isset($errors['users_empty_password'])) echo Html::nbsp(3).'<span class="error">'.$errors['users_empty_password'].'</span>';
|
||||
|
||||
echo (
|
||||
Form::label('email', __('Email', 'users')).
|
||||
Form::input('email', null, array('class' => 'span3')). Html::br().
|
||||
Form::label('role', __('Role', 'users')).
|
||||
Form::select('role', array('admin' => __('Admin', 'users'), 'editor' => __('Editor', 'users'), 'user' => __('User', 'users')), null, array('class' => 'span3')). Html::br(2).
|
||||
Form::submit('register', __('Register', 'users'), array('class' => 'btn default')).
|
||||
Form::close()
|
||||
);
|
||||
?>
|
||||
<!-- /Users_add -->
|
89
plugins/box/users/views/backend/edit.view.php
Normal file
89
plugins/box/users/views/backend/edit.view.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<!-- Users_edit -->
|
||||
<?php
|
||||
|
||||
// Show template for exist user else show error
|
||||
if ($user !== null) {
|
||||
|
||||
echo ( '<h2>'.__('Edit profile', 'users').'</h2>' );
|
||||
|
||||
?>
|
||||
|
||||
<br />
|
||||
|
||||
<?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?>
|
||||
<?php if (Notification::get('error')) Alert::error(Notification::get('error')); ?>
|
||||
|
||||
<div>
|
||||
|
||||
<div class="span7">
|
||||
<?php
|
||||
|
||||
echo (
|
||||
Form::open().
|
||||
Form::hidden('csrf', Security::token()).
|
||||
Form::hidden('user_id', Request::get('user_id'))
|
||||
);
|
||||
|
||||
if (isset($_SESSION['user_role']) && in_array($_SESSION['user_role'], array('admin'))) {
|
||||
echo Form::label('login', __('Username', 'users'));
|
||||
echo Form::input('login', $user['login'], array('class' => 'span6'));
|
||||
} else {
|
||||
echo Form::hidden('login', $user['login']);
|
||||
}
|
||||
|
||||
echo (
|
||||
Html::br().
|
||||
Form::label('firstname', __('Firstname', 'users')).
|
||||
Form::input('firstname', $user_firstname, array('class' => 'span6')).Html::br().
|
||||
Form::label('lastname', __('Lastname', 'users')).
|
||||
Form::input('lastname', $user_lastname, array('class' => 'span6')).Html::br().
|
||||
Form::label('email', __('Email', 'users')).
|
||||
Form::input('email', $user_email, array('class' => 'span6')).Html::br().
|
||||
Form::label('twitter', __('Twitter', 'users')).
|
||||
Form::input('twitter', $user_twitter, array('class' => 'span6')).Html::br().
|
||||
Form::label('skype', __('Skype', 'users')).
|
||||
Form::input('skype', $user_skype, array('class' => 'span6')).Html::br()
|
||||
);
|
||||
|
||||
if (isset($_SESSION['user_role']) && in_array($_SESSION['user_role'], array('admin'))) {
|
||||
echo Form::label('role', __('Role', 'users'));
|
||||
echo Form::select('role', array('admin' => __('Admin', 'users'), 'editor' => __('Editor', 'users'), 'user' => __('User', 'users')), $user['role'], array('class' => 'span3')). Html::br();
|
||||
} else {
|
||||
echo Form::hidden('role', $_SESSION['user_role']);
|
||||
}
|
||||
|
||||
|
||||
echo (
|
||||
Html::br().
|
||||
Form::submit('edit_profile', __('Save', 'users'), array('class' => 'btn')).
|
||||
Form::close()
|
||||
);
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="span5">
|
||||
<?php
|
||||
|
||||
echo (
|
||||
Form::open().
|
||||
Form::hidden('csrf', Security::token()).
|
||||
Form::hidden('user_id', Request::get('user_id')).
|
||||
Form::label('new_password', __('New password', 'users')).
|
||||
Form::password('new_password', null, array('class' => 'span6')).Html::br().Html::br().
|
||||
Form::submit('edit_profile_password', __('Save', 'users'), array('class' => 'btn')).
|
||||
Form::close()
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="clear:both"></div>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
echo '<div class="message-error">'.__('This user does not exist', 'users').'</div>';
|
||||
}
|
||||
?>
|
||||
<!-- /Users_edit -->
|
55
plugins/box/users/views/backend/index.view.php
Normal file
55
plugins/box/users/views/backend/index.view.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<h2><?php echo __('Users', 'users'); ?></h2>
|
||||
<br />
|
||||
|
||||
<?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?>
|
||||
|
||||
<?php echo Html::anchor(__('Register new user', 'users'), 'index.php?id=users&action=add', array('title' => __('Create new page', 'users'), 'class' => 'btn default btn-small')); ?>
|
||||
|
||||
<div class="pull-right">
|
||||
<?php echo Form::open(null, array('name' => 'users_frontend')); ?>
|
||||
<?php echo Form::hidden('csrf', Security::token()); ?>
|
||||
<?php echo Form::checkbox('users_frontend_registration', null, $users_frontend_registration); ?> <?php echo __('Allow user registration') ?>
|
||||
<?php echo Form::input('users_frontend_submit', 'users_frontend_submit', array('style' => 'display:none;')); ?>
|
||||
<?php echo Form::close();?>
|
||||
</div>
|
||||
|
||||
<br /><br />
|
||||
|
||||
<!-- Users_list -->
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?php echo __('Username', 'users'); ?></td>
|
||||
<td><?php echo __('Email', 'users'); ?></td>
|
||||
<td><?php echo __('Registered', 'users'); ?></td>
|
||||
<td><?php echo __('Role', 'users'); ?></td>
|
||||
<td width="30%"><?php echo __('Actions', 'users'); ?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($users_list as $user) { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo Html::toText($user['login']); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo Html::toText($user['email']); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo Date::format($user['date_registered']); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $roles["{$user['role']}"]; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo Html::anchor(__('Edit', 'users'), 'index.php?id=users&action=edit&user_id='.$user['id'], array('class' => 'btn btn-actions')); ?>
|
||||
<?php echo Html::anchor(__('Delete', 'users'),
|
||||
'index.php?id=users&action=delete&user_id='.$user['id'],
|
||||
array('class' => 'btn btn-actions', 'onclick' => "return confirmDelete('".__('Delete user: :user', 'users', array(':user' => Html::toText($user['login'])))."')"));
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- /Users_list -->
|
Reference in New Issue
Block a user