Skip to content

Commit

Permalink
New role Author
Browse files Browse the repository at this point in the history
  • Loading branch information
dignajar committed May 13, 2019
1 parent 3d87b65 commit fc2387b
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 21 deletions.
6 changes: 3 additions & 3 deletions bl-kernel/admin/controllers/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Check role
// ============================================================================

checkRole(array('admin', 'editor'));
checkRole(array('admin', 'editor', 'author'));

// ============================================================================
// Functions
Expand Down Expand Up @@ -41,8 +41,8 @@ function filterContentOwner($list) {
$static = $pages->getStaticDB(true);
$sticky = $pages->getStickyDB(true);

// If the user is an Editor filter the content he/she can edit
if (checkRole(array('editor'), false)) {
// If the user is an Author filter the content he/she can edit
if (checkRole(array('author'), false)) {
$published = filterContentOwner($published);
$drafts = filterContentOwner($drafts);
$scheduled = filterContentOwner($scheduled);
Expand Down
2 changes: 1 addition & 1 deletion bl-kernel/admin/controllers/edit-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Check role
// ============================================================================

if (checkRole(array('editor'), false)) {
if (checkRole(array('author'), false)) {
try {
$pageKey = isset($_POST['key']) ? $_POST['key'] : $layout['parameters'];
$page = new Page($pageKey);
Expand Down
2 changes: 1 addition & 1 deletion bl-kernel/admin/controllers/new-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Check role
// ============================================================================

checkRole(array('admin', 'editor'));
checkRole(array('admin', 'editor', 'author'));

// ============================================================================
// Functions
Expand Down
14 changes: 6 additions & 8 deletions bl-kernel/admin/themes/booty/html/sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,23 @@
</li>

<li class="nav-item">
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>"><span class="oi oi-dashboard"></span><?php $L->p('Dashboard') ?></a>
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>"><span class="fa fa-dashboard"></span><?php $L->p('Dashboard') ?></a>
</li>
<li class="nav-item">
<a class="nav-link" target="_blank" href="<?php echo HTML_PATH_ROOT ?>"><span class="oi oi-external-link"></span><?php $L->p('Website') ?></a>
<a class="nav-link" target="_blank" href="<?php echo HTML_PATH_ROOT ?>"><span class="fa fa-external-link"></span><?php $L->p('Website') ?></a>
</li>

<li class="nav-item mt-3">
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'new-content' ?>"><span style="color: #0078D4;" class="oi oi-plus"></span><?php $L->p('New content') ?></a>
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'new-content' ?>"><span style="color: #0078D4;" class="fa fa-plus"></span><?php $L->p('New content') ?></a>
</li>

<?php if (checkRole(array('editor'),false)): ?>
<li class="nav-item">
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'content' ?>"><span class="oi oi-layers"></span><?php $L->p('Content') ?></a>
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'content' ?>"><span class="fa fa-layers"></span><?php $L->p('Content') ?></a>
</li>

<li class="nav-item">
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$login->username() ?>"><span class="oi oi-person"></span><?php $L->p('Profile') ?></a>
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$login->username() ?>"><span class="fa fa-person"></span><?php $L->p('Profile') ?></a>
</li>
<?php endif; ?>

<?php if (checkRole(array('admin'),false)): ?>

Expand Down Expand Up @@ -76,6 +74,6 @@
<?php endif; ?>

<li class="nav-item mt-5">
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'logout' ?>"><span class="oi oi-account-logout"></span><?php $L->p('Logout') ?></a>
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'logout' ?>"><span class="fa fa-account-logout"></span><?php $L->p('Logout') ?></a>
</li>
</ul>
4 changes: 2 additions & 2 deletions bl-kernel/admin/views/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function table($type) {

<!-- First button -->
<li class="page-item <?php if (!Paginator::showPrev()) echo 'disabled' ?>">
<a class="page-link" href="<?php echo Paginator::firstPageUrl() ?>"><span class="align-middle oi oi-media-skip-backward"></span> <?php echo $L->get('First'); ?></a>
<a class="page-link" href="<?php echo Paginator::firstPageUrl() ?>"><span class="align-middle fa fa-media-skip-backward"></span> <?php echo $L->get('First'); ?></a>
</li>

<!-- Previous button -->
Expand All @@ -210,7 +210,7 @@ function table($type) {

<!-- Last button -->
<li class="page-item <?php if (!Paginator::showNext()) echo 'disabled' ?>">
<a class="page-link" href="<?php echo Paginator::lastPageUrl() ?>"><?php echo $L->get('Last'); ?> <span class="align-middle oi oi-media-skip-forward"></span></a>
<a class="page-link" href="<?php echo Paginator::lastPageUrl() ?>"><?php echo $L->get('Last'); ?> <span class="align-middle fa fa-media-skip-forward"></span></a>
</li>

</ul>
Expand Down
4 changes: 2 additions & 2 deletions bl-kernel/admin/views/edit-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
<!-- TOOLBAR -->
<div id="jseditorToolbar">
<div id="jseditorToolbarRight" class="btn-group btn-group-sm float-right" role="group" aria-label="Toolbar right">
<button type="button" class="btn btn-light" id="jsmediaManagerOpenModal" data-toggle="modal" data-target="#jsmediaManagerModal"><span class="oi oi-image"></span> <?php $L->p('Images') ?></button>
<button type="button" class="btn btn-light" id="jsoptionsSidebar" style="z-index:30"><span class="oi oi-cog"></span> <?php $L->p('Options') ?></button>
<button type="button" class="btn btn-light" id="jsmediaManagerOpenModal" data-toggle="modal" data-target="#jsmediaManagerModal"><span class="fa fa-image"></span> <?php $L->p('Images') ?></button>
<button type="button" class="btn btn-light" id="jsoptionsSidebar" style="z-index:30"><span class="fa fa-cog"></span> <?php $L->p('Options') ?></button>
</div>

<div id="jseditorToolbarLeft">
Expand Down
2 changes: 1 addition & 1 deletion bl-kernel/admin/views/edit-user.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
echo Bootstrap::formSelect(array(
'name'=>'role',
'label'=>$L->g('Role'),
'options'=>array('editor'=>$L->g('Editor'), 'admin'=>$L->g('Administrator')),
'options'=>array('author'=>$L->g('Author'), 'editor'=>$L->g('Editor'), 'admin'=>$L->g('Administrator')),
'selected'=>$user->role(),
'class'=>'',
'tip'=>''
Expand Down
4 changes: 2 additions & 2 deletions bl-kernel/admin/views/new-user.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
echo Bootstrap::formSelect(array(
'name'=>'role',
'label'=>$L->g('Role'),
'options'=>array('editor'=>$L->g('Editor'), 'admin'=>$L->g('Administrator')),
'selected'=>'Editor',
'options'=>array('author'=>$L->g('Author'), 'editor'=>$L->g('Editor'), 'admin'=>$L->g('Administrator')),
'selected'=>'Author',
'class'=>'',
'tip'=>''
));
Expand Down
2 changes: 1 addition & 1 deletion bl-kernel/users.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Users extends dbJSON {
'lastName'=>'',
'nickname'=>'',
'description'=>'',
'role'=>'editor', // admin, editor
'role'=>'author', // admin, editor, author
'password'=>'',
'salt'=>'!Pink Floyd!Welcome to the machine!',
'email'=>'',
Expand Down

0 comments on commit fc2387b

Please sign in to comment.