Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_textile
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20254/plugins/serendipity_event_textile
Modified Files:
Tag: branch_0_6
serendipity_event_textile.php
Log Message:
MFH:
* Upgrader kills the current session for possible changes inside session
data on upgrade
* Fixed wrong comparison operator - bug reported by tom, where nl2br plugin
has "reversed" logic.
This is because (true != 'false') evaluates to true. Plugin config did not
evaluate radio values correctly.
* Fixed textile plugin not enabled by default after adding it as a plugin
* Comments plugin now correctly wordwraps
* Couple of linebreak fixes (*sigh*)
PLEASE TEST THE PLUGIN-STUFF! Needs to be verified working for rc2...
Index: serendipity_event_textile.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_textile/serendipity_event_textile.php,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -d -r1.3 -r1.3.4.1
--- serendipity_event_textile.php 21 Mar 2004 16:35:32 -0000 1.3
+++ serendipity_event_textile.php 13 Apr 2004 10:01:14 -0000 1.3.4.1
@@ -23,7 +23,7 @@
function introspect(&$propbag)
{
global $serendipity;
-
+
$propbag->add('name', PLUGIN_EVENT_TEXTILE_NAME);
$propbag->add('description', PLUGIN_EVENT_TEXTILE_DESC);
$propbag->add('event_hooks', array('frontend_display' => true, 'frontend_comment' => true));
@@ -35,7 +35,7 @@
'name'
)
);
-
+
$this->markup_elements = array(
array(
'name' => ENTRY_BODY,
@@ -74,12 +74,12 @@
$propbag->add('name', $name);
$propbag->add('description', sprintf(APPLY_MARKUP_TO, $name));
return true;
- }
+ }
function event_hook($event, &$bag, &$eventData) {
global $serendipity;
-
+
$hooks = &$bag->get('event_hooks');
if (isset($hooks[$event])) {
@@ -89,7 +89,7 @@
$preserve_tags = &$bag->get('preserve_tags');
foreach ($this->markup_elements as $temp) {
- if ($this->get_config($temp['name']) == 'true') {
+ if (serendipity_db_bool($this->get_config($temp['name'], true))) {
$element = $temp['element'];
/* find all the tags and store them in $blocks */
@@ -114,7 +114,7 @@
$eventData[$element] = textile($eventData[$element]);
/* each block will now be "<code>BLOCK::2</code>"
- * so look for those place holders and replace
+ * so look for those place holders and replace
* them with the original blocks */
if (preg_match_all('/<code>BLOCK::(\d+)<\/code>/', $eventData[$element], $matches )) {
@@ -143,7 +143,7 @@
return true;
case 'frontend_comment':
- if ($this->get_config(COMMENT) != 'false') {
+ if (serendipity_db_bool($this->get_config(COMMENT, true))) {
echo PLUGIN_EVENT_TEXTILE_TRANSFORM . '<br />';
}
return true;
@@ -195,7 +195,7 @@
$highlighted
) . '</div></p>';
- return $highlighted;
+ return $highlighted;
}
|