Wiki pages display in tab to the left of the edit pane tab. Home is always first in the list.
This commit is contained in:
parent
f9b836027d
commit
d5c14a513d
@ -32,15 +32,18 @@ function wiki_page_list($resource_id) {
|
|||||||
return array('pages' => null, 'wiki' => null);
|
return array('pages' => null, 'wiki' => null);
|
||||||
}
|
}
|
||||||
$pages = array();
|
$pages = array();
|
||||||
|
$pages[] = array('title' => 'Home', 'url' => 'Home');
|
||||||
if (is_dir($w['path']) === true) {
|
if (is_dir($w['path']) === true) {
|
||||||
$files = array_diff(scandir($w['path']), array('.', '..', '.git'));
|
$files = array_diff(scandir($w['path']), array('.', '..', '.git'));
|
||||||
// TODO: Check that the files are all text files
|
// TODO: Check that the files are all text files
|
||||||
|
|
||||||
foreach($files as $file) {
|
foreach($files as $file) {
|
||||||
// strip the .md file extension and unwrap URL encoding to leave HTML encoded name
|
// strip the .md file extension and unwrap URL encoding to leave HTML encoded name
|
||||||
|
if( urldecode(substr($file, 0, -3)) !== 'Home') {
|
||||||
$pages[] = array('title' => urldecode(substr($file, 0, -3)), 'url' => urlencode(substr($file, 0, -3)));
|
$pages[] = array('title' => urldecode(substr($file, 0, -3)), 'url' => urlencode(substr($file, 0, -3)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return array('pages' => $pages, 'wiki' => $w);
|
return array('pages' => $pages, 'wiki' => $w);
|
||||||
}
|
}
|
||||||
|
@ -40,8 +40,8 @@
|
|||||||
<button id="fullscreen-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen();"><i class="fa fa-expand"></i></button>
|
<button id="fullscreen-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen();"><i class="fa fa-expand"></i></button>
|
||||||
<button id="inline-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen(false);"><i class="fa fa-compress"></i></button>
|
<button id="inline-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen(false);"><i class="fa fa-compress"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<h2><span id="wiki-header-name"><i class="fa fa-book"></i> {{$wikiheaderName}}</span>  :  
|
<h2><span id="wiki-header-name"><i class="fa fa-book"></i> <b>{{$wikiheaderName}}</b></span> : 
|
||||||
<span id="wiki-header-page"><i class="fa fa-file-text-o"></i> {{$wikiheaderPage}}</span>
|
<span id="wiki-header-page">{{$wikiheaderPage}}</span>
|
||||||
</h2>
|
</h2>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
@ -62,11 +62,11 @@
|
|||||||
<div id="wiki-content-container" class="section-content-wrapper" {{if $hideEditor}}style="display: none;"{{/if}}>
|
<div id="wiki-content-container" class="section-content-wrapper" {{if $hideEditor}}style="display: none;"{{/if}}>
|
||||||
|
|
||||||
<ul class="nav nav-tabs" id="wiki-nav-tabs">
|
<ul class="nav nav-tabs" id="wiki-nav-tabs">
|
||||||
|
<li id="wiki-header-page"><a data-toggle="tab" href="#pages-pane" id="wiki-show-page-list"><i class="fa fa-file-text-o" style="margin-right: 10px"></i>  Pages</a></li>
|
||||||
<li id="edit-pane-tab"><a data-toggle="tab" href="#edit-pane">Edit</a></li>
|
<li id="edit-pane-tab"><a data-toggle="tab" href="#edit-pane">Edit</a></li>
|
||||||
<li class="active"><a data-toggle="tab" href="#preview-pane" id="wiki-get-preview">View</a></li>
|
<li class="active"><a data-toggle="tab" href="#preview-pane" id="wiki-get-preview">View</a></li>
|
||||||
<li {{if $hidePageHistory}}style="display: none;"{{/if}}><a data-toggle="tab" href="#page-history-pane" id="wiki-get-history">History</a></li>
|
<li {{if $hidePageHistory}}style="display: none;"{{/if}}><a data-toggle="tab" href="#page-history-pane" id="wiki-get-history">History</a></li>
|
||||||
<li id="wiki-header-page"><a data-toggle="tab" href="#pages-pane" id="wiki-show-page-list"><i class="fa fa-file-text-o" style="margin-right: 10px"></i>  Pages</a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="tab-content" id="wiki-page-tabs">
|
<div class="tab-content" id="wiki-page-tabs">
|
||||||
@ -519,7 +519,7 @@
|
|||||||
wiki_refresh_page_list();
|
wiki_refresh_page_list();
|
||||||
$("#wiki-toc").toc({content: "#wiki-preview", headings: "h1,h2,h3,h4"});
|
$("#wiki-toc").toc({content: "#wiki-preview", headings: "h1,h2,h3,h4"});
|
||||||
// Show Edit tab first. Otherwise the Ace editor does not load.
|
// Show Edit tab first. Otherwise the Ace editor does not load.
|
||||||
$("#wiki-nav-tabs li:eq(1) a").tab('show');
|
$("#wiki-nav-tabs li:eq(2) a").tab('show');
|
||||||
{{if $showNewWikiButton}}
|
{{if $showNewWikiButton}}
|
||||||
$('#new-wiki-button').show();
|
$('#new-wiki-button').show();
|
||||||
{{else}}
|
{{else}}
|
||||||
|
Reference in New Issue
Block a user