]> git.mjollnir.org Git - s9y.git/commitdiff
comments plugin can have custom title
authorgarvinhicking <garvinhicking>
Mon, 18 Apr 2005 09:19:47 +0000 (09:19 +0000)
committergarvinhicking <garvinhicking>
Mon, 18 Apr 2005 09:19:47 +0000 (09:19 +0000)
plugins/serendipity_plugin_comments/serendipity_plugin_comments.php

index 06c7cda535bb69a11dc6c7dcb14955d207be329e..87be61597ef5195935aa774d8a9272677fb137af 100644 (file)
@@ -40,6 +40,8 @@ class serendipity_plugin_comments extends serendipity_plugin
     {
         global $serendipity;
 
+        $this->title = $this->get_config('title', $this->title);
+
         $propbag->add('name',          COMMENTS);
         $propbag->add('description',   PLUGIN_COMMENTS_BLAHBLAH);
         $propbag->add('stackable',     true);
@@ -51,6 +53,7 @@ class serendipity_plugin_comments extends serendipity_plugin
             'php'         => '4.1.0'
         ));
         $propbag->add('configuration', array(
+                                             'title',
                                              'wordwrap',
                                              'max_chars',
                                              'max_entries',
@@ -60,12 +63,18 @@ class serendipity_plugin_comments extends serendipity_plugin
     function introspect_config_item($name, &$propbag)
     {
         switch($name) {
+            case 'title':
+                $propbag->add('type',        'string');
+                $propbag->add('name',        TITLE);
+                $propbag->add('description', '');
+                $propbag->add('default',     COMMENTS);
+                break;
+
             case 'wordwrap':
                 $propbag->add('type', 'string');
                 $propbag->add('name', PLUGIN_COMMENTS_WORDWRAP);
                 $propbag->add('description', PLUGIN_COMMENTS_WORDWRAP_BLAHBLAH);
                 $propbag->add('default', 30);
-
                 break;
 
             case 'max_chars':
@@ -98,7 +107,7 @@ class serendipity_plugin_comments extends serendipity_plugin
     function generate_content(&$title)
     {
         global $serendipity;
-        $title       = $this->title;
+        $title       = $this->get_config('title', $this->title);
         $max_entries = $this->get_config('max_entries');
         $max_chars   = $this->get_config('max_chars');
         $wordwrap    = $this->get_config('wordwrap');