Skip to content

Commit

Permalink
changes to pagetools-button
Browse files Browse the repository at this point in the history
  • Loading branch information
LMS235 committed Feb 26, 2015
1 parent 10a0eaa commit 3003568
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.txt
@@ -1,3 +1,7 @@
2015-02-26 Florian Lamml (info@florian-lamml.de)

* changes to the pagetools-button

2015-02-06 jaller94

* Valid Button for HTML5
Expand Down
28 changes: 14 additions & 14 deletions action.php
Expand Up @@ -35,24 +35,24 @@ function register($controller) {
* @param Doku_Event $event
* @param mixed $param not defined
*/
public function addbutton(&$event, $param) {
global $ID, $REV, $conf;
public function addbutton(Doku_Event $event, $param) {
global $ID, $REV;

if($this->getConf('showexportbutton') && $event->data['view'] == 'main') {
$params = array('do' => 'export_odt');
if($REV) $params['rev'] = $REV;

switch($conf['template']) {
case 'dokuwiki':
case 'arago':
$event->data['items']['export_odt'] =
'<li>'
.'<a href="'.wl($ID, $params).'" class="action export_odt" rel="nofollow" title="'.$this->getLang('export_odt_button').'">'
.'<span>'.$this->getLang('export_odt_button').'</span>'
.'</a>'
.'</li>';
break;
if($REV) {
$params['rev'] = $REV;
}

$event->data['items'] = array_slice($event->data['items'], 0, -1, true) +
array('export_odt' =>
'<li>'
. '<a href="' . wl($ID, $params) . '" class="action export_odt" rel="nofollow" title="' . $this->getLang('export_odt_button') . '">'
. '<span>' . $this->getLang('export_odt_button') . '</span>'
. '</a>'
. '</li>'
) +
array_slice($event->data['items'], -1, 1, true);
}
}

Expand Down

0 comments on commit 3003568

Please sign in to comment.