diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-02-06 19:07:56 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-02-06 19:07:56 +0000 |
commit | bfba335376c8a15c74ec0e8ec71541193b458073 (patch) | |
tree | ea62f98f1dd0f5a2329ec96af6f456db8fb019ac /modules/title.module | |
parent | 0db96f196a89956e60ad38aaf8fac1dcbdf0fa4c (diff) | |
download | brdo-bfba335376c8a15c74ec0e8ec71541193b458073.tar.gz brdo-bfba335376c8a15c74ec0e8ec71541193b458073.tar.bz2 |
- Added the possibility to reorder filters. Patch by UnConeD.
Diffstat (limited to 'modules/title.module')
-rw-r--r-- | modules/title.module | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/modules/title.module b/modules/title.module index e109a1851..4fc325c64 100644 --- a/modules/title.module +++ b/modules/title.module @@ -64,15 +64,28 @@ function title_page() { } } +function title_filter($op, $text = "") { + switch ($op) { + case "name": + return t("Title filter"); + case "process": + return _title_filter_process($text); + case "settings": + return _title_filter_settings($text); + default: + return $text; + } +} + // filter [node title|description] links. '|description' is optional. -function title_filter($text) { +function _title_filter_process($text) { $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); } -function title_conf_filters() { +function _title_filter_settings() { 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.")); } |