Skip to content

Commit

Permalink
added option to enable/disable a toolbar icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Schulte committed Mar 20, 2011
1 parent cd87427 commit 8d8e34b
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 8 deletions.
19 changes: 17 additions & 2 deletions action.php
Expand Up @@ -19,7 +19,7 @@ function getInfo() {
return array(
'author' => 'Gina Häußge, Michael Klier, Esther Brunner',
'email' => 'dokuwiki@chimeric.de',
'date' => '2010-11-12',
'date' => '2011-03-20',
'name' => 'Tag Plugin (ping component)',
'desc' => 'Ping technorati when a new page is created',
'url' => 'http://www.dokuwiki.org/plugin:tag',
Expand All @@ -33,6 +33,7 @@ function register(&$contr) {
$contr->register_hook('IO_WIKIPAGE_WRITE', 'BEFORE', $this, 'ping', array());
$contr->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE', $this, '_handle_act', array());
$contr->register_hook('TPL_ACT_UNKNOWN', 'BEFORE', $this, '_handle_tpl_act', array());
if($this->getConf('toolbar_icon')) $contr->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_toolbar_button', array ());
}

/**
Expand Down Expand Up @@ -114,5 +115,19 @@ function _handle_tpl_act(&$event, $param) {
print '<div class="level1"><p>' . $lang['nothingfound'] . '</p></div>';
}
}

/**
* Inserts the tag toolbar button
*/
function insert_toolbar_button(&$event, $param) {
$event->data[] = array (
'type' => 'format',
'title' => $this->getLang('toolbar_icon'),
'icon' => '../../plugins/tag/images/tag-toolbar.png',
'open' => '{{tag>',
'close' => '}}'
);
}
}
// vim:ts=4:sw=4:et:enc=utf-8:

// vim:ts=4:sw=4:et:
3 changes: 2 additions & 1 deletion conf/default.php
Expand Up @@ -7,5 +7,6 @@
$conf['sortkey'] = 'title'; // sort key for topic lists
$conf['sortorder'] = 'ascending'; // ascending or descending
$conf['pagelist_flags'] = 'list'; // formatting options for the page list plugin
$conf['toolbar_icon'] = 0; // enables/disables the toolbar icon

//Setup VIM: ex: et ts=2 enc=utf-8 :
//Setup VIM: ex: et ts=2 :
3 changes: 2 additions & 1 deletion conf/metadata.php
Expand Up @@ -13,5 +13,6 @@
$meta['sortorder'] = array('multichoice',
'_choices' => array('ascending', 'descending'));
$meta['pagelist_flags'] = array('string');
$meta['toolbar_icon'] = array('onoff');

//Setup VIM: ex: et ts=2 enc=utf-8 :
//Setup VIM: ex: et ts=2 :
Binary file added images/tag-toolbar.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion lang/de/lang.php
Expand Up @@ -10,7 +10,8 @@
$lang['tags'] = 'Tags';
$lang['topic'] = 'Thema';
$lang['rebuildindex'] = 'Tagindex neu aufbauen';
$lang['toolbar_icon'] = 'Tag-Syntax einfügen';

$lang['missing_pagelistplugin'] = 'Ohne Pagelist Plugin können Themenlisten nicht angezeigt werden.';

//Setup VIM: ex: et ts=2 enc=utf-8 :
//Setup VIM: ex: et ts=2 :
1 change: 1 addition & 0 deletions lang/de/settings.php
Expand Up @@ -9,6 +9,7 @@
// for the configuration manager
$lang['namespace'] = 'Standard-Namensraum für Tags';
$lang['pingtechnorati'] = 'Technorati anpingen';
$lang['toolbar_icon'] = 'Toolbar-Symbol anzeigen (data/cache/* und den Browser-Cache löschen, wenn das Symbol nicht angezeigt wird)';

$lang['sortkey'] = 'Themenlisten sortieren nach:';
$lang['sortkey_o_cdate'] = 'Erstellungsdatum';
Expand Down
3 changes: 2 additions & 1 deletion lang/en/lang.php
Expand Up @@ -10,9 +10,10 @@
$lang['tags'] = 'Tags';
$lang['topic'] = 'Topic';
$lang['rebuildindex'] = 'Rebuild Tagindex';
$lang['toolbar_icon'] = 'Insert Tag-Syntax';

$lang['missing_pagelistplugin'] = 'The Pagelist Plugin must be installed for topic lists.';

$lang['menu'] = 'Tagindex Manager';

//Setup VIM: ex: et ts=2 enc=utf-8 :
//Setup VIM: ex: et ts=2 :
3 changes: 2 additions & 1 deletion lang/en/settings.php
Expand Up @@ -9,6 +9,7 @@
// for the configuration manager
$lang['namespace'] = 'Default namespace for tags';
$lang['pingtechnorati'] = 'Ping Technorati';
$lang['toolbar_icon'] = 'Show toolbar icon (clear data/cache/* and browser cache if it\'s not displayed)';

$lang['sortkey'] = 'sort topic lists by';
$lang['sortkey_o_cdate'] = 'creation date';
Expand All @@ -23,4 +24,4 @@

$lang['pagelist_flags'] = 'Formatting flags for the taglist (comma-separated, for available flags see the documentation of the pagelist plugin)';

//Setup VIM: ex: et ts=2 enc=utf-8 :
//Setup VIM: ex: et ts=2 :
2 changes: 1 addition & 1 deletion plugin.info.txt
@@ -1,7 +1,7 @@
base tag
author Gina Häussge, Christopher Smith, Michael Klier, Esther Brunner
email dokuwiki@chimeric.de
date 2010-11-12
date 2011-03-20
name tag plugin
desc tag wiki pages
url http://dokuwiki.org/plugin:tag

0 comments on commit 8d8e34b

Please sign in to comment.