setupLocale ( ); } /** * return sort order for position in admin menu */ function getMenuSort ( ) { return 999; } /** * handle user request */ function handle ( ) { } /** * output appropriate html */ function _userList ( ) { global $auth; global $ID; $user_list = $auth->retrieveUsers ( ); echo ( '

getLang ( 'list' ) ) ).'">'.$this->getLang ( 'list' ).'

' ); ptln ( '

'.$this->getLang ( 'total' ).': '.count ( $user_list ).'

    ' ); foreach ( $user_list as $key => $value ) { $nick = $key; $name = $value['name']; $href = wl ( $ID ). ( strpos ( wl ( $ID ), '?' )?'&':'?' ).'do=admin&page='.$this->getPluginName ( ).'&user='.hsc ( $nick ); ptln ( '
  1. '.$nick.' - '.$name.'
  2. ' ); } ptln ( '
' ); } function _getChanges ( $user ) { global $conf; function globr ( $dir, $pattern ) { $files = glob ( $dir.'/'.$pattern ); $subdirs = glob ( $dir.'/*', GLOB_ONLYDIR ); /* Rework by bugmenot2 */ if ( !empty ( $subdirs ) ) { foreach ( $subdirs as $subdir ) { $subfiles = globr ( $subdir, $pattern ); if ( !empty ( $subfiles ) && !empty ( $files ) ) { $files = array_merge ( $files, $subfiles ); } } } return $files; } $changes = array ( ); $alllist = globr ( $conf['metadir'], '*.changes' ); $skip = array ( '_comments.changes', '_dokuwiki.changes' ); for ( $i = 0; $i < count ( $alllist ); $i++ ) { /* for all files */ $fullname = $alllist[$i]; $filepart = basename ( $fullname ); if ( in_array ( $filepart, $skip ) ) continue; $f = file ( $fullname ); for ( $j = 0; $j < count ( $f ); $j++ ) { /* for all lines */ $line = $f[$j]; $change = parseChangelogLine ( $line ); if ( strtolower ( $change['user'] ) == strtolower ( $user ) ) $changes[] = $change; } } function cmp ( $a, $b ) { $time1 = $a['date']; $time2 = $b['date']; if ( $time1 == $time2 ) { return 0; } return ( $time1 < $time2 ? 1 : -1 ); } uasort ( $changes, 'cmp' ); return $changes; } function _userHistory ( $user ) { global $conf; global $ID; global $lang; $href = wl ( $ID ). ( strpos ( wl ( $ID ), '?' )?'&':'?' ).'do=admin&page='.$this->getPluginName ( ); ptln ( '

['.$this->getLang('back').']

' ); ptln ( '

'.$user.'

' ); $changes = array_values ( $this->_getChanges ( $user ) ); ptln ( '

'.$this->getLang ( 'total' ).': '.count ( $changes ).'

    ' ); foreach ( $changes as $key => $change ) { if ( $key == 1000 ) { /* long list limiter */ break; }; $date = strftime ( $conf['dformat'], $change['date'] ); ptln ( $change['type'] === 'e' ? '
  1. ' : '
  2. ' ); ptln ( '
    '.$date.'' ); $p = array ( ); $p['src'] = DOKU_BASE.'lib/images/diff.png'; $p['title'] = $lang['diff']; $p['alt'] = $lang['diff']; $att = buildAttributes ( $p ); ptln ( '' ); $p['src'] = DOKU_BASE.'lib/images/history.png'; $p['title'] = $lang['btn_revs']; $p['alt'] = $lang['btn_revs']; $att = buildAttributes ( $p ); ptln ( ' ' ); ptln ( $change['id'].' – '.html_wikilink ( ':'.$change['id'], $conf['useheading'] ? NULL : $change['id'] ) ); if ( $change['sum'] != "" ) { ptln ( ' – '.hsc ( $change['sum'] ) ); }; ptln ( '
  3. ' ); } ptln ( '
' ); } function html ( ) { echo ( '

getLang ( 'menu' ) ) ).'">'.$this->getLang ( 'menu' ).'

' ); if ( isset ( $_REQUEST['user'] ) ) { $this->_userHistory ( $_REQUEST['user'] ); } else { $this->_userList ( ); } } }