summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/template.php63
-rw-r--r--lib/plugins/extension/helper/gui.php4
-rw-r--r--lib/plugins/extension/helper/list.php1
-rw-r--r--lib/plugins/extension/lang/en/lang.php7
-rw-r--r--lib/plugins/extension/script.js21
-rw-r--r--lib/plugins/extension/style.less16
6 files changed, 104 insertions, 8 deletions
diff --git a/inc/template.php b/inc/template.php
index 3859065bc..fd8bff11a 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -1035,6 +1035,8 @@ function tpl_pageinfo($ret = false) {
* @return bool|string
*/
function tpl_pagetitle($id = null, $ret = false) {
+ global $ACT, $INPUT, $lang;
+
if(is_null($id)) {
global $ID;
$id = $ID;
@@ -1042,14 +1044,67 @@ function tpl_pagetitle($id = null, $ret = false) {
$name = $id;
if(useHeading('navigation')) {
- $title = p_get_first_heading($id);
- if($title) $name = $title;
+ $first_heading = p_get_first_heading($id);
+ if($first_heading) $name = $first_heading;
+ }
+
+ // default page title is the page name, modify with the current action
+ switch ($ACT) {
+ // admin functions
+ case 'admin' :
+ $page_title = $lang['btn_admin'];
+ // try to get the plugin name
+ // retrieve admin plugin name from $_REQUEST['page']
+ if (($page = $INPUT->str('page', '', true)) != '') {
+ $pluginlist = plugin_list('admin');
+ if (in_array($page, $pluginlist)) {
+ // attempt to load the plugin
+
+ if (($plugin = plugin_load('admin',$page)) !== null){
+ $plugin_title = $plugin->getMenuText();
+ $page_title = $plugin_title ? $plugin_title : $page;
+ }
+ }
+ }
+ break;
+
+ // user functions
+ case 'login' :
+ case 'profile' :
+ case 'register' :
+ case 'resendpwd' :
+ $page_title = $lang['btn_'.$ACT];
+ break;
+
+ // wiki functions
+ case 'search' :
+ case 'index' :
+ $page_title = $lang['btn_'.$ACT];
+ break;
+
+ // page functions
+ case 'edit' :
+ $page_title = "✎ ".$name;
+ break;
+
+ case 'revisions' :
+ $page_title = $name . ' - ' . $lang['btn_revs'];
+ break;
+
+ case 'backlink' :
+ case 'recent' :
+ case 'subscribe' :
+ $page_title = $name . ' - ' . $lang['btn_'.$ACT];
+ break;
+
+ default : // SHOW and anything else not included
+ $page_title = $name;
}
if($ret) {
- return hsc($name);
+ return hsc($page_title);
} else {
- print hsc($name);
+ print hsc($page_title);
return true;
}
}
diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php
index 3a0f0c589..4ec6fec85 100644
--- a/lib/plugins/extension/helper/gui.php
+++ b/lib/plugins/extension/helper/gui.php
@@ -144,11 +144,11 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin {
foreach($this->tabs as $tab) {
$url = $this->tabURL($tab);
if($this->currentTab() == $tab) {
- $class = 'class="active"';
+ $class = ' active';
} else {
$class = '';
}
- echo '<li '.$class.'><a href="'.$url.'">'.$this->getLang('tab_'.$tab).'</a></li>';
+ echo '<li class="'.$tab.$class.'"><a href="'.$url.'">'.$this->getLang('tab_'.$tab).'</a></li>';
}
echo '</ul>';
}
diff --git a/lib/plugins/extension/helper/list.php b/lib/plugins/extension/helper/list.php
index 8bcd00ec6..11aea1d0e 100644
--- a/lib/plugins/extension/helper/list.php
+++ b/lib/plugins/extension/helper/list.php
@@ -151,6 +151,7 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
if($extension->isInstalled()) {
$class.=' installed';
$class.= ($extension->isEnabled()) ? ' enabled':' disabled';
+ if($extension->updateAvailable()) $class .= ' updatable';
}
if(!$extension->canModify()) $class.= ' notselect';
if($extension->isProtected()) $class.= ' protected';
diff --git a/lib/plugins/extension/lang/en/lang.php b/lib/plugins/extension/lang/en/lang.php
index f545b6da3..79f643629 100644
--- a/lib/plugins/extension/lang/en/lang.php
+++ b/lib/plugins/extension/lang/en/lang.php
@@ -101,4 +101,9 @@ $lang['install_url'] = 'Install from URL:';
$lang['install_upload'] = 'Upload Extension:';
$lang['repo_error'] = 'The plugin repository could not be contacted. Make sure your server is allowed to contact www.dokuwiki.org and check your proxy settings.';
-$lang['nossl'] = 'Your PHP seems to miss SSL support. Downloading will not work for many DokuWiki extensions.'; \ No newline at end of file
+$lang['nossl'] = 'Your PHP seems to miss SSL support. Downloading will not work for many DokuWiki extensions.';
+
+$lang['js']['display_viewoptions'] = 'View Options:';
+$lang['js']['display_enabled'] = 'enabled';
+$lang['js']['display_disabled'] = 'disabled';
+$lang['js']['display_updatable'] = 'updatable';
diff --git a/lib/plugins/extension/script.js b/lib/plugins/extension/script.js
index fab88162d..bc1bf8b12 100644
--- a/lib/plugins/extension/script.js
+++ b/lib/plugins/extension/script.js
@@ -110,4 +110,23 @@ jQuery(function(){
);
});
-}); \ No newline at end of file
+ /**
+ Create section for enabling/disabling viewing options
+ */
+ if ( $extmgr.find('.plugins, .templates').hasClass('active') ) {
+ var $displayOpts = jQuery('<p>', { id: 'extension__viewoptions'} ).appendTo($extmgr.find( '.panelHeader' ));
+
+ $displayOpts.append(LANG.plugins.extension.display_viewoptions);
+
+ var displayOptionsHandler = function(){
+ jQuery('#extension__list').toggleClass( this.name );
+ };
+
+ jQuery(['enabled', 'disabled', 'updatable']).each(function(index, chkName){
+
+ var $label = jQuery( '<label></label>' ).appendTo($displayOpts);
+ jQuery( '<input />', { type: 'checkbox', name: chkName }).change(displayOptionsHandler).appendTo($label).click();
+ jQuery( '<span/>' ).append(LANG.plugins.extension['display_'+chkName]).appendTo($label);
+ });
+ }
+});
diff --git a/lib/plugins/extension/style.less b/lib/plugins/extension/style.less
index d20689099..38b2d65d0 100644
--- a/lib/plugins/extension/style.less
+++ b/lib/plugins/extension/style.less
@@ -281,6 +281,18 @@
* Enabled/Disabled overrides
*/
#extension__list {
+
+ .enabled, .disabled,
+ .updatable {
+ display: none;
+ }
+
+ &.enabled .enabled,
+ &.disabled .disabled,
+ &.updatable .updatable {
+ display: block;
+ }
+
.enabled div.screenshot span {
background: transparent url(images/enabled.png) no-repeat 2px 2px;
}
@@ -361,3 +373,7 @@
display: block;
width: 60%;
}
+
+#extension__viewoptions label {
+ margin-left: 1em;
+}