You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return array(0=> t('Dynamic content with TinyButStrong')); // Title displayed in the "Add input format" screen
28
-
case 'no cache':
29
-
return true; // avoid cache for this filter => the node must be dynamic, this is the main goal
30
-
case 'description':
31
-
return "Activate TBS tags that produce dynamic content automatically or trought a custom script."; // displayed in "Home�Administer�Site configuration�Input Formats"
32
-
case 'prepare':
33
-
return $text;
34
-
case 'process':
35
-
tbs_merge_node($text);
36
-
return $text;
37
-
case 'settings':
38
-
// displayed in "Home�Administer�Site configuration�Input formats�TBS�Configure"
39
-
$form['tbs_filter'] = array('#type' => 'fieldset', '#title' => t('Dynamic content with TinyButStrong'), '#value' => t('You can define a global list of smileys on the !page.', array('!page' => l(t('smileys settings page'), 'admin/settings/tbs'))));
40
-
return $form;
41
-
}
24
+
switch ($op) {
25
+
case 'list':
26
+
return array(0=> t('Dynamic content with TinyButStrong')); // Title displayed in the "Add input format" screen
27
+
case 'no cache':
28
+
return true; // avoid cache for this filter => the node must be dynamic, this is the main goal
29
+
case 'description':
30
+
return "Activate TBS tags that produce dynamic content automatically or trought a custom script."; // displayed in "Home�Administer�Site configuration�Input Formats"
31
+
case 'prepare':
32
+
return $text;
33
+
case 'process':
34
+
tbs_merge_node($text);
35
+
return $text;
36
+
case 'settings':
37
+
// displayed in "Home�Administer�Site configuration�Input formats�TBS�Configure"
38
+
$form['tbs_filter'] = array('#type' => 'fieldset', '#title' => t('Dynamic content with TinyButStrong'), '#value' => t('You can define a global list of smileys on the !page.', array('!page' => l(t('smileys settings page'), 'admin/settings/tbs'))));
39
+
return $form;
40
+
}
42
41
}
43
42
44
43
function tbs_merge_node(&$text) {
45
44
46
-
// Search for plugin tags inside the article. There is a loop because the article can support several mergings.
47
-
$tag_beg = '{tbs}';
48
-
$tag_end = '{/tbs}';
49
-
$p1 = strpos($text, $tag_beg);
50
-
if ($p1===false) return; // If no TBS tag, then the node doesn't need the plugin.
45
+
// Search for plugin tags inside the article. There is a loop because the article can support several mergings.
46
+
$tag_beg = '{tbs}';
47
+
$tag_end = '{/tbs}';
48
+
$p1 = strpos($text, $tag_beg);
49
+
if ($p1===false) return; // If no TBS tag, then the node doesn't need the plugin.
51
50
52
-
include_once('tinybutstrong_comm.php');
53
-
include_once('tinybutstrong_spec.php');
51
+
include_once('tinybutstrong_comm.php');
52
+
include_once('tinybutstrong_spec.php');
54
53
55
-
$TBS = false;
54
+
$TBS = false;
56
55
57
-
// Drupal: The node Id cannot be retreive in the context of a filter process because the filter can be applied on a combination of nodes.
58
-
//if (!tbs_plugin_CheckArticle($NodeId)) return ''; // Exit the plug if the node is not allowed
59
-
60
-
tbs_plugin_InitTBS($TBS, $text);
61
-
tbs_plugin_SqlDbInit($TBS); // retrieve SQL information and set them as custom property of $TBS
56
+
// Drupal: The node Id cannot be retreive in the context of a filter process because the filter can be applied on a combination of nodes.
57
+
//if (!tbs_plugin_CheckArticle($NodeId)) return ''; // Exit the plug if the node is not allowed
58
+
59
+
tbs_plugin_InitTBS($TBS, $text);
60
+
tbs_plugin_SqlDbInit($TBS); // retrieve SQL information and set them as custom property of $TBS
62
61
63
-
// Wrappers for developpers
64
-
// $TBS->DrupalDb = $TBS->_CmsDbSrc;
62
+
// Wrappers for developpers
63
+
// $TBS->DrupalDb = $TBS->_CmsDbSrc;
65
64
66
-
$tag_lst = tbs_plugin_Loop($TBS, $p1, $tag_beg, $tag_end); // Search for all TBS tags and process them.
65
+
$tag_lst = tbs_plugin_Loop($TBS, $p1, $tag_beg, $tag_end); // Search for all TBS tags and process them.
67
66
68
-
$text = tbs_plugin_EndTBS($TBS); // ends the merge.
67
+
$text = tbs_plugin_EndTBS($TBS); // ends the merge.
69
68
70
-
unset($TBS);
71
-
return true;
69
+
unset($TBS);
70
+
return true;
72
71
73
72
}
74
73
@@ -77,16 +76,16 @@ function tbs_merge_node(&$text) {
'#description' => t("Default value is empty ('') which mean none. Enter one or several id of nodes allowed to use plugin tags, separated them with comas (,). An error is prompted if a non-allowed article contains a plugin tag such as {tbs}. Set this parameter to limit the articles that Drupal authors can use plugin tags with. You can use '*' to allow all articles, but use this value carefully because if option Direct MergeBlock is also allowed then any Drupal author will be able to display the Drupal database."),
131
-
'#default_value' => '',
132
-
'#type' => 'textfield',
133
-
'#size' => 30,
134
-
'#required' => false,
135
-
);
136
-
*/
137
126
$form['tbs_option_MergeBlock'] = array(
138
127
'#title' => t('Direct MergeBlock'),
139
128
'#description' => t("Allow plugin tags such as {tbs}mergeblock=...,sql=...,db=...{/tbs}."),
@@ -158,24 +147,6 @@ function tbs_settings() {
158
147
'#size' => 60,
159
148
'#required' => false,
160
149
);
161
-
$form['tbs_option_Embedded'] = array(
162
-
'#title' => t('Embedded scripts'),
163
-
'#description' => t("Allow plugin tags such as {tbs}embedded{/tbs}. Please note that those tags allow to run PHP scripts which is embedded inside an article."),
'#description' => t("Default value is empty. Ids of nodes which are allowed to use all plugin tags with all permissions. You can seperate Ids with a coma (,). You can use '*' to allow all nodes. You can use this parameter to let Admin users to use plugin tags for their own nodes."),
0 commit comments