1<?php 2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project 3// 4// All Rights Reserved. See copyright.txt for details and a complete list of authors. 5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. 6// $Id $ 7 8function wikiplugin_pdfbookmark_info() 9{ 10 return [ 11 'name' => 'PluginPDF Bookmark', 12 'documentation' => 'PluginPDFBookmark', 13 'description' => tra('Manual bookmark entry for a PDF file'), 14 'tags' => [ 'advanced' ], 15 'iconname' => 'pdf', 16 'prefs' => [ 'wikiplugin_pdf' ], 17 'introduced' => 18, 18 'params' => [ 19 'content' => [ 20 'name' => tra('Bookmark Label'), 21 'description' => tra(''), 22 'tags' => ['advanced'], 23 'type' => 'text', 24 'default' => '' 25 ], 26 'level' => [ 27 'name' => tra('Bookmark level'), 28 'description' => tra(''), 29 'tags' => ['advanced'], 30 'type' => 'text', 31 'default' => '0', 32 'options' => [ 33 ['text' => '0','value' => '0'], 34 ['text' => '1','value' => '1'], 35 ['text' => '2','value' => '2'], 36 ], 37 ], 38 ] 39 ]; 40} 41function wikiplugin_pdfbookmark($data, $params) 42{ 43 if(strstr($_GET['display'],'pdf')=='') { 44 return; 45 } 46 $paramList = ''; 47 foreach ($params as $paramName => $param) { 48 $paramList .= $paramName . "='" . $param . "' "; 49 } 50 return "<bookmark " . $paramList . " />"; 51} 52