bludit/kernel/admin/views/edit-user.php

135 lines
3.5 KiB
PHP
Raw Normal View History

2015-10-19 00:45:58 +02:00
<?php
2015-11-07 01:23:50 +01:00
HTML::title(array('title'=>$L->g('Edit user'), 'icon'=>'user'));
2015-10-19 00:45:58 +02:00
2015-11-15 22:37:34 +01:00
echo '<div class="uk-grid">';
2015-11-16 05:20:58 +01:00
echo '<div class="uk-width-7-10">';
2015-11-15 22:37:34 +01:00
2015-11-07 01:23:50 +01:00
HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal'));
2015-10-19 00:45:58 +02:00
// Security token
HTML::formInputHidden(array(
2015-10-20 05:14:28 +02:00
'name'=>'tokenCSRF',
'value'=>$Security->getTokenCSRF()
2015-10-19 00:45:58 +02:00
));
// Security token
HTML::formInputHidden(array(
'name'=>'username',
'value'=>$_user['username']
));
2015-11-30 01:45:30 +01:00
HTML::legend(array('value'=>$L->g('Profile'), 'class'=>'first-child'));
2015-10-19 00:45:58 +02:00
2015-11-07 01:23:50 +01:00
HTML::formInputText(array(
'name'=>'usernameDisable',
'label'=>$L->g('Username'),
'value'=>$_user['username'],
'class'=>'uk-width-1-2 uk-form-medium',
'disabled'=>true,
'tip'=>''
));
2015-10-19 00:45:58 +02:00
HTML::formInputText(array(
'name'=>'firstName',
'label'=>$L->g('First name'),
'value'=>$_user['firstName'],
'class'=>'uk-width-1-2 uk-form-medium',
'tip'=>''
));
HTML::formInputText(array(
'name'=>'lastName',
'label'=>$L->g('Last name'),
'value'=>$_user['lastName'],
'class'=>'uk-width-1-2 uk-form-medium',
'tip'=>''
));
2015-11-07 01:23:50 +01:00
echo '<div class="uk-form-row">
<label class="uk-form-label">Password</label>
<div class="uk-form-controls">
<a href="'.HTML_PATH_ADMIN_ROOT.'user-password/'.$_user['username'].'">'.$L->g('Change password').'</a>
</div>
</div>';
2015-10-25 21:27:24 +01:00
if($Login->role()==='admin') {
2015-10-19 00:45:58 +02:00
HTML::formSelect(array(
'name'=>'role',
'label'=>$L->g('Role'),
'options'=>array('editor'=>$L->g('Editor'), 'admin'=>$L->g('Administrator')),
'selected'=>$_user['role'],
'tip'=>''
));
}
HTML::formInputText(array(
'name'=>'email',
'label'=>$L->g('Email'),
'value'=>$_user['email'],
'class'=>'uk-width-1-2 uk-form-medium',
'tip'=>$L->g('email-will-not-be-publicly-displayed')
));
echo '<div class="uk-form-row">
<div class="uk-form-controls">
<button type="submit" class="uk-button uk-button-primary">'.$L->g('Save').'</button>
<a href="'.HTML_PATH_ADMIN_ROOT.'users" class="uk-button">'.$L->g('Cancel').'</a>
</div>
</div>';
2015-10-25 21:27:24 +01:00
if( ($Login->role()==='admin') && ($_user['username']!='admin') ) {
2015-10-19 00:45:58 +02:00
HTML::legend(array('value'=>$L->g('Delete')));
echo '<div class="uk-form-row">
<div class="uk-form-controls">
2015-10-25 21:27:24 +01:00
<button type="submit" id="jsdelete-user-associate" class="delete-button" name="delete-user-associate"><i class="uk-icon-ban"></i> '.$L->g('Delete the user and associate its posts to admin user').'</button>
<button type="submit" id="jsdelete-user-all" class="delete-button" name="delete-user-all"><i class="uk-icon-ban"></i> '.$L->g('Delete the user and all its posts').'</button>
2015-10-19 00:45:58 +02:00
</div>
</div>';
}
HTML::formClose();
2015-11-15 22:37:34 +01:00
echo '</div>';
2015-11-16 05:20:58 +01:00
echo '<div class="uk-width-3-10" style="margin-top: 50px; text-align: center;">';
2015-12-02 02:32:55 +01:00
echo '<div id="jsprofilePicture">';
2015-12-01 03:57:46 +01:00
if(file_exists(PATH_UPLOADS_PROFILES.$_user['username'].'.jpg')) {
2015-12-02 02:32:55 +01:00
echo '<img class="uk-border-rounded" src="'.HTML_PATH_UPLOADS_PROFILES.$_user['username'].'.jpg" alt="">';
2015-12-01 03:57:46 +01:00
}
else {
echo '<div class="uk-block uk-border-rounded uk-block-muted uk-block-large">'.$L->g('Profile picture').'</div>';
}
2015-12-02 02:32:55 +01:00
echo '</div>';
2015-11-15 22:37:34 +01:00
HTML::profileUploader($_user['username']);
2015-12-02 02:32:55 +01:00
2015-11-15 22:37:34 +01:00
echo '</div>';
echo '</div>';
2015-10-19 00:45:58 +02:00
?>
<script>
$(document).ready(function() {
$("#jsdelete-user-associate").click(function() {
if(confirm("<?php $Language->p('confirm-delete-this-action-cannot-be-undone') ?>")==false) {
return false;
}
});
$("#jsdelete-user-all").click(function() {
if(confirm("<?php $Language->p('confirm-delete-this-action-cannot-be-undone') ?>")==false) {
return false;
}
});
});
2015-12-01 03:57:46 +01:00
</script>