diff --git a/lib/plugins/popularity/admin.php b/lib/plugins/popularity/admin.php index deb8048f4e9c01be83f8601333dd0a6fb8abe2fd..bd2d090e105fb381d0bca28532b896e61081f763 100644 --- a/lib/plugins/popularity/admin.php +++ b/lib/plugins/popularity/admin.php @@ -13,7 +13,6 @@ if(!defined('DOKU_INC')) die(); * need to inherit from this class */ class admin_plugin_popularity extends DokuWiki_Admin_Plugin { - var $version; /** * @var helper_plugin_popularity @@ -23,9 +22,6 @@ class admin_plugin_popularity extends DokuWiki_Admin_Plugin { function admin_plugin_popularity(){ $this->helper = $this->loadHelper('popularity', false); - - $pluginInfo = $this->getInfo(); - $this->version = $pluginInfo['date']; } /** diff --git a/lib/plugins/popularity/helper.php b/lib/plugins/popularity/helper.php index 0e38bcb882d5ad2f16127ff944c8ebc80044407f..eacde06d00f7816c3a9de1da8d90f6a1f5b0dd7e 100644 --- a/lib/plugins/popularity/helper.php +++ b/lib/plugins/popularity/helper.php @@ -29,8 +29,6 @@ class helper_plugin_popularity extends Dokuwiki_Plugin { */ var $popularityLastSubmitFile; - var $version; - function helper_plugin_popularity(){ global $conf; @@ -39,6 +37,11 @@ class helper_plugin_popularity extends Dokuwiki_Plugin { $this->popularityLastSubmitFile = $conf['cachedir'].'/lastSubmitTime.txt'; } + /** + * Return methods of this helper + * + * @return array with methods description + */ function getMethods(){ $result = array(); $result[] = array( @@ -125,15 +128,17 @@ class helper_plugin_popularity extends Dokuwiki_Plugin { */ function _gather(){ global $conf; + /** @var $auth DokuWiki_Auth_Plugin */ global $auth; $data = array(); $phptime = ini_get('max_execution_time'); @set_time_limit(0); + $pluginInfo = $this->getInfo(); // version $data['anon_id'] = md5(auth_cookiesalt()); $data['version'] = getVersion(); - $data['popversion'] = $this->version; + $data['popversion'] = $pluginInfo['date']; $data['language'] = $conf['lang']; $data['now'] = time(); $data['popauto'] = (int) $this->isAutoSubmitEnabled(); @@ -245,6 +250,17 @@ class helper_plugin_popularity extends Dokuwiki_Plugin { return $data; } + /** + * Callback to search and count the content of directories in DokuWiki + * + * @param array &$data Reference to the result data structure + * @param string $base Base usually $conf['datadir'] + * @param string $file current file or directory relative to $base + * @param string $type Type either 'd' for directory or 'f' for file + * @param int $lvl Current recursion depht + * @param array $opts option array as given to search() + * @return bool + */ function _search_count(&$data,$base,$file,$type,$lvl,$opts){ // traverse if($type == 'd'){