*/ // must be run within DokuWiki if (!defined('DOKU_INC')) { die(); } if (!defined('DOKU_PLUGIN')) { define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/'); } require_once(DOKU_PLUGIN . 'preservefilenames/common.php'); require_once(DOKU_PLUGIN . 'preservefilenames/action_angua.php'); class action_plugin_preservefilenames_adorabelle extends action_plugin_preservefilenames_angua { // ------------------------------------------------------- // The following methods whose name starts with '_mod' are // slightly modified versions of existing functions. // ------------------------------------------------------- /** * Formats and prints one file in the list * * @see media_printfile() */ function _mod_media_printfile($item,$auth,$jump,$display_namespace=false){ global $lang; global $conf; // Prepare zebra coloring // I always wanted to use this variable name :-D static $twibble = 1; $twibble *= -1; $zebra = ($twibble == -1) ? 'odd' : 'even'; // Automatically jump to recent action if($jump == $item['id']) { $jump = ' id="scroll__here" '; }else{ $jump = ''; } // Prepare fileicons list($ext,$mime,$dl) = mimetype($item['file'],false); $class = preg_replace('/[^_\-a-z0-9]+/i','_',$ext); $class = 'select mediafile mf_'.$class; // Prepare filename $file = $this->_getOriginalFileName($item['id']); if ($file === false) { $file = utf8_decodeFN($item['file']); } // build fake media id $ns = getNS($item['id']); $fakeId = $ns === false ? $file : "$ns:$file"; $fakeId_escaped = hsc($fakeId); // Prepare info $info = ''; if($item['isimg']){ $info .= (int) $item['meta']->getField('File.Width'); $info .= '×'; $info .= (int) $item['meta']->getField('File.Height'); $info .= ' '; } $info .= ''.dformat($item['mtime']).''; $info .= ' '; $info .= filesize_h($item['size']); // output echo '
{{:'.str_replace(array('{','}'),array('(',')'),$fakeId_escaped).'}}
';
echo '