consistent plugin usage - creativecommons (sidebar)

this and followup commits touches:
    class method parenthesis "\n{\n    <code>\n}\n",
    case break switches,
    consistent boolean usage,
    append css to eventData
    and other cleanups
This commit is contained in:
Ian 2016-01-26 14:02:41 +01:00
parent 0bcb16cc59
commit 99d488d1be

View File

@ -1,8 +1,13 @@
<?php # $Id$
<?php
if (IN_serendipity !== true) {
die ("Don't hack!");
}
@serendipity_plugin_api::load_language(dirname(__FILE__));
class serendipity_plugin_creativecommons extends serendipity_plugin {
class serendipity_plugin_creativecommons extends serendipity_plugin
{
var $title = PLUGIN_SIDEBAR_CREATIVECOMMONS_NAME;
function introspect(&$propbag)
@ -13,9 +18,9 @@ class serendipity_plugin_creativecommons extends serendipity_plugin {
$propbag->add('description', PLUGIN_SIDEBAR_CREATIVECOMMONS_DESC);
$propbag->add('stackable', true);
$propbag->add('author', 'Evan Nemerson');
$propbag->add('version', '1.0');
$propbag->add('version', '1.1');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'serendipity' => '1.6',
'smarty' => '2.6.7',
'php' => '4.1.0'
));
@ -28,17 +33,22 @@ class serendipity_plugin_creativecommons extends serendipity_plugin {
function introspect_config_item($name, &$propbag)
{
switch($name) {
case 'title':
$propbag->add('type', 'string');
$propbag->add('name', TITLE);
$propbag->add('description', TITLE);
$propbag->add('default', '');
break;
default:
return false;
}
return true;
}
function generate_content(&$title) {
function generate_content(&$title)
{
global $serendipity;
$title = $this->get_config('title', $this->title);
@ -47,7 +57,8 @@ class serendipity_plugin_creativecommons extends serendipity_plugin {
serendipity_plugin_api::hook_event('frontend_display:html_layout', $eventData);
echo $eventData['display_dat'];
}
}
/* vim: set sts=4 ts=4 expandtab : */
?>
?>