*/ if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/'); if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); require_once(DOKU_INC.'inc/search.php'); require_once(DOKU_INC.'inc/JpegMeta.php'); require_once(DOKU_PLUGIN.'syntax.php'); /** * All DokuWiki plugins to extend the parser/rendering mechanism * need to inherit from this class */ class syntax_plugin_jalbum_slideshow extends DokuWiki_Syntax_Plugin { /** * default parameters of the jalbum tag */ var $dflt = array( 'width' => 20, 'height' => 20, 'align' => 'top', 'albumdir' => 'off', 'albumtitle' => 'off' ); /** * return some info */ function getInfo(){ return array( 'author' => 'Juergen A.Lamers', 'email' => 'jaloma.ac@googlemail.com', 'date' => @file_get_contents(DOKU_PLUGIN . 'jalbum/VERSION'), 'name' => 'jalbum', 'desc' => 'Slideshow auf Thumbs von JALbum', 'url' => 'http://wiki.splitbrain.org/plugin:jalbum' ); } /** * What kind of syntax are we? */ function getType(){ return 'substition'; } function getPType(){ return 'stack'; } function getSort(){ return 305; } function connectTo($mode) { $this->Lexer->addSpecialPattern('~~jalbumshow.*?~~',$mode,'plugin_jalbum_slideshow'); } /** * Handle the match */ function handle($match, $state, $pos, &$handler){ $match = str_replace("~~",null,$match); $match = str_replace("jalbumshow",null,$match); list($junk, $num) = explode(':', $match, 2); $dirs = explode('|', $junk); return array($num,$dirs); } /** * Create output */ function render($mode, &$renderer, $data) { global $conf; if ($mode == 'xhtml') { list($num,$dirs) = $data; if (sizeof($dirs) == 0) { return true;} $jsscript =''."\n"; if (isset($this->getConf['target'])) { $target = 'target="'.$this->getConf['target'].'" '; } else { $target = ''; } $body = ''. '
'."\n". ''."\n". ''; $renderer->doc .= $jsscript; $renderer->doc .= $body; return true; } return false; } function _search($dir) { $files = array(); search($files,$this->getConf('albumdir'),'search_media',array(),$dir."/thumbs"); return $files; } }//class ?>