summaryrefslogtreecommitdiff
path: root/lib/plugins/popularity
diff options
context:
space:
mode:
authorChristopher Smith <chris@jalakai.co.uk>2013-10-19 18:24:57 +0100
committerChristopher Smith <chris@jalakai.co.uk>2013-10-19 18:24:57 +0100
commit4b94edc8e8badb6bcdc25b41f73310a8e323ba92 (patch)
tree135f4f9e4e4b37a18aad5ac23b618a023e4447bf /lib/plugins/popularity
parent698e7df8c9d5c43a93ed6822efa537158682a700 (diff)
parent9f5b9cf15569babaa90f0d6f3dd58cefd5439bc5 (diff)
downloadrpg-4b94edc8e8badb6bcdc25b41f73310a8e323ba92.tar.gz
rpg-4b94edc8e8badb6bcdc25b41f73310a8e323ba92.tar.bz2
Merge branch 'master' into FS#2867
Diffstat (limited to 'lib/plugins/popularity')
-rw-r--r--lib/plugins/popularity/admin.php4
-rw-r--r--lib/plugins/popularity/helper.php22
2 files changed, 19 insertions, 7 deletions
diff --git a/lib/plugins/popularity/admin.php b/lib/plugins/popularity/admin.php
index deb8048f4..bd2d090e1 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 0e38bcb88..eacde06d0 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'){