summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-07-14 12:12:41 +0000
committerDries Buytaert <dries@buytaert.net>2001-07-14 12:12:41 +0000
commitb99d4d7a424bf52bc7a4e7908e1d0d1cfd0c7b87 (patch)
treec15103816ada4747acb83bdc3f3e861d25278f48 /includes
parente62e3417f7cbdbb1206f20f2f663b606a2b7b12a (diff)
downloadbrdo-b99d4d7a424bf52bc7a4e7908e1d0d1cfd0c7b87.tar.gz
brdo-b99d4d7a424bf52bc7a4e7908e1d0d1cfd0c7b87.tar.bz2
- theme system:
+ added $theme->images() - blog.module: + improved user-friendliness and rewrote most of the output routines + made quoted text /italic/ by default + integrated discussion system like it should + ... - marvin.theme: + small visual improvements
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc16
-rw-r--r--includes/module.inc4
-rw-r--r--includes/theme.inc4
3 files changed, 20 insertions, 4 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 8eca80048..aeb04a8ee 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -76,7 +76,9 @@ function check_query($text) {
}
function check_input($text) {
- foreach (module_list() as $module) $text = module_invoke($module, "filter", $text);
+ foreach (module_list() as $name) {
+ if (module_hook($name, "filter")) $text = module_invoke($name, "filter", $text);
+ }
return addslashes(stripslashes(substr($text, 0, variable_get("max_input_size", 10000))));
}
@@ -84,6 +86,10 @@ function check_output($text, $nl2br = 0) {
return ($text) ? ($nl2br ? nl2br(stripslashes($text)) : stripslashes($text)) : message_na();
}
+function format_info($body, $block) {
+ return "<table><tr><td><table align=\"right\" border=\"1\" width=\"180\"><tr><td>$block</td></tr></table>$body</td></tr></table>\n";
+}
+
function format_plural($count, $singular, $plural) {
return ($count == 1) ? "$count ". t($singular) : "$count ". t($plural);
}
@@ -252,7 +258,13 @@ function link_page() {
}
function link_node($node) {
- return module_invoke("node", "link", array("node", $node));
+ foreach (module_list() as $name) {
+ if (module_hook($name, "link")) {
+ $links = array_merge($links, module_invoke($name, "link", "node", $node));
+ }
+ }
+
+ return $links ? $links : array();
}
function timer_start() {
diff --git a/includes/module.inc b/includes/module.inc
index bca406068..475fe8370 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -11,9 +11,9 @@ function module_iterate($function, $argument = "") {
}
// invoke hook $hook of module $name with optional arguments:
-function module_invoke($name, $hook, $argument = 0) {
+function module_invoke($name, $hook, $a1 = 0, $a2 = 0) {
$function = $name ."_". $hook;
- return function_exists($function) ? $function($argument) : $argument;
+ return function_exists($function) ? $function($a1, $a2) : 0;
}
// return array of module names (includes lazy module loading):
diff --git a/includes/theme.inc b/includes/theme.inc
index e78f313c1..580de21b6 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -4,6 +4,10 @@ class BaseTheme {
function links($links, $delimiter = " | ") {
return implode($delimiter, $links);
}
+
+ function images($name) {
+ return $name;
+ }
}
function theme_init() {