Permalink
Browse files

Added SVG icons for ODT and ODT=>PDF export

  • Loading branch information...
LarsGit223 committed Mar 31, 2018
1 parent 0a837b1 commit 023ad58cfea5615145ed5846e1179ea03a6c8701
Showing with 69 additions and 1 deletion.
  1. +1 −1 MenuItemODT.php
  2. +40 −0 MenuItemODTPDF.php
  3. +11 −0 action/export.php
  4. +9 −0 menu-odt-pdf.svg
  5. +8 −0 menu-odt.svg
View
@@ -17,7 +17,7 @@ class MenuItemODT extends AbstractItem {
protected $type = 'export_odt';
/** @var string icon file */
//protected $svg = __DIR__ . '/file-pdf.svg';
protected $svg = DOKU_INC . 'lib/plugins/odt/menu-odt.svg';
/**
* MenuItem constructor.
View
@@ -0,0 +1,40 @@
<?php
namespace dokuwiki\plugin\odt;
use dokuwiki\Menu\Item\AbstractItem;
/**
* Class MenuItemODT
*
* Implements the ODT export button for DokuWiki's menu system
*
* @package dokuwiki\plugin\odt
*/
class MenuItemODTPDF extends AbstractItem {
/** @var string do action for this plugin */
protected $type = 'export_odt_pdf';
/** @var string icon file */
protected $svg = DOKU_INC . 'lib/plugins/odt/menu-odt-pdf.svg';
/**
* MenuItem constructor.
*/
public function __construct() {
parent::__construct();
global $REV;
if($REV) $this->params['rev'] = $REV;
}
/**
* Get label from plugin language file
*
* @return string
*/
public function getLabel() {
$hlp = plugin_load('action', 'odt_export');
return $hlp->getLang('export_odt_pdf_button');
}
}
View
@@ -39,6 +39,7 @@ public function register(Doku_Event_Handler $controller) {
$controller->register_hook('TEMPLATE_PAGETOOLS_DISPLAY', 'BEFORE', $this, 'addbutton_odt', array());
$controller->register_hook('TEMPLATE_PAGETOOLS_DISPLAY', 'BEFORE', $this, 'addbutton_pdf', array());
$controller->register_hook('MENU_ITEMS_ASSEMBLY', 'AFTER', $this, 'addbutton_odt_new', array());
$controller->register_hook('MENU_ITEMS_ASSEMBLY', 'AFTER', $this, 'addbutton_pdf_new', array());
}
/**
@@ -105,6 +106,16 @@ public function addbutton_odt_new(Doku_Event $event) {
array_splice($event->data['items'], -1, 0, [new \dokuwiki\plugin\odt\MenuItemODT()]);
}
/**
* Add 'export odt pdf' button to page tools, new SVG based mechanism
*
* @param Doku_Event $event
*/
public function addbutton_pdf_new(Doku_Event $event) {
if($event->data['view'] != 'page') return;
array_splice($event->data['items'], -1, 0, [new \dokuwiki\plugin\odt\MenuItemODTPDF()]);
}
/***********************************************************************************
* Book export *
***********************************************************************************/
View
@@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M 0.77,0 L 10.06,0 C 10.06,0 10.28,0.1 10.58,0.1 L 19.35,8.25
C 19.35,8.25 19.41,8.75 19.61,9.03 L 19.61,23.22 C 19.61,23.22 19.3,24.13 18.58,24
L 0.77,24 C 0.77,24 0.35,23.85 0,23.22 L 0,0.77 C 0,0.77 0.35,0.15 0.77,0
M 2,2 L 2,22 L 17.61,22 L 17.61,9.7 L 10,2 z
M 13.93,0 L 18.83,0 C 18.83,0 19.3,-0.1 19.61,0.77 L 19.61,5.41
C 19.61,5.41 19.3,6 18.58,5.93 L 13.67,1.29 C 13.67,1.29 13.4,0.5 13.93,0 z"/>
<text x="3" y="15" font-size="7">PDF</text>
</svg>
View
@@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M 0.77,0 L 10.06,0 C 10.06,0 10.28,0.1 10.58,0.1 L 19.35,8.25
C 19.35,8.25 19.41,8.75 19.61,9.03 L 19.61,23.22 C 19.61,23.22 19.3,24.13 18.58,24
L 0.77,24 C 0.77,24 0.35,23.85 0,23.22 L 0,0.77 C 0,0.77 0.35,0.15 0.77,0
M 2,2 L 2,22 L 17.61,22 L 17.61,9.7 L 10,2 z
M 13.93,0 L 18.83,0 C 18.83,0 19.3,-0.1 19.61,0.77 L 19.61,5.41
C 19.61,5.41 19.3,6 18.58,5.93 L 13.67,1.29 C 13.67,1.29 13.4,0.5 13.93,0 z"/>
</svg>

0 comments on commit 023ad58

Please sign in to comment.