From 55b8d42b6422f24196078c8adb6a2a59861d0ef4 Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 28 Jan 2010 13:45:42 +0000 Subject: Lazy load on modules. --- utils/modules/discography.php | 2 ++ utils/modules/events.php | 2 ++ utils/modules/gallery.php | 2 ++ utils/modules/guestbook.php | 3 +++ utils/modules/icons.php | 3 +++ utils/modules/members.php | 2 ++ utils/modules/news.php | 35 ++++++++++++++++++++++++----------- utils/modules/pages.php | 14 +++----------- 8 files changed, 41 insertions(+), 22 deletions(-) (limited to 'utils/modules') diff --git a/utils/modules/discography.php b/utils/modules/discography.php index 478fdc0..fe5a353 100644 --- a/utils/modules/discography.php +++ b/utils/modules/discography.php @@ -1,6 +1,8 @@ \n"; $str .= "
" . htmlspecialchars_decode($this->title, ENT_QUOTES) . "
\n"; - $str .= "
" . date("D M jS Y G:i", $this->time) . "
\n"; - $str .= "
By: " . $users->findUser($this->userid)->userid . "
\n"; + $str .= "
" . + date("D M jS Y G:i", $this->time) . "
\n"; + $str .= "
By: " . + $users->findUser($this->userid)->userid . "
\n"; $str .= "
\n"; - if($this->icon) $str .= " \"icon\"prefix.$icon->file . "\"/>\n"; + if($this->icon) $str .= " \"icon\"prefix.$icon->file . "\"/>\n"; $str .= " ".$content. "\n"; $str .= "
\n"; $str .= "\n"; @@ -56,7 +61,8 @@ class NewsEntry { return $this->title; } - public function NewsEntry($title, $time, $category, $description, $userid, $icon) + public function NewsEntry($title, $time, $category, + $description, $userid, $icon) { $this->title = $title; $this->time = $time; @@ -84,16 +90,20 @@ class News { switch($action) { case "add": - $n = new NewsEntry($vars["title"], DateTimeEdit::toTimestamp($vars, "time"), - $vars["category"], $vars["description"], $UID, $vars["icon"]); + $n = new NewsEntry($vars["title"], + DateTimeEdit::toTimestamp($vars, "time"), + $vars["category"], $vars["description"], + $UID, $vars["icon"]); echo "\"" .$n->title . "\" has now been added."; $this->add($n); $this->write(); break; case "preview": - $n = new NewsEntry($vars["title"], DateTimeEdit::toTimestamp($vars, "time"), - $vars["category"], $vars["description"], $UID, $vars["icon"]); + $n = new NewsEntry($vars["title"], + DateTimeEdit::toTimestamp($vars, "time"), + $vars["category"], $vars["description"], + $UID, $vars["icon"]); echo "
\n"; echo "
\n"; echo $n->show(); @@ -120,9 +130,11 @@ class News { $form = new Form("preview"); $form->addWidget(new LineEdit("Title", "title", $title)); $form->addWidget(new DateTimeEdit("Time", "time", $time)); - $form->addWidget(new ComboBox("Category", "category", $category, array("Main" => "main", "Site" => "site"))); + $form->addWidget(new ComboBox("Category", "category", $category, + array("Main" => "main", "Site" => "site"))); $form->addWidget(new TextEdit("Description", "description", $description)); - $form->addWidget(new ImageComboBox("Icon", "icon", $icon, new Icons($ICONS_DIR."/"))); + $form->addWidget(new ImageComboBox("Icon", "icon", $icon, + new Icons($ICONS_DIR."/"))); $form->addWidget(new Button("Post news")); $form->render(); break; @@ -146,7 +158,8 @@ class News { break; case "preview": - $n = new NewsEntry($vars["title"], DatetimeEdit::toTimestamp($vars, "time"), $vars["category"], $vars["description"], $UID, $vars["icon"]); + $n = new NewsEntry($vars["title"], DatetimeEdit::toTimestamp($vars, "time"), + $vars["category"], $vars["description"], $UID, $vars["icon"]); echo "
\n"; echo "
\n"; echo $n->show(); diff --git a/utils/modules/pages.php b/utils/modules/pages.php index 99c8142..d3ee0aa 100644 --- a/utils/modules/pages.php +++ b/utils/modules/pages.php @@ -1,6 +1,8 @@ run($params); - } else { - $modulestr = "

CMS ERROR: Could not find module: [[" . $modulecode . "]]

"; - } - - $str = str_replace("[[" . $modulecode . "]]", $modulestr, $str); - + $str = str_replace("[[" . $modulecode . "]]", runModule($modulecode), $str); } } -- cgit v1.2.3