'jaloma', 'layout'=>'5', 'header'=>'My JAlbums', 'width'=>'off', 'height'=>'off', 'simple_footer_lnks'=>'1', ); var $layoutmapping = array ( "Light"=>1, "Dark"=>2, "Blue"=>3, "Pink"=>4, "Green"=>5, "Brown"=>6, "light"=>1, "dark"=>2, "blue"=>3, "pink"=>4, "green"=>5, "brown"=>6, ); /** * 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'=>'jalbumbadge', 'desc'=>'Einfacher Zugriff auf das Badge von JAlbum-Net', 'url'=>'http://wiki.dokuwiki.org/plugin:jalbum' ); } /** * What kind of syntax are we? */ function getType() { return 'substition'; } function getSort() { return 999; } function connectTo($mode) { $this->Lexer->addSpecialPattern('', $mode, 'plugin_jalbum_jalbumbadge'); } function matchLength() { return strlen('matchLength(), -2)); $thumb = $this->_extract_params($match); return array ($thumb); } /** * Create output * */ function render($mode, & $renderer, $data) { global $conf; if ($mode == 'xhtml') { list ($param) = $data; if ( isset ($param['user'])) { $title = $param['header']; $user = $param['user']; $layout = $param['layout']; if (array_key_exists($layout,$this->layoutmapping)) { $layout = $this->layoutmapping[$layout]; } $width = $param['width']; $height = $param['height']; // echo $layout."
"; $simple_footer_lnks = $param['simple_footer_lnks']; // $txt .= '

'; $txt .= '

'; //Inhalt]]> $txt .= ''."\n". //.' ''."\n"; $txt .= '

'; // $txt .= '

'; // $txt .= '

'; $renderer->doc .= $txt; } else { return false; } } return true; } /** * extract parameters for jalbum from the parameter string * * @param string $str_params string of key="value" or key='value' pairs * @return array associative array of parameters key=>value */ function _extract_params($str_params) { $param = array (); preg_match_all('/(\w*)="(.*?)"/us', $str_params, $param, PREG_SET_ORDER); if (sizeof($param) == 0) { preg_match_all("/(\w*)='(.*?)'/us", $str_params, $param, PREG_SET_ORDER); } // parse match for instructions, break into key value pairs $thumb = $this->dflt; foreach ($param as $kvpair) { list ($match, $key, $val) = $kvpair; // $key = strtolower($key); if ( isset ($thumb[$key]))$thumb[$key] = $val; } return $thumb; } } // class ?>