summaryrefslogtreecommitdiff
path: root/modules/title.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-01-26 18:59:42 +0000
committerDries Buytaert <dries@buytaert.net>2004-01-26 18:59:42 +0000
commita2055ae9d9b28b011d4c8253eee7eaa4240b2f2a (patch)
tree996f40e675adc42f007f47cd2dea5e63e66e9bed /modules/title.module
parent68479ae77c1d14903a3ed9100339235407a59c31 (diff)
downloadbrdo-a2055ae9d9b28b011d4c8253eee7eaa4240b2f2a.tar.gz
brdo-a2055ae9d9b28b011d4c8253eee7eaa4240b2f2a.tar.bz2
- Patch 5395 by Goba: no need to have an 'enable' setting.
Diffstat (limited to 'modules/title.module')
-rw-r--r--modules/title.module18
1 files changed, 5 insertions, 13 deletions
diff --git a/modules/title.module b/modules/title.module
index e06fa36c0..45fe9e284 100644
--- a/modules/title.module
+++ b/modules/title.module
@@ -66,26 +66,18 @@ function title_page() {
// filter [node title|description] links. '|description' is optional.
function title_filter($text) {
- if (variable_get("title_filter_link", 0)) {
- $pattern = '\[([^\|\]]+)(?>\|?)(.*?)\]'; // $1 == title: matches at least 1 char up to the first '|' or ']'
+ $pattern = '\[([^\|\]]+)(?>\|?)(.*?)\]'; // $1 == title: matches at least 1 char up to the first '|' or ']'
// $2 == text: matches all after a following '|' (if there is) up to the next ']'. may include '|'s.
- $replacement = 'l("$2" ? "$2" : "$1", "title/". urlencode("$1"))';
- return preg_replace("/$pattern/e", $replacement, $text);
- }
- else {
- return $text;
- }
+ $replacement = 'l("$2" ? "$2" : "$1", "title/". urlencode("$1"))';
+ return preg_replace("/$pattern/e", $replacement, $text);
}
function title_conf_filters() {
- $output = form_radios(t("Enable node link tags"), "title_filter_link", variable_get("title_filter_link", 0), array(t("Disabled"), t("Enabled")), t("Enable Wiki-like [node title|text] links. This will generate a link labeled 'text' to the node with the title 'node title'. If you omit '|text', the label becomes 'node title'. You may use a substring of a node title if desired. When multiple matching titles are found, a list of matching nodes will be displayed. If no matching titles are found, a full-text search is returned."));
- return $output;
+ return form_group(t("Title filter"), t("Wiki-like [node title|text] links are enabled. These shortcuts generate a link labeled 'text' to the node with the title 'node title'. If you omit '|text', the label becomes 'node title'. You may use a substring of a node title if desired. When multiple matching titles are found, a list of matching nodes will be displayed. If no matching titles are found, a full-text search is returned."));
}
function title_compose_tips() {
- if (variable_get("title_filter_link", 0)) {
- return array(t("You may quickly link to another node using this syntax: <i>[node title|text]</i>. This will generate a link labeled 'text' to the node with the title 'node title'. If you omit '|text', the label becomes 'node title'."));
- }
+ return array(t("You may quickly link to another node using this syntax: <em>[node title|text]</em>. This will generate a link labeled 'text' to the node with the title 'node title'. If you omit '|text', the label becomes 'node title'."));
}
?>