diff options
author | deva <deva> | 2010-01-28 14:11:14 +0000 |
---|---|---|
committer | deva <deva> | 2010-01-28 14:11:14 +0000 |
commit | 10267210927846619e39e76ac173d9295851b948 (patch) | |
tree | bf85343aa358b25b68ce953492689cbcebb37259 /utils/modules/news.php | |
parent | 55b8d42b6422f24196078c8adb6a2a59861d0ef4 (diff) |
Fix broken module loading in admin. New module parameter system.
Diffstat (limited to 'utils/modules/news.php')
-rw-r--r-- | utils/modules/news.php | 32 |
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) |