Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_emoticate
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2418/plugins/serendipity_event_emoticate
Modified Files:
Tag: branch-smarty
serendipity_event_emoticate.php
Log Message:
- Don't hack config variables to implement 'info', use a function instead.
If that function is defined - it will be run to display an example of the plugin as defined within the plugin
INFO: Might need tweaking, but we need to get the 'info' thing out of CVS ASAP :)
Index: serendipity_event_emoticate.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_emoticate/serendipity_event_emoticate.php,v
retrieving revision 1.10.2.5
retrieving revision 1.10.2.6
diff -u -d -r1.10.2.5 -r1.10.2.6
--- serendipity_event_emoticate.php 8 Oct 2004 12:29:49 -0000 1.10.2.5
+++ serendipity_event_emoticate.php 9 Oct 2004 19:04:41 -0000 1.10.2.6
@@ -48,7 +48,6 @@
foreach($this->markup_elements as $element) {
$conf_array[] = $element['name'];
}
- $conf_array[] = 'info';
$propbag->add('configuration', $conf_array);
}
@@ -107,30 +106,26 @@
$title = PLUGIN_EVENT_EMOTICATE_NAME;
}
+ function example() {
+ $s = '<table cellspacing="5" style="margin-left: auto; margin-right: auto">';
+ $s .= '<tr>';
+ $i = 1;
+ foreach($this->getEmoticons() as $key => $value) {
+ $s .= '<td style="text-align: center">' . $key . '</td><td><img src="'. $value .'"></td>' . "\n";
+ if ($i++ % 7 == 0) $s .= '</tr><tr>';
+ }
+ $s .= '</tr>';
+ $s .= '</table>';
+
+ return $s;
+ }
function introspect_config_item($name, &$propbag)
{
- switch($name) {
- case 'info':
- $smiley_list = '<table cellspacing="10" style="margin-left: auto; margin-right: auto">';
- $smiley_top = '';
- $smiley_bottom = '';
- foreach($this->getEmoticons() as $key => $value) {
- $smiley_top .= '<td style="text-align: center">' . $key . '</td>';
- $smiley_bottom .= '<td style="text-align: center"><img src="' . $value . '" style="display: inline; vertical-allign: bottom;" class="emoticon" /></td>';
- }
- $smiley_list .= '<tr>' . $smiley_top . '</tr><tr>' . $smiley_bottom . '</tr></table>';
- $propbag->add('type', 'info');
- $propbag->add('description', $smiley_list);
- break;
-
- default:
- $propbag->add('type', 'boolean');
- $propbag->add('name', $name);
- $propbag->add('description', sprintf(APPLY_MARKUP_TO, $name));
- $propbag->add('default', 'true');
- break;
- }
+ $propbag->add('type', 'boolean');
+ $propbag->add('name', $name);
+ $propbag->add('description', sprintf(APPLY_MARKUP_TO, $name));
+ $propbag->add('default', 'true');
return true;
}
|