Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion htdocs/modules/waiting/admin/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
include __DIR__ . '/header.php';

// Get main instance
$xoops = Xoops::getInstance();
$xoops = \Xoops::getInstance();


// Call header
Expand All @@ -34,6 +34,13 @@
$contents = array();
$plugins = Plugin::getPlugins('waiting');
foreach ($plugins as $dirName => $plugin) {

//No permissions, no links
$helper = \Xoops::getModuleHelper($dirName);
if (!$helper->isUserAdmin()) {
continue;
}

/* @var $plugin WaitingPluginInterface */
if (is_array($results = $plugin->waiting())) {
foreach ($results as $res) {
Expand Down
21 changes: 19 additions & 2 deletions htdocs/modules/waiting/blocks/waiting_waiting.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,28 @@ function b_waiting_waiting_show()
$block['waiting'] = array();
$plugins = Plugin::getPlugins('waiting');
/* @var $plugin WaitingPluginInterface */
foreach ($plugins as $plugin) {
foreach ($plugins as $dirName => $plugin) {

//No permissions, no links
$helper = \Xoops::getModuleHelper($dirName);
if (!$helper->isUserAdmin()) {
continue;
}

if (is_array($results = $plugin->waiting())) {
foreach ($results as $res) {
if (is_array($res) && isset($res['count']) && isset($res['name']) && isset($res['link'])) {
$res['icon'] = isset($res['icon']) ? $res['icon'] : 'glyphicon-time';
$ret['image'] = false;
//Image support
if (XoopsLoad::fileExists($helper->path('icons/logo_small.png'))) {
$res['image'] = $helper->url('icons/logo_small.png');
$res['icon'] = "$dirName-icon" ;
} else {
//Icon support
$res['icon'] = isset($res['icon']) ? $res['icon'] : 'glyphicon-time';
}

$res['dirName'] = $dirName;
$block['waiting'][] = $res;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
{if $block.count}
<style type="text/css">
{foreach item=item from=$block.waiting}
{if $item.image}
.{$item.dirName}-icon, .nav .active a .{$item.dirName}-icon {
background-image: url('{$item.image}');
background-position: 0 0;
width: 16px;
height: 16px;
line-height: 16px;
}
{/if}
{/foreach}
</style>
<ul class="nav nav-list">
{foreach item=item from=$block.waiting}
<li>
<a href="{$item.link}" title="{$item.name}">
<span class="glyphicon {$item.icon}"></span>
<i class="glyphicon {$item.icon}"></i>
{$item.name}&nbsp;:&nbsp;{$item.count}
</a>
</li>
Expand Down