135 public static function handleEvent($a_event,
ilWikiPage $a_page_obj, $a_user_id = null, array $a_additional_data = null)
141 $a_user_id = $ilUser->getId();
143 if(!$a_user_id || $a_user_id == ANONYMOUS_USER_ID)
148 switch((
int)$a_event)
150 case self::EVENT_PAGE_CREATED:
154 case self::EVENT_PAGE_UPDATED:
158 case self::EVENT_PAGE_READ:
162 case self::EVENT_PAGE_DELETED:
166 case self::EVENT_PAGE_RATING:
182 return date(
"Y-m-d H:00:00");
195 protected static function writeData($a_table, array $a_primary, array $a_values)
200 $a_primary[
"ts"] = array(
"timestamp", $tstamp);
202 $ilDB->lockTables(array(0 => array(
'name' => $a_table,
'type' =>
ilDB::LOCK_WRITE)));
205 foreach($a_primary as $column => $value)
207 $primary[] = $column.
" = ".$ilDB->quote($value[1], $value[0]);
209 $primary = implode(
" AND ", $primary);
211 $set = $ilDB->query(
"SELECT ts FROM ".$a_table.
214 $is_update = (bool)$ilDB->numRows($set);
220 foreach($a_values as $column => $value)
222 if($value[0] ==
"increment")
224 $values[] = $column.
" = ".$column.
"+1";
226 else if($value[0] ==
"decrement")
228 $values[] = $column.
" = ".$column.
"-1";
232 $values[] = $column.
" = ".$ilDB->quote($value[1], $value[0]);
235 $values = implode(
", ", $values);
237 $sql =
"UPDATE ".$a_table.
244 $a_values = array_merge($a_primary, $a_values);
245 $a_values[
"ts_day"] = array(
"text", substr($tstamp, 0, 10));
246 $a_values[
"ts_hour"] = array(
"integer", (
int)substr($tstamp, 11, 2));
249 foreach($a_values as $column => $value)
252 if($value[0] ==
"increment")
254 $value[0] =
"integer";
256 else if($value[0] ==
"decrement")
258 $value[0] =
"integer";
261 $values[] = $ilDB->quote($value[1], $value[0]);
263 $values = implode(
", ", $values);
266 $sql =
"INSERT INTO ".$a_table.
268 " VALUES (".$values.
")";
270 $ilDB->manipulate($sql);
272 $ilDB->unlockTables();
283 protected static function writeStat($a_wiki_id, $a_values)
286 "wiki_id" => array(
"integer", $a_wiki_id)
301 "wiki_id" => array(
"integer", $a_wiki_id),
302 "page_id" => array(
"integer", $a_page_id),
318 "wiki_id" => array(
"integer", $a_wiki_id),
319 "page_id" => array(
"integer", $a_page_id),
320 "user_id" => array(
"integer", $a_user_id)
335 "wiki_id" => array(
"integer", $a_wiki_id),
336 "user_id" => array(
"integer", $a_user_id)
361 include_once
"Services/Rating/classes/class.ilRating.php";
390 "num_pages" => array(
"integer", self::countPages($a_page_obj->
getWikiId()))
396 "new_pages" => array(
"increment", 1)
412 "changes" => array(
"increment", 1)
417 "int_links" => array(
"integer", $a_page_data[
"int_links"]),
418 "ext_links" => array(
"integer", $a_page_data[
"ext_links"]),
419 "footnotes" => array(
"integer", $a_page_data[
"footnotes"]),
420 "num_words" => array(
"integer", $a_page_data[
"num_words"]),
421 "num_chars" => array(
"integer", $a_page_data[
"num_chars"])
437 "read_events" => array(
"increment", 1)
453 " FROM wiki_stat_page".
454 " WHERE wiki_id = ".$ilDB->quote($a_page_obj->
getWikiId(),
"integer").
455 " AND page_id = ".$ilDB->quote($a_page_obj->
getId(),
"integer");
458 $set = $ilDB->query($sql);
461 if($ilDB->numRows($set))
463 $data = $ilDB->fetchAssoc($set);
467 "int_links" => array(
"integer", $data[
"int_links"]),
468 "ext_links" => array(
"integer", $data[
"ext_links"]),
469 "footnotes" => array(
"integer", $data[
"footnotes"]),
470 "num_words" => array(
"integer", $data[
"num_words"]),
471 "num_chars" => array(
"integer", $data[
"num_chars"]),
472 "num_ratings" => array(
"integer", $data[
"num_ratings"]),
473 "avg_rating" => array(
"integer", $data[
"avg_rating"]),
479 $ilDB->manipulate(
"UPDATE wiki_stat_page".
480 " SET deleted = ".$ilDB->quote(1,
"integer").
481 " WHERE page_id = ".$ilDB->quote($a_page_obj->
getId(),
"integer").
482 " AND wiki_id = ".$ilDB->quote($a_page_obj->
getWikiId(),
"integer"));
488 "del_pages" => array(
"increment", 1),
489 "num_pages" => array(
"integer", self::countPages($a_page_obj->
getWikiId())),
490 "avg_rating" => array(
"integer", $rating[
"avg"]*100)
508 "num_ratings" => array(
"integer", $rating[
"cnt"]),
509 "avg_rating" => array(
"integer", $rating[
"avg"]*100),
517 "avg_rating" => array(
"integer", $rating[
"avg"]*100)
525 "num_pages" => array(
"integer", self::countPages($a_page_obj->
getWikiId()))
535 protected static function getWikiAggr($a_wiki_id, $a_day_from, $a_day_to, $a_table, $a_field, $a_aggr_value, $a_sub_field = null, $a_sub_id = null, $a_build_full_period =
false)
542 $sql =
"SELECT ts_day, ".sprintf($a_aggr_value, $a_field).
" ".$a_field;
543 if($a_table ==
"wiki_stat_page" && $a_sub_field)
545 $sql .=
", MAX(deleted) deleted";
547 $sql .=
" FROM ".$a_table.
548 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id,
"integer").
549 " AND ts_day >= ".$ilDB->quote($a_day_from,
"text").
550 " AND ts_day <= ".$ilDB->quote($a_day_to,
"text");
551 if(!$a_build_full_period)
554 $sql .=
" AND ".$a_field.
" > ".$ilDB->quote(0,
"integer").
555 " AND ".$a_field.
" IS NOT NULL";
559 $sql .=
" AND ".$a_sub_field.
" = ".$ilDB->quote($a_sub_id,
"integer");
561 $sql .=
" GROUP BY ts_day".
563 $set = $ilDB->query($sql);
564 while(
$row = $ilDB->fetchAssoc($set))
566 $res[
$row[
"ts_day"]] = $row[$a_field];
568 $deleted = max($row[
"deleted"], $deleted);
571 if($a_build_full_period)
573 $period_first = $a_day_from;
574 $period_last = $a_day_to;
577 if($a_table ==
"wiki_stat_page" && $a_sub_field && $deleted)
579 $sql =
"SELECT MAX(ts_day) last_day, MIN(ts_day) first_day".
581 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id,
"integer").
582 " AND ".$a_sub_field.
" = ".$ilDB->quote($a_sub_id,
"integer");
583 $set = $ilDB->query($sql);
584 $row = $ilDB->fetchAssoc($set);
585 $last_day =
$row[
"last_day"];
586 if($last_day < $period_last)
588 $period_last = $last_day;
590 $first_day =
$row[
"first_day"];
591 if($first_day > $period_first)
593 $period_first = $first_day;
597 $last_before_period = null;
598 if(!
$res[$a_day_from])
600 $last_before_period =
self::getWikiLast($a_wiki_id, $a_day_from, $a_table, $a_field, $a_sub_field, $a_sub_id);
610 protected static function getWikiLast($a_wiki_id, $a_day_from, $a_table, $a_field, $a_sub_field = null, $a_sub_id = null)
615 $sql =
"SELECT MAX(".$a_field.
") latest".
617 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id,
"integer").
618 " AND ts_day < ".$ilDB->quote($a_day_from,
"text");
621 $sql .=
" AND ".$a_sub_field.
" = ".$ilDB->quote($a_sub_id,
"integer");
623 $sql .=
" GROUP BY ts_day".
624 " ORDER BY ts_day DESC";
626 $set = $ilDB->query($sql);
627 $last_before_period = $ilDB->fetchAssoc($set);
628 return $last_before_period[
"latest"];
631 protected static function getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to, $a_table, $a_field, $a_aggr_by, $a_aggr_value, $a_aggr_sub, $a_sub_field = null, $a_sub_id = null, $a_build_full_period =
false)
637 if(!$a_build_full_period)
639 $sql =
"SELECT ts_day, ".sprintf($a_aggr_value, $a_field).
" ".$a_field.
642 " SELECT ts_day, ".sprintf($a_aggr_sub, $a_field).
" ".$a_field.
644 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id,
"integer").
645 " AND ts_day >= ".$ilDB->quote($a_day_from,
"text").
646 " AND ts_day <= ".$ilDB->quote($a_day_to,
"text").
647 " AND ".$a_field.
" > ".$ilDB->quote(0,
"integer").
648 " AND ".$a_field.
" IS NOT NULL";
651 $sql .=
" AND ".$a_sub_field.
" = ".$ilDB->quote($a_sub_id,
"integer");
653 $sql .=
" GROUP BY ts_day, ".$a_aggr_by.
657 $set = $ilDB->query($sql);
658 while(
$row = $ilDB->fetchAssoc($set))
660 $res[
$row[
"ts_day"]] = $row[$a_field];
665 $tmp = $all_aggr_ids = $deleted_in_period = $first_day_in_period = array();
667 if($a_table !=
"wiki_stat_page")
669 echo
"can only build full period averages for wiki_stat_page";
676 " SELECT ".$a_aggr_by.
", MAX(deleted) deleted, MAX(ts_day) last_day, MIN(ts_day) first_day".
678 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id,
"integer").
679 " GROUP BY ".$a_aggr_by.
681 " WHERE first_day <= ".$ilDB->quote($a_day_to,
"text").
682 " AND (last_day >= ".$ilDB->quote($a_day_from,
"text").
683 " OR deleted = ".$ilDB->quote(0,
"integer").
")";
684 $set = $ilDB->query($sql);
685 while(
$row = $ilDB->fetchAssoc($set))
687 $all_aggr_ids[] =
$row[$a_aggr_by];
690 if(
$row[
"deleted"] &&
$row[
"last_day"] < $a_day_to)
692 $deleted_in_period[
$row[$a_aggr_by]] = $row[
"last_day"];
695 if(
$row[
"first_day"] > $a_day_from)
697 $first_day_in_period[
$row[$a_aggr_by]] = $row[
"first_day"];
702 $sql =
" SELECT ts_day, ".$a_aggr_by.
", ".sprintf($a_aggr_sub, $a_field).
" ".$a_field.
704 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id,
"integer").
705 " AND ts_day >= ".$ilDB->quote($a_day_from,
"text").
706 " AND ts_day <= ".$ilDB->quote($a_day_to,
"text");
707 $sql .=
" GROUP BY ts_day, ".$a_aggr_by;
708 $set = $ilDB->query($sql);
709 while(
$row = $ilDB->fetchAssoc($set))
711 if(!in_array(
$row[$a_aggr_by], $all_aggr_ids))
713 var_dump(
"unexpected wiki_stat_page_entry",
$row);
715 $tmp[
$row[$a_aggr_by]][
$row[
"ts_day"]] = $row[$a_field];
719 foreach($all_aggr_ids as $aggr_by_id)
722 if(!is_array($tmp[$aggr_by_id]))
724 $tmp[$aggr_by_id] = array();
728 $last_before_period = null;
729 if(!$tmp[$aggr_by_id][$a_day_from])
731 $last_before_period =
self::getWikiLast($a_wiki_id, $a_day_from, $a_table, $a_field, $a_aggr_by, $aggr_by_id);
735 $first_period_day = isset($first_day_in_period[$aggr_by_id])
736 ? $first_day_in_period[$aggr_by_id]
740 $last_period_day = isset($deleted_in_period[$aggr_by_id])
741 ? $deleted_in_period[$aggr_by_id]
748 foreach($tmp[$aggr_by_id] as $day => $value)
750 $res[$day][$aggr_by_id] = $value;
755 foreach(
$res as $day => $values)
757 switch($a_aggr_value)
760 $res[$day] = array_sum($values)/
sizeof($values);
764 $res[$day] = array_sum($values);
768 var_dump(
"unsupport aggr ".$a_aggr_value);
777 protected static function buildFullPeriodData(array &$a_res, $a_day_from, $a_day_to, $a_last_before_period, $a_allow_zero =
false)
782 $today = date(
"Y-m-d");
783 $current = explode(
"-", $a_day_from);
784 $current = date(
"Y-m-d", mktime(0, 0, 1, $current[1], $current[2], $current[0]));
785 while($current <= $a_day_to &&
788 if(!isset($a_res[$current]))
790 if($current <= $today)
795 $a_res[$current] = $last;
798 else if($a_last_before_period || $a_allow_zero)
800 $a_res[$current] = $a_last_before_period;
806 $last = $a_res[$current];
809 $current = explode(
"-", $current);
810 $current = date(
"Y-m-d", mktime(0, 0, 1, $current[1], $current[2]+1, $current[0]));
821 return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat",
"num_pages",
"MAX(%s)", null, null,
true);
826 return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_user",
"new_pages",
"SUM(%s)");
831 return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_user",
"new_pages",
"user_id",
"AVG(%s)",
"SUM(%s)");
836 return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat",
"del_pages",
"SUM(%s)");
841 return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page_user",
"read_events",
"SUM(%s)");
850 $sql =
"SELECT ts_day, COUNT(DISTINCT(page_id)) num_changed_pages".
851 " FROM wiki_stat_page_user".
852 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id,
"integer").
853 " AND ts_day >= ".$ilDB->quote($a_day_from,
"text").
854 " AND ts_day <= ".$ilDB->quote($a_day_to,
"text").
855 " AND changes > ".$ilDB->quote(0,
"integer").
856 " AND changes IS NOT NULL".
859 $set = $ilDB->query($sql);
860 while(
$row = $ilDB->fetchAssoc($set))
862 $res[
$row[
"ts_day"]] = $row[
"num_changed_pages"];
874 $sql =
"SELECT ts_day, AVG(num_changed_pages) num_changed_pages".
877 " SELECT ts_day, COUNT(DISTINCT(page_id)) num_changed_pages".
878 " FROM wiki_stat_page_user".
879 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id,
"integer").
880 " AND ts_day >= ".$ilDB->quote($a_day_from,
"text").
881 " AND ts_day <= ".$ilDB->quote($a_day_to,
"text").
882 " AND changes > ".$ilDB->quote(0,
"integer").
883 " AND changes IS NOT NULL".
884 " GROUP BY ts_day, user_id".
888 $set = $ilDB->query($sql);
889 while(
$row = $ilDB->fetchAssoc($set))
891 $res[
$row[
"ts_day"]] = $row[
"num_changed_pages"];
897 protected static function getWikiUserEditPages($a_wiki_id, $a_day_from, $a_day_to, $a_sub_field = null, $a_sub_id = null)
903 $sql =
"SELECT ts_day, COUNT(DISTINCT(user_id)) num_changed_users".
904 " FROM wiki_stat_page_user".
905 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id,
"integer").
906 " AND ts_day >= ".$ilDB->quote($a_day_from,
"text").
907 " AND ts_day <= ".$ilDB->quote($a_day_to,
"text").
908 " AND changes > ".$ilDB->quote(0,
"integer").
909 " AND changes IS NOT NULL";
912 $sql .=
" AND ".$a_sub_field.
" = ".$ilDB->quote($a_sub_id,
"integer");
914 $sql .=
" GROUP BY ts_day".
916 $set = $ilDB->query($sql);
917 while(
$row = $ilDB->fetchAssoc($set))
919 $res[
$row[
"ts_day"]] = $row[
"num_changed_users"];
931 $sql =
"SELECT ts_day, AVG(num_changed_users) num_changed_users".
934 " SELECT ts_day, COUNT(DISTINCT(user_id)) num_changed_users".
935 " FROM wiki_stat_page_user".
936 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id,
"integer").
937 " AND ts_day >= ".$ilDB->quote($a_day_from,
"text").
938 " AND ts_day <= ".$ilDB->quote($a_day_to,
"text").
939 " AND changes > ".$ilDB->quote(0,
"integer").
940 " AND changes IS NOT NULL".
941 " GROUP BY ts_day, page_id".
945 $set = $ilDB->query($sql);
946 while(
$row = $ilDB->fetchAssoc($set))
948 $res[
$row[
"ts_day"]] = $row[
"num_changed_users"];
956 return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page",
"num_ratings",
"SUM(%s)");
961 return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page",
"num_ratings",
"page_id",
"AVG(%s)",
"SUM(%s)");
968 foreach(array_keys(
$res) as $day)
979 return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page",
"int_links",
"page_id",
"SUM(%s)",
"MAX(%s)", null, null,
true);
984 return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page",
"int_links",
"page_id",
"AVG(%s)",
"MAX(%s)", null, null,
true);
989 return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page",
"ext_links",
"page_id",
"SUM(%s)",
"MAX(%s)", null, null,
true);
994 return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page",
"ext_links",
"page_id",
"AVG(%s)",
"MAX(%s)", null, null,
true);
997 protected static function getWikiWords($a_wiki_id, $a_day_from, $a_day_to)
999 return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page",
"num_words",
"page_id",
"SUM(%s)",
"MAX(%s)", null, null,
true);
1004 return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page",
"num_words",
"page_id",
"AVG(%s)",
"MAX(%s)", null, null,
true);
1009 return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page",
"num_chars",
"page_id",
"SUM(%s)",
"MAX(%s)", null, null,
true);
1014 return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page",
"num_chars",
"page_id",
"AVG(%s)",
"MAX(%s)", null, null,
true);
1019 return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page",
"footnotes",
"page_id",
"SUM(%s)",
"MAX(%s)", null, null,
true);
1024 return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page",
"footnotes",
"page_id",
"AVG(%s)",
"MAX(%s)", null, null,
true);
1034 return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page_user",
"changes",
"SUM(%s)",
"page_id", $a_page_id);
1039 return self::getWikiAggrSub($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page_user",
"changes",
"user_id",
"AVG(%s)",
"SUM(%s)",
"page_id", $a_page_id);
1049 return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page_user",
"read_events",
"SUM(%s)",
"page_id", $a_page_id);
1054 return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page",
"int_links",
"MAX(%s)",
"page_id", $a_page_id,
true);
1059 return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page",
"ext_links",
"MAX(%s)",
"page_id", $a_page_id,
true);
1064 return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page",
"num_words",
"MAX(%s)",
"page_id", $a_page_id,
true);
1069 return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page",
"num_chars",
"MAX(%s)",
"page_id", $a_page_id,
true);
1074 return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page",
"footnotes",
"MAX(%s)",
"page_id", $a_page_id,
true);
1079 return self::getWikiAggr($a_wiki_id, $a_day_from, $a_day_to,
"wiki_stat_page",
"num_ratings",
"SUM(%s)",
"page_id", $a_page_id);
1094 $set = $ilDB->query(
"SELECT DISTINCT(SUBSTR(ts_day, 1, 7)) month".
1095 " FROM wiki_stat_page_user".
1096 " WHERE wiki_id = ".$ilDB->quote($a_wiki_id,
"integer").
1097 " AND ts_day IS NOT NULL");
1098 while(
$row = $ilDB->fetchAssoc($set))
1109 self::KEY_FIGURE_WIKI_NUM_PAGES
1110 ,self::KEY_FIGURE_WIKI_NEW_PAGES
1111 ,self::KEY_FIGURE_WIKI_NEW_PAGES_AVG
1112 ,self::KEY_FIGURE_WIKI_EDIT_PAGES
1113 ,self::KEY_FIGURE_WIKI_EDIT_PAGES_AVG
1114 ,self::KEY_FIGURE_WIKI_DELETED_PAGES
1115 ,self::KEY_FIGURE_WIKI_READ_PAGES
1116 ,self::KEY_FIGURE_WIKI_USER_EDIT_PAGES
1117 ,self::KEY_FIGURE_WIKI_USER_EDIT_PAGES_AVG
1118 ,self::KEY_FIGURE_WIKI_NUM_RATING
1119 ,self::KEY_FIGURE_WIKI_NUM_RATING_AVG
1120 ,self::KEY_FIGURE_WIKI_RATING_AVG
1121 ,self::KEY_FIGURE_WIKI_INTERNAL_LINKS
1122 ,self::KEY_FIGURE_WIKI_INTERNAL_LINKS_AVG
1123 ,self::KEY_FIGURE_WIKI_EXTERNAL_LINKS
1124 ,self::KEY_FIGURE_WIKI_EXTERNAL_LINKS_AVG
1125 ,self::KEY_FIGURE_WIKI_WORDS
1126 ,self::KEY_FIGURE_WIKI_WORDS_AVG
1127 ,self::KEY_FIGURE_WIKI_CHARS
1128 ,self::KEY_FIGURE_WIKI_CHARS_AVG
1129 ,self::KEY_FIGURE_WIKI_FOOTNOTES
1130 ,self::KEY_FIGURE_WIKI_FOOTNOTES_AVG
1137 self::KEY_FIGURE_WIKI_PAGE_CHANGES
1138 ,self::KEY_FIGURE_WIKI_PAGE_CHANGES_AVG
1139 ,self::KEY_FIGURE_WIKI_PAGE_USER_EDIT
1140 ,self::KEY_FIGURE_WIKI_PAGE_READ
1141 ,self::KEY_FIGURE_WIKI_PAGE_INTERNAL_LINKS
1142 ,self::KEY_FIGURE_WIKI_PAGE_EXTERNAL_LINKS
1143 ,self::KEY_FIGURE_WIKI_PAGE_WORDS
1144 ,self::KEY_FIGURE_WIKI_PAGE_CHARS
1145 ,self::KEY_FIGURE_WIKI_PAGE_FOOTNOTES
1146 ,self::KEY_FIGURE_WIKI_PAGE_RATINGS
1156 self::KEY_FIGURE_WIKI_NUM_PAGES => $lng->txt(
"wiki_stat_num_pages")
1157 ,self::KEY_FIGURE_WIKI_NEW_PAGES => $lng->txt(
"wiki_stat_new_pages")
1158 ,self::KEY_FIGURE_WIKI_NEW_PAGES_AVG => $lng->txt(
"wiki_stat_new_pages_avg")
1159 ,self::KEY_FIGURE_WIKI_EDIT_PAGES => $lng->txt(
"wiki_stat_edit_pages")
1160 ,self::KEY_FIGURE_WIKI_EDIT_PAGES_AVG => $lng->txt(
"wiki_stat_edit_pages_avg")
1161 ,self::KEY_FIGURE_WIKI_DELETED_PAGES => $lng->txt(
"wiki_stat_deleted_pages")
1162 ,self::KEY_FIGURE_WIKI_READ_PAGES => $lng->txt(
"wiki_stat_read_pages")
1163 ,self::KEY_FIGURE_WIKI_USER_EDIT_PAGES => $lng->txt(
"wiki_stat_user_edit_pages")
1164 ,self::KEY_FIGURE_WIKI_USER_EDIT_PAGES_AVG => $lng->txt(
"wiki_stat_user_edit_pages_avg")
1165 ,self::KEY_FIGURE_WIKI_NUM_RATING => $lng->txt(
"wiki_stat_num_rating")
1166 ,self::KEY_FIGURE_WIKI_NUM_RATING_AVG => $lng->txt(
"wiki_stat_num_rating_avg")
1167 ,self::KEY_FIGURE_WIKI_RATING_AVG => $lng->txt(
"wiki_stat_rating_avg")
1168 ,self::KEY_FIGURE_WIKI_INTERNAL_LINKS => $lng->txt(
"wiki_stat_internal_links")
1169 ,self::KEY_FIGURE_WIKI_INTERNAL_LINKS_AVG => $lng->txt(
"wiki_stat_internal_links_avg")
1170 ,self::KEY_FIGURE_WIKI_EXTERNAL_LINKS => $lng->txt(
"wiki_stat_external_links")
1171 ,self::KEY_FIGURE_WIKI_EXTERNAL_LINKS_AVG => $lng->txt(
"wiki_stat_external_links_avg")
1172 ,self::KEY_FIGURE_WIKI_WORDS => $lng->txt(
"wiki_stat_words")
1173 ,self::KEY_FIGURE_WIKI_WORDS_AVG => $lng->txt(
"wiki_stat_words_avg")
1174 ,self::KEY_FIGURE_WIKI_CHARS => $lng->txt(
"wiki_stat_chars")
1175 ,self::KEY_FIGURE_WIKI_CHARS_AVG => $lng->txt(
"wiki_stat_chars_avg")
1176 ,self::KEY_FIGURE_WIKI_FOOTNOTES => $lng->txt(
"wiki_stat_footnotes")
1177 ,self::KEY_FIGURE_WIKI_FOOTNOTES_AVG => $lng->txt(
"wiki_stat_footnotes_avg")
1179 ,self::KEY_FIGURE_WIKI_PAGE_CHANGES => $lng->txt(
"wiki_stat_page_changes")
1180 ,self::KEY_FIGURE_WIKI_PAGE_CHANGES_AVG => $lng->txt(
"wiki_stat_page_changes_avg")
1181 ,self::KEY_FIGURE_WIKI_PAGE_USER_EDIT => $lng->txt(
"wiki_stat_page_user_edit")
1182 ,self::KEY_FIGURE_WIKI_PAGE_READ => $lng->txt(
"wiki_stat_page_read")
1183 ,self::KEY_FIGURE_WIKI_PAGE_INTERNAL_LINKS => $lng->txt(
"wiki_stat_page_internal_links")
1184 ,self::KEY_FIGURE_WIKI_PAGE_EXTERNAL_LINKS => $lng->txt(
"wiki_stat_page_external_links")
1185 ,self::KEY_FIGURE_WIKI_PAGE_WORDS => $lng->txt(
"wiki_stat_page_words")
1186 ,self::KEY_FIGURE_WIKI_PAGE_CHARS => $lng->txt(
"wiki_stat_page_characters")
1187 ,self::KEY_FIGURE_WIKI_PAGE_FOOTNOTES => $lng->txt(
"wiki_stat_page_footnotes")
1188 ,self::KEY_FIGURE_WIKI_PAGE_RATINGS => $lng->txt(
"wiki_stat_page_ratings")
1191 return $map[$a_figure];
1198 case self::KEY_FIGURE_WIKI_NUM_PAGES:
1201 case self::KEY_FIGURE_WIKI_NEW_PAGES:
1204 case self::KEY_FIGURE_WIKI_NEW_PAGES_AVG:
1207 case self::KEY_FIGURE_WIKI_EDIT_PAGES:
1210 case self::KEY_FIGURE_WIKI_EDIT_PAGES_AVG:
1213 case self::KEY_FIGURE_WIKI_DELETED_PAGES:
1216 case self::KEY_FIGURE_WIKI_READ_PAGES:
1219 case self::KEY_FIGURE_WIKI_USER_EDIT_PAGES:
1222 case self::KEY_FIGURE_WIKI_USER_EDIT_PAGES_AVG:
1225 case self::KEY_FIGURE_WIKI_NUM_RATING:
1228 case self::KEY_FIGURE_WIKI_NUM_RATING_AVG:
1231 case self::KEY_FIGURE_WIKI_RATING_AVG:
1234 case self::KEY_FIGURE_WIKI_INTERNAL_LINKS:
1237 case self::KEY_FIGURE_WIKI_INTERNAL_LINKS_AVG:
1240 case self::KEY_FIGURE_WIKI_EXTERNAL_LINKS:
1243 case self::KEY_FIGURE_WIKI_EXTERNAL_LINKS_AVG:
1246 case self::KEY_FIGURE_WIKI_WORDS:
1249 case self::KEY_FIGURE_WIKI_WORDS_AVG:
1252 case self::KEY_FIGURE_WIKI_CHARS:
1255 case self::KEY_FIGURE_WIKI_CHARS_AVG:
1258 case self::KEY_FIGURE_WIKI_FOOTNOTES:
1261 case self::KEY_FIGURE_WIKI_FOOTNOTES_AVG:
1270 case self::KEY_FIGURE_WIKI_PAGE_CHANGES:
1273 case self::KEY_FIGURE_WIKI_PAGE_CHANGES_AVG:
1276 case self::KEY_FIGURE_WIKI_PAGE_USER_EDIT:
1279 case self::KEY_FIGURE_WIKI_PAGE_READ:
1282 case self::KEY_FIGURE_WIKI_PAGE_INTERNAL_LINKS:
1285 case self::KEY_FIGURE_WIKI_PAGE_EXTERNAL_LINKS:
1288 case self::KEY_FIGURE_WIKI_PAGE_FOOTNOTES:
1291 case self::KEY_FIGURE_WIKI_PAGE_WORDS:
1294 case self::KEY_FIGURE_WIKI_PAGE_CHARS:
1297 case self::KEY_FIGURE_WIKI_PAGE_RATINGS:
1306 foreach(self::getFigures() as $figure)
1318 foreach(self::getFiguresPage() as $figure)