Highlight active wiki in list in preparation for removing active wiki name from content section header to make room for page list viewer

This commit is contained in:
Andrew Manning 2016-11-17 05:58:26 -05:00
parent 154923ca7d
commit 20db8bbe2e
2 changed files with 14 additions and 2 deletions

View File

@ -941,8 +941,20 @@ function widget_wiki_list($arr) {
// Not the channel owner // Not the channel owner
$owner_acl = $x = array(); $owner_acl = $x = array();
} }
if(argc()>1) {
$activeWikiURLname = argv(2);
} else {
$activeWikiURLname = '';
}
logger($activeWikiURLname, LOGGER_DEBUG);
$wikis = wiki_list($channel, get_observer_hash()); $wikis = wiki_list($channel, get_observer_hash());
foreach($wikis['wikis'] as &$w) {
if($w['urlName'] === $activeWikiURLname) {
$w['active'] = true;
} else {
$w['active'] = false;
}
}
if ($wikis) { if ($wikis) {
return replace_macros(get_markup_template('wikilist.tpl'), array( return replace_macros(get_markup_template('wikilist.tpl'), array(
'$header' => t('Wiki List'), '$header' => t('Wiki List'),

View File

@ -3,7 +3,7 @@
<ul class="nav nav-pills nav-stacked"> <ul class="nav nav-pills nav-stacked">
{{if $wikis}} {{if $wikis}}
{{foreach $wikis as $wiki}} {{foreach $wikis as $wiki}}
<li>{{if $owner}}<a href="#" onclick="$('div[id^=\'edit-wiki-form-wrapper\']').hide(); $('div[id^=\'new-wiki-form-wrapper\']').hide(); openClose('edit-wiki-form-wrapper-{{$wiki.resource_id}}'); return false;" class="pull-right wikilist" title="{{$edit}}"><i class="fa fa-pencil"></i></a>{{/if}} <li {{if $wiki.active}}class="active"{{/if}}>{{if $owner}}<a href="#" onclick="$('div[id^=\'edit-wiki-form-wrapper\']').hide(); $('div[id^=\'new-wiki-form-wrapper\']').hide(); openClose('edit-wiki-form-wrapper-{{$wiki.resource_id}}'); return false;" class="pull-right wikilist" title="{{$edit}}"><i class="fa fa-pencil"></i></a>{{/if}}
<a href="#" onclick="wiki_download_wiki('{{$wiki.resource_id}}'); return false;" title="{{$download}}" class="pull-right wikilist"><i class="fa fa-download"></i></a> <a href="#" onclick="wiki_download_wiki('{{$wiki.resource_id}}'); return false;" title="{{$download}}" class="pull-right wikilist"><i class="fa fa-download"></i></a>
<a href="/wiki/{{$channel}}/{{$wiki.urlName}}/Home" title="{{$view}}">{{$wiki.title}}</a> <a href="/wiki/{{$channel}}/{{$wiki.urlName}}/Home" title="{{$view}}">{{$wiki.title}}</a>
{{if $owner}} {{if $owner}}