| 48 |
* Function used to discover what filters are supplied by this module. |
* Function used to discover what filters are supplied by this module. |
| 49 |
*/ |
*/ |
| 50 |
function attached_node_filter_settings() { |
function attached_node_filter_settings() { |
| 51 |
$output .= form_checkbox(t("Enable Attached Node codes"), 'attached_node_enabled', variable_get('attached_node_enabled', 1), 1, t("When enabled, referrent node codes will be replaced by thumb linked to real node. Syntax: [node:node_id,param1=val1,param2=val2]; every param but node_id is optional.")); |
//$output .= form_checkbox(t("Enable Attached Node codes"), 'attached_node_enabled', variable_get('attached_node_enabled', 1), 1, t("When enabled, referrent node codes will be replaced by thumb linked to real node. Syntax: [node:node_id,param1=val1,param2=val2]; every param but node_id is optional.")); |
| 52 |
$output .= form_item(t("Instructions"), t("Each list should be comma separated (no spaces). E.g. <em>align,border,vspace</em>")); |
$output .= form_item(t('Instructions'), t('This filter translates special node tags into thumbnailed representations that link to other nodes. |
| 53 |
|
Syntax: [node:node_id,param1="val1",param2="val2"]; every param but node_id is optional. |
| 54 |
|
Each list below should be a comma separated list (no spaces) of what node properties users are |
| 55 |
|
allowed to override for the purposes of displaying a node. E.g. <em>title,res,border</em>')); |
| 56 |
foreach(node_list() as $type) { |
foreach(node_list() as $type) { |
| 57 |
$output .= form_textfield(t("Allowed parameters for $type nodes"), "attached_node_allowed_vars_$type", variable_get("attached_node_allowed_vars_$type", ""), 40, 256); |
$output .= form_textfield(t("Allowed parameters for %type nodes", array('%type'=>$type)), "attached_node_allowed_vars_$type", variable_get("attached_node_allowed_vars_$type", ""), 40, 256); |
| 58 |
} |
} |
| 59 |
return form_group(t("Attached Node codes"), $output); |
return form_group(t("Attached Node codes"), $output); |
| 60 |
} |
} |
| 67 |
* Replace meta tag with themed thumbnail view of the referrent node. |
* Replace meta tag with themed thumbnail view of the referrent node. |
| 68 |
*/ |
*/ |
| 69 |
function attached_node_filter_process($text, $show_error_msgs=1) { |
function attached_node_filter_process($text, $show_error_msgs=1) { |
| 70 |
if (variable_get("attached_node_enabled", 0)) { |
if (variable_get("attached_node_enabled", 1)) { |
| 71 |
// *** [node:NID,a="b",c="d",width="40",etc="foo"] *** |
// *** [node:NID,a="b",c="d",width="40",etc="foo"] *** |
| 72 |
// first we find every tag |
// first we find every tag |
| 73 |
$meta_tag_regexp = '/\[node:(\d+)(.*)\]/i'; |
$meta_tag_regexp = '/\[node:(\d+)(.*)\]/i'; |