summaryrefslogtreecommitdiff
path: root/utils/modules/news.php
diff options
context:
space:
mode:
authordeva <deva>2010-01-28 14:11:14 +0000
committerdeva <deva>2010-01-28 14:11:14 +0000
commit10267210927846619e39e76ac173d9295851b948 (patch)
treebf85343aa358b25b68ce953492689cbcebb37259 /utils/modules/news.php
parent55b8d42b6422f24196078c8adb6a2a59861d0ef4 (diff)
Fix broken module loading in admin. New module parameter system.
Diffstat (limited to 'utils/modules/news.php')
-rw-r--r--utils/modules/news.php32
1 files changed, 25 insertions, 7 deletions
diff --git a/utils/modules/news.php b/utils/modules/news.php
index 75cb748..4d00b24 100644
--- a/utils/modules/news.php
+++ b/utils/modules/news.php
@@ -272,14 +272,32 @@ class News {
public function run($params)
{
- global $show;
+ $str = "";
+
+ $module = "all";
+ $number = -1;
+
+ foreach($params as $param => $value) {
+ switch($param) {
+ case "show":
+ $module = $value;
+ break;
+
+ case "number":
+ $number = $value;
+ break;
+
+ case "all":
+ default:
+ $module = "all";
+ $number = -1;
+ break;
+ }
+ }
- switch($params) {
- default:
- if($show == "all") return $this->show(-1, "all");
- else return $this->show(3, "main");
- break;
- }
+ $str .= $this->show($number, $module);
+
+ return $str;
}
public function show($number, $category)