[pLog-svn] r1984 - in plugins/trunk/submissions: . classclass/action class/view js locale templates

Mark Wu markplace at gmail.com
Thu May 12 02:47:24 GMT 2005


Yes, I think it ready for upload to sf.net.

Mark=20

> -----Original Message-----
> From: plog-svn-bounces at devel.plogworld.net=20
> [mailto:plog-svn-bounces at devel.plogworld.net] On Behalf Of=20
> Oscar Renalias
> Sent: Thursday, May 12, 2005 2:05 AM
> To: plog-svn at devel.plogworld.net
> Subject: Re: [pLog-svn] r1984 - in plugins/trunk/submissions:=20
> . classclass/action class/view js locale templates
>=20
> Mark,
>=20
> is this plugin ready to be uploaded to sf.net?
>=20
> In general, can you let us know when a plugin is ready to be uploaded?
>=20
> Thanks :-)
>=20
> Oscar
>=20
> On 11 May 2005, at 20:00, mark at devel.plogworld.net wrote:
>=20
> > Author: mark
> > Date: 2005-05-11 17:00:15 +0000 (Wed, 11 May 2005) New=20
> Revision: 1984
> >
> > Added:
> >    plugins/trunk/submissions/class/view/
> >    plugins/trunk/submissions/class/view/
> > adminsubmissionspluginsettingsview.class.php
> >    plugins/trunk/submissions/js/
> >    plugins/trunk/submissions/js/htmlarea-submissions.js
> >    plugins/trunk/submissions/locale/locale_zh_TW.php
> > Modified:
> >    plugins/trunk/submissions/class/action/
> > addsubmissionaction.class.php
> >    plugins/trunk/submissions/class/action/
> > adminsubmissionspluginsettingsaction.class.php
> >    plugins/trunk/submissions/class/action/
> > adminsubmissionspluginupdatesettingsaction.class.php
> >    plugins/trunk/submissions/locale/locale_en_UK.php
> >    plugins/trunk/submissions/pluginsubmissions.class.php
> >    plugins/trunk/submissions/templates/accepted.template
> >    plugins/trunk/submissions/templates/pluginsettings.template
> >    plugins/trunk/submissions/templates/submitform.template
> > Log:
> > Submission ported complete!
> >
> > 1. UI already follow 1.0 UI guide line 2. Add support for=20
> htmlarea and=20
> > plogeditor 3. Change the submitform to cache_disable, or we=20
> won't see=20
> > any error messages.
> > 4. add a hidden field of blogId, or the plugin won't work=20
> under custom=20
> > url enabled.
> >
> > Mark
> >
> > Modified: plugins/trunk/submissions/class/action/
> > addsubmissionaction.class.php
> > =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > --- plugins/trunk/submissions/class/action/=20
> > addsubmissionaction.class.php    2005-05-11 06:51:32 UTC (rev 1983)
> > +++ plugins/trunk/submissions/class/action/
> > addsubmissionaction.class.php    2005-05-11 17:00:15 UTC (rev 1984)
> > @@ -53,7 +53,7 @@
> >              }
> >
> >              if( $errors ) {
> > -                $this->_view =3D new PluginTemplatedView( $this-=20
> > >_blogInfo, "submissions", "submitform" );
> > +                $this->_view =3D new PluginTemplatedView( $this-
> > >_blogInfo, "submissions", "submitform",=20
> SMARTY_VIEW_CACHE_DISABLED );
> >                  $this->_view->setValue( "userName", $this-
> > >_userName );
> >                  $this->_view->setValue( "userEmailAddress", $this-
> > >_userEmailAddress );
> >                  $this->_view->setValue( "submissionTopic", $this-
> > >_topic );
> >
> > Modified: plugins/trunk/submissions/class/action/
> > adminsubmissionspluginsettingsaction.class.php
> > =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > --- plugins/trunk/submissions/class/action/=20
> > adminsubmissionspluginsettingsaction.class.php    2005-05-11 =20
> > 06:51:32 UTC (rev 1983)
> > +++ plugins/trunk/submissions/class/action/
> > adminsubmissionspluginsettingsaction.class.php    2005-05-11 =20
> > 17:00:15 UTC (rev 1984)
> > @@ -1,7 +1,7 @@
> >  <?php
> >
> >      include_once( PLOG_CLASS_PATH."class/action/admin/
> > blogowneradminaction.class.php" );
> > -    include_once( PLOG_CLASS_PATH."class/view/admin/=20
> > adminplugintemplatedview.class.php" );
> > +    include_once( PLOG_CLASS_PATH."plugins/submissions/class/view/
> > adminsubmissionspluginsettingsview.class.php" );
> >
> >      class AdminSubmissionsPluginSettingsAction extends=20
> > BlogOwnerAdminAction
> >      {
> > @@ -20,12 +20,11 @@
> >           */
> >          function perform()
> >          {
> > -            $this->_view =3D new AdminPluginTemplatedView( $this-=20
> > >_blogInfo, "submissions", "pluginsettings" );
> > -            $this->_view->setValue( "pluginEnabled", $this-=20
> > >_blogSettings->getValue( "plugin_submissions_enabled" ));
> > -            $this->setCommonData();
> > -
> > -            // better to return true if everything fine
> > -            return true;
> > +            $this->_view =3D new AdminSubmissionsPluginSettingsView
> > ( $this->_blogInfo );
> > +
> > +            $this->setCommonData();
> > +
> > +            return true;
> >          }
> >      }
> >  ?>
> >
> > Modified: plugins/trunk/submissions/class/action/
> > adminsubmissionspluginupdatesettingsaction.class.php
> > =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > --- plugins/trunk/submissions/class/action/=20
> > adminsubmissionspluginupdatesettingsaction.class.php    2005-05-11 =20
> > 06:51:32 UTC (rev 1983)
> > +++ plugins/trunk/submissions/class/action/
> > adminsubmissionspluginupdatesettingsaction.class.php    2005-05-11 =20
> > 17:00:15 UTC (rev 1984)
> > @@ -1,8 +1,7 @@
> >  <?php
> >
> >      include_once( PLOG_CLASS_PATH."class/action/admin/
> > blogowneradminaction.class.php" );
> > -    include_once( PLOG_CLASS_PATH."class/view/admin/=20
> > adminmessageview.class.php" );
> > -    include_once( PLOG_CLASS_PATH."class/view/admin/=20
> > adminerrorview.class.php" );
> > +    include_once( PLOG_CLASS_PATH."plugins/submissions/class/view/
> > adminsubmissionspluginsettingsview.class.php" );
> >      include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
> >      include_once( PLOG_CLASS_PATH."class/dao/customfields/
> > customfields.class.php" );
> >      include_once( PLOG_CLASS_PATH."class/dao/customfields/
> > customfield.class.php" );
> > @@ -11,6 +10,7 @@
> >      {
> >
> >          var $_pluginEnabled;
> > +        var $_htmlareaEnabled;
> >
> >          /**
> >           * Constructor. If nothing else, it also has to call the=20
> > constructor of the parent @@ -23,13 +23,12 @@
> >
> >          function validate()
> >          {
> > -            $this->_pluginEnabled =3D $this->_request->getValue=20
> > ( "pluginEnabled" );
> > +            $this->_pluginEnabled =3D $this->_request->getValue
> > ( "pluginEnabled" );
> > +            $this->_pluginEnabled =3D ($this->_pluginEnabled !=3D =
"" );
> > +
> > +            $this->_htmlareaEnabled =3D $this->_request->getValue
> > ( "htmlareaEnabled" );
> > +            $this->_htmlareaEnabled =3D ($this->_htmlareaEnabled =
!=3D
> > "" );
> >
> > -            if( $this->_pluginEnabled =3D=3D "" )
> > -                $this->_pluginEnabled =3D false;
> > -            else
> > -                $this->_pluginEnabled =3D true;
> > -
> >              return true;
> >          }
> >
> > @@ -107,17 +106,20 @@
> >           */
> >          function perform()
> >          {
> > +            // update the plugin configurations to blog setting
> >              $blogSettings =3D $this->_blogInfo->getSettings();
> >              $blogSettings->setValue(=20
> "plugin_submissions_enabled", =20
> > $this->_pluginEnabled );
> > +            $blogSettings->setValue=20
> > ( "plugin_submissions_htmlarea_enabled", $this->_htmlareaEnabled );
> >              $this->_blogInfo->setSettings( $blogSettings );
> > -            $blogs =3D new Blogs();
> >
> >              // update the settings in the db, and make sure that =20
> > everything went fine
> > +            $blogs =3D new Blogs();
> >              if( !$blogs->updateBlogSettings( $this->_blogInfo-=20
> > >getId(), $this->_blogInfo->getSettings())) {
> > -                $this->_view =3D new AdminErrorView( $this-=20
> > >_blogInfo );
> > -                $this->_view->setMessage( "There was an error =20
> > saving the plugin configuration." );
> > -                $this->setCommonData();
> > -                return false;
> > +                $this->_view =3D new =20
> > AdminSubmissionsPluginSettingsView( $this->_blogInfo );
> > +                $this->_view->setErrorMessage( $this->_locale->tr=20
> > ("error_updating_settings"));
> > +                $this->setCommonData();
> > +
> > +                return false;
> >              }
> >
> >              // check if the fields already exist and if not, =20
> > create them
> > @@ -126,14 +128,18 @@
> >              else
> >                  $this->_updateFields();
> >
> > -            $this->_session->setValue( "blogInfo", $this-=20
> > >_blogInfo );
> > -            $this->saveSession();
> > -
> > -            $this->_view =3D new AdminMessageView(=20
> $this->_blogInfo );
> > -            $this->_view->setMessage( "Plugin settings saved =20
> > successfully!" );
> > -            $this->setCommonData();
> > +            // if everything went ok...
> > +            $this->_blogInfo->setSettings( $blogSettings );
> > +            $this->_session->setValue( "blogInfo", $this-=20
> > >_blogInfo );
> > +            $this->saveSession();
> > +
> > +            $this->_view =3D new AdminSubmissionsPluginSettingsView =

> > ( $this->_blogInfo );
> > +            $this->_view->setSuccessMessage( $this->_locale->tr=20
> > ("submissions_settings_saved_ok"));
> > +            $this->setCommonData();
> >
> > -            // better to return true if everything fine
> > +            // clear the cache
> > +            CacheControl::resetBlogCache(=20
> $this->_blogInfo->getId());
> > +
> >              return true;
> >          }
> >      }
> >
> > Added: plugins/trunk/submissions/class/view/=20
> > adminsubmissionspluginsettingsview.class.php
> > =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > --- plugins/trunk/submissions/class/view/=20
> > adminsubmissionspluginsettingsview.class.php    2005-05-11=20
> 06:51:32 =20
> > UTC (rev 1983)
> > +++ plugins/trunk/submissions/class/view/=20
> > adminsubmissionspluginsettingsview.class.php    2005-05-11=20
> 17:00:15 =20
> > UTC (rev 1984)
> > @@ -0,0 +1,30 @@
> > +<?php
> > +
> > +    include_once( PLOG_CLASS_PATH."class/view/admin/=20
> > adminplugintemplatedview.class.php" );
> > +
> > +    /**
> > +     * implements the main view of the submissions plugin
> > +     */
> > +    class AdminSubmissionsPluginSettingsView extends =20
> > AdminPluginTemplatedView
> > +    {
> > +
> > +        function AdminSubmissionsPluginSettingsView( $blogInfo )
> > +        {
> > +            $this->AdminPluginTemplatedView( $blogInfo, =20
> > "submissions", "pluginsettings" );
> > +        }
> > +
> > +        function render()
> > +        {
> > +            // load some configuration settings
> > +            $blogSettings =3D $this->_blogInfo->getSettings();
> > +            $pluginEnabled =3D $blogSettings->getValue=20
> > ( "plugin_submissions_enabled" );
> > +            $htmlareaEnabled =3D $blogSettings->getValue=20
> > ( "plugin_submissions_htmlarea_enabled" );
> > +
> > +            // create a view and export the settings to=20
> the template
> > +            $this->setValue( "pluginEnabled", $pluginEnabled );
> > +            $this->setValue( "htmlareaEnabled", $htmlareaEnabled );
> > +
> > +            parent::render();
> > +        }
> > +    }
> > +?>
> > \ No newline at end of file
> >
> > Added: plugins/trunk/submissions/js/htmlarea-submissions.js
> > =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > --- plugins/trunk/submissions/js/htmlarea-submissions.js    =20
> > 2005-05-11 06:51:32 UTC (rev 1983)
> > +++ plugins/trunk/submissions/js/htmlarea-submissions.js    =20
> > 2005-05-11 17:00:15 UTC (rev 1984)
> > @@ -0,0 +1,28 @@
> > +var submissionTextEditor =3D null;
> > +
> > +// this function will get called at body.onload
> > +function initEditor() {
> > +
> > +    // ------------------------------------------------------
> > +    // Create submissionText Editor
> > +    // ------------------------------------------------------
> > +    submissionTextEditor =3D new HTMLArea("submissionText");
> > +
> > +    // add our new icon in a place better suited for this task...
> > +    submissionTextEditor.config.toolbar =3D [
> > +        [ "fontsize", "space","space",
> > +          "bold", "italic", "underline", "strikethrough", =20
> > "separator",
> > +          "justifyleft", "justifycenter", "justifyright", =20
> > "justifyfull", "separator",
> > +          "orderedlist", "unorderedlist", "separator",
> > +          "createlink", "insertimage", "htmlmode" ]
> > +    ];
> > +
> > +    // Generate submissionTextEditor Editor
> > +    setTimeout(function()=20
> {submissionTextEditor.generate();}, 1000);
> > +
> > +    return false;
> > +};
> > +
> > +// Initialize HTMLArea Editor
> > +HTMLArea.init();
> > +HTMLArea.onload =3D initEditor;
> > \ No newline at end of file
> >
> > Modified: plugins/trunk/submissions/locale/locale_en_UK.php
> > =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > --- plugins/trunk/submissions/locale/locale_en_UK.php   =20
> 2005-05-11 =20
> > 06:51:32 UTC (rev 1983)
> > +++ plugins/trunk/submissions/locale/locale_en_UK.php   =20
> 2005-05-11 =20
> > 17:00:15 UTC (rev 1984)
> > @@ -1,10 +1,27 @@
> >  <?php
> > +$messages["submissionsPluginSettings"] =3D "Submissions";
> > +$messages["submissions"] =3D "Visitor Submissions";
> >
> > -$messages["your_name"] =3D "Your name (optional)";
> > -$messages["your_email_address"] =3D "Your email address =
(optional)";
> > -$messages["story_topic"] =3D "Your story topic";
> > -$messages["story_contents"] =3D "Your story contents";
> > +$messages["submissions_plugin_enabled"] =3D "Enable this plugin";
> > +$messages["submissions_plugin"] =3D "Submissions Plugin";
> > +
> > +$messages["submissions_htmlarea_enabled"] =3D "Enable build in =20
> > HTMLArea editor";
> > +$messages["submissions_settings_saved_ok"] =3D "Submissions=20
> settings =20
> > saved successfully!";
> > +$messages["error_submissions_not_enabled"] =3D "Please=20
> kindly enable =20
> > Submissions plugin first.";
> > +$messages["error_submission_no_topic"] =3D "Topic Error! Topic =20
> > should not be empty.";
> > +$messages["error_submission_no_text"] =3D "Content Error! Content =20
> > should not be empty.";
> > +$messages["error_submission_no_category"] =3D "Category Error! You  =

> > need to select at least one or more article cateogries.";
> > +$messages["submission_accepted_ok"] =3D "Your story submitted =20
> > successfully!";
> > +
> > +$messages["label_configuration"] =3D "Configuration";
> > +$messages["label_enable"] =3D "Enable";
> > +$messages["label_htmlarea_enabled"] =3D "Enable Editor";
> > +
> > +$messages["your_name"] =3D "Your Name (Optional): ";
> > +$messages["your_email_address"] =3D "Your Email Address=20
> (Optional): ";
> > +$messages["story_topic"] =3D "Your Story Topic: ";
> > +$messages["story_contents"] =3D "Your Story Contents: ";
> >  $messages["submit_story"] =3D "Submit Story";
> >  $messages["post_status_external_submission"] =3D "Unmoderated";
> > -$messages["submissionsPluginSettings"] =3D "Submissions";
> > +
> >  ?>
> > \ No newline at end of file
> >
> > Added: plugins/trunk/submissions/locale/locale_zh_TW.php
> > =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > --- plugins/trunk/submissions/locale/locale_zh_TW.php   =20
> 2005-05-11 =20
> > 06:51:32 UTC (rev 1983)
> > +++ plugins/trunk/submissions/locale/locale_zh_TW.php   =20
> 2005-05-11 =20
> > 17:00:15 UTC (rev 1984)
> > @@ -0,0 +1,26 @@
> > +<?php
> > +$messages["submissionsPluginSettings"] =3D =
"=B3X=AB=C8=A4=E5=B3=B9=B5o=AA=ED=B3]=A9w";
> > +$messages["submissions"] =3D "=B3X=AB=C8=A4=E5=B3=B9=B5o=AA=ED";
> > +
> > +$messages["submissions_plugin_enabled"] =3D =
"=B1=D2=B0=CA=A5~=B1=BE=B5{=A6=A1";
> > +$messages["submissions_plugin"] =3D =
"=B3X=AB=C8=A4=E5=B3=B9=B5o=AA=ED=A5~=B1=BE=B5{=A6=A1";
> > +
> > +$messages["submissions_htmlarea_enabled"] =3D =
"=B1=D2=B0=CA=A4=BA=AB=D8=A9=D2=A8=A3=A7Y=20
> > =A9=D2=B1o=A4=E5=A6r=BDs=BF=E8=BE=B9";
> > +$messages["submissions_settings_saved_ok"] =3D =
"=B3X=AB=C8=A4=E5=B3=B9=B5o=AA=ED=20
> > =B3]=A9w=C0x=A6s=A6=A8=A5\=A1C";
> > +$messages["error_submissions_not_enabled"] =3D =
"=BD=D0=B1z=A5=FD=B1=D2=B0=CA=B3X=20
> > =AB=C8=A4=E5=B3=B9=B5o=AA=ED=A5~=B1=BE=B5{=A6=A1=A1C";
> > +$messages["error_submission_no_topic"] =3D =
"=A4=E5=B3=B9=BC=D0=C3D=BF=F9=BB~=A1I=A4=E5=20
> > =B3=B9=BC=D0=C3D=A4=A3=A5i=AC=B0=AA=C5=A5=D5=A1C";
> > +$messages["error_submission_no_text"] =3D =
"=A4=E5=B3=B9=A4=BA=AEe=BF=F9=BB~=A1I=A4=E5=20
> > =B3=B9=A4=BA=AEe=A4=A3=A5i=AC=B0=AA=C5=A5=D5=A1C";
> > +$messages["error_submission_no_category"] =3D =
"=A4=C0=C3=FE=BF=F9=BB~=A1I=A6=DC=A4=D6=20
> > =BF=EF=BE=DC=A4@=AD=D3=A4=E5=B3=B9=A4=C0=C3=FE=A1C";
> > +$messages["submission_accepted_ok"] =3D =
"=A4=E5=B3=B9=B5o=AA=ED=A6=A8=A5\=A1C";
> > +
> > +$messages["label_configuration"] =3D "=B3]=A9w";
> > +$messages["label_enable"] =3D "=B1=D2=B0=CA";
> > +$messages["label_htmlarea_enabled"] =3D =
"=B1=D2=B0=CA=BDs=BF=E8=BE=B9";
> > +
> > +$messages["your_name"] =3D "=A9m=A6W=A1]=ABD=A5=B2=B6=F1=A1^=A1G";
> > +$messages["your_email_address"] =3D =
"=B9q=A4l=B6l=A5=F3=ABH=BDc=A1]=ABD=A5=B2=20
> > =B6=F1=A1^=A1G";
> > +$messages["story_topic"] =3D "=A4=E5=B3=B9=BC=D0=C3D=A1G";
> > +$messages["story_contents"] =3D "=A4=E5=B3=B9=A4=BA=AEe=A1G";
> > +$messages["submit_story"] =3D "=B0e=A5X=A4=E5=B3=B9";
> > +$messages["post_status_external_submission"] =3D =
"=A5=BC=BCf=AE=D6";
> > +?>
> > \ No newline at end of file
> >
> > Modified: plugins/trunk/submissions/pluginsubmissions.class.php
> > =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > --- plugins/trunk/submissions/pluginsubmissions.class.php    =20
> > 2005-05-11 06:51:32 UTC (rev 1983)
> > +++ plugins/trunk/submissions/pluginsubmissions.class.php    =20
> > 2005-05-11 17:00:15 UTC (rev 1984)
> > @@ -15,9 +15,9 @@
> >              $this->PluginBase();
> >
> >              $this->id =3D "submissions";
> > -            $this->description =3D "Allows users to submit stories  =

> > to the blog";
> > +            $this->description =3D "Allows visitor to submit=20
> stories =20
> > to the blog.";
> >              $this->author =3D "The pLog Team";
> > -            $this->locales =3D Array( "en_UK" );
> > +            $this->locales =3D Array();
> >
> >              $this->init();
> >          }
> > @@ -34,7 +34,36 @@
> >              $this->registerAdminAction=20
> > ( "pluginSubmissionsUpdateSettings", =20
> > "AdminSubmissionsPluginUpdateSettingsAction" );
> >
> >              // add a couple of menu entries
> > -            $this->addMenuEntry( "/menu/controlCenter/=20
> > manageSettings", "submissionsPluginSettings", "admin.php?=20
> > op=3DsubmissionsPluginSettings", "", true, false );
> > -        }
> > +            $this->addMenuEntry( "/menu/Manage/managePosts", =20
> > "submissionsPluginSettings", "admin.php?=20
> > op=3DsubmissionsPluginSettings", "", true, false );
> > +        }
> > +
> > +        function register()
> > +        {
> > +            $blogSettings =3D $this->blogInfo->getSettings();
> > +            $this->pluginEnabled =3D $blogSettings->getValue=20
> > ( "plugin_submissions_enabled" );
> > +            $this->htmlareaEnabled =3D $blogSettings->getValue=20
> > ( "plugin_submissions_htmlarea_enabled" );
> > +        }
> > +
> > +        function isEnabled()
> > +        {
> > +            return $this->pluginEnabled;
> > +        }
> > +
> > +        function isHtmlareaEnabled()
> > +        {
> > +            return $this->htmlareaEnabled;
> > +        }
> > +
> > +        function pluginTemplatePage()
> > +        {
> > +             $rg =3D new RawRequestGenerator($this->blogInfo);
> > +
> > +            $rg->addParameter( "op", "submissionForm" );
> > +            $rg->addParameter( "blogId", $this->blogInfo->getId());
> > +
> > +            $templatePage =3D $rg->getIndexUrl().$rg->getRequest();
> > +
> > +            return $templatePage;
> > +        }
> >      }
> >  ?>
> > \ No newline at end of file
> >
> > Modified: plugins/trunk/submissions/templates/accepted.template
> > =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > --- plugins/trunk/submissions/templates/accepted.template    =20
> > 2005-05-11 06:51:32 UTC (rev 1983)
> > +++ plugins/trunk/submissions/templates/accepted.template    =20
> > 2005-05-11 17:00:15 UTC (rev 1984)
> > @@ -1,3 +1,4 @@
> > +{include file=3D"$blogtemplate/header.template"}
> >  <p>
> >  {$locale->tr("submission_accepted_ok")}
> >  </p>
> > @@ -3,3 +4,4 @@
> >  <p>
> >   <a href=3D"{$url->blogLink()}">{$locale->tr("back")}</a>
> > -</p>
> > \ No newline at end of file
> > +</p>
> > +{include file=3D"$blogtemplate/footer.template"}
> > \ No newline at end of file
> >
> > Modified:=20
> plugins/trunk/submissions/templates/pluginsettings.template
> > =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > --- plugins/trunk/submissions/templates/pluginsettings.template    =20
> > 2005-05-11 06:51:32 UTC (rev 1983)
> > +++ plugins/trunk/submissions/templates/pluginsettings.template    =20
> > 2005-05-11 17:00:15 UTC (rev 1984)
> > @@ -1,16 +1,33 @@
> >  {include file=3D"$admintemplatepath/header.template"}
> > -{include file=3D"$admintemplatepath/navigation.template" =20
> > showOpt=3DsubmissionsPluginSettings title=3D$locale->tr=20
> > ("submissionsPluginSettings")}
> > -<p>
> > -This plugin will allow you to allow visitors to send articles for =20
> > publishing. It works by creating
> > -two additional custom fields that will be used to store the email =20
> > address of the sender and the
> > -name or nickname of the sender. Please do not remove these fields =20
> > or the plugin will not work
> > -correctly.
> > -</p>
> > -<form name=3D"pluginSubmissionsSettings" action=3D"admin.php" =20
> > method=3D"post">
> > - <input type=3D"checkbox" name=3D"pluginEnabled" value=3D"1" {if =20
> > $pluginEnabled}checked=3D"checked"{/if} />
> > - Enable this plugin.<br/><br/>
> > - <input type=3D"hidden" name=3D"op" =20
> > value=3D"pluginSubmissionsUpdateSettings" />
> > - <input type=3D"submit" name=3D"{$locale->tr("update")}" =20
> > value=3D"{$locale->tr("update")}" />
> > +{include file=3D"$admintemplatepath/navigation.template" =20
> > showOpt=3DsubmissionsPluginSettings title=3D$locale->tr=20
> > ("submissions_plugin")}
> > +<form name=3D"pluginSubmissionsSettings"  action=3D"admin.php" =20
> > method=3D"post">
> > + <fieldset class=3D"inputField">
> > + <legend>{$locale->tr("label_configuration")}</legend>
> > +  {include file=3D"$admintemplatepath/successmessage.template"}
> > +  {include file=3D"$admintemplatepath/errormessage.template"}
> > +  <div class=3D"field">
> > +   <label =
for=3D"pluginEnabled">{$locale->tr("label_enable")}</label>
> > +   <span class=3D"required"></span>
> > +   <div class=3D"formHelp">
> > +    <input class=3D"checkbox" type=3D"checkbox" =
name=3D"pluginEnabled" =20
> > id=3D"pluginEnabled" {if $pluginEnabled} checked=3D"checked" {/if} =20
> > value=3D"1" />{$locale->tr("submissions_plugin_enabled")}
> > +   </div>
> > +  </div>
> > +
> > +  <div class=3D"field">
> > +   <label for=3D"htmlareaEnabled">{$locale->tr=20
> > ("label_htmlarea_enabled")}</label>
> > +   <span class=3D"required"></span>
> > +   <div class=3D"formHelp">
> > +    <input class=3D"checkbox" type=3D"checkbox"=20
> name=3D"htmlareaEnabled" =20
> > id=3D"htmlareaEnabled" {if $htmlareaEnabled} checked=3D"checked" =
{/if} =20
> > value=3D"1" />{$locale->tr("submissions_htmlarea_enabled")}
> > +   </div>
> > +  </div>
> > +
> > + </fieldset>
> > +
> > + <div class=3D"buttons">
> > +  <input type=3D"hidden" name=3D"op" =20
> > value=3D"pluginSubmissionsUpdateSettings" />
> > +  <input type=3D"reset" name=3D"{$locale->tr("reset")}" />
> > +  <input type=3D"submit" name=3D"{$locale->tr("update_settings")}"  =

> > value=3D"{$locale->tr("update")}" />
> > + </div>
> >  </form>
> >  {include file=3D"$admintemplatepath/footernavigation.template"}
> >  {include file=3D"$admintemplatepath/footer.template"}
> > \ No newline at end of file
> >
> > Modified: plugins/trunk/submissions/templates/submitform.template
> > =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > --- plugins/trunk/submissions/templates/submitform.template    =20
> > 2005-05-11 06:51:32 UTC (rev 1983)
> > +++ plugins/trunk/submissions/templates/submitform.template    =20
> > 2005-05-11 17:00:15 UTC (rev 1984)
> > @@ -1,21 +1,36 @@
> >  {include file=3D"$blogtemplate/header.template"}
> > +{if $submissions->isEnabled()}
> > +{if $submissions->isHtmlareaEnabled()}
> > +  <script type=3D"text/javascript" =
src=3D"js/htmlarea/htmlarea.js"/></=20
> > script>
> > +  <script type=3D"text/javascript" =
src=3D"js/htmlarea/dialog.js"/></=20
> > script>
> > +  <script type=3D"text/javascript" src=3D"plugins/submissions/js/=20
> > htmlarea-submissions.js"/></script>
> > +{else}
> > +  <link rel=3D"stylesheet" href=3D"js/editor/plogeditor.css" =20
> > type=3D"text/css" />
> > +  <script type=3D"text/javascript" =
src=3D"js/editor/plogeditor.js"></=20
> > script>
> > +{/if}
> >  {if $errors}
> >   <p style=3D"color: red">
> >    {$errorMessage}
> >   </p>
> >  {/if}
> >  <form name=3D"submission" method=3D"post"=20
> action=3D"{$url->getIndexUrl()}">
> > - {$locale->tr("your_name")}: <br/><input type=3D"text" =20
> > name=3D"userName" value=3D"{$userName}" /><br/>
> > - {$locale->tr("your_email_address")}: <br/><input type=3D"text" =20
> > name=3D"userEmailAddress" value=3D"{$userEmailAddress}" /><br/>
> > - {$locale->tr("story_topic")}: <br/><input type=3D"text" =20
> > name=3D"submissionTopic" value=3D"{$submissionTopic}" /><br/>
> > - {$locale->tr("story_contents")}: <br/><textarea rows=3D"6" =20
> > cols=3D"70"=20
> name=3D"submissionText">{$submissionText}</textarea><br/><br/>
> > - {$locale->tr("category")}: <br/>
> > + {$locale->tr("your_name")}<br/><input type=3D"text"=20
> name=3D"userName" =20
> > value=3D"{$userName}" style=3D"width:100%" /><br/>
> > + {$locale->tr("your_email_address")}<br/><input type=3D"text" =20
> > name=3D"userEmailAddress" value=3D"{$userEmailAddress}" =
style=3D"width:=20
> > 100%" /><br/>
> > + {$locale->tr("story_topic")}<br/><input type=3D"text" =20
> > name=3D"submissionTopic" value=3D"{$submissionTopic}" =
style=3D"width:=20
> > 100%" /><br/>
> > + {$locale->tr("category")}<br/>
> >   <select name=3D"submissionCategory[]" multiple=3D"multiple">
> >   {foreach from=3D$articlecategories item=3Dcategory}
> >    <option value=3D"{$category->getId()}">{$category->getName()}</=20
> > option>
> >   {/foreach}
> >   </select><br/>
> > + {$locale->tr("story_contents")}<br/>
> > + {if !$submissions->isHtmlareaEnabled()}<script type=3D"text/=20
> > javascript">var ed1 =3D new pLogEditor('submissionText','ed1');</=20
> > script>{/if}
> > + <textarea rows=3D"15" id=3D"submissionText" =
name=3D"submissionText" =20
> > style=3D"width:100%">{$submissionText}</textarea><br/><br/>
> >   <input type=3D"hidden" name=3D"op" value=3D"submitStory" />
> > + <input type=3D"hidden" name=3D"blogId" value=3D"{$blog->getId()}" =
/>
> >   <input type=3D"submit" name=3D"{$locale->tr("submit_story")}" =20
> > value=3D"{$locale->tr("submit_story")}" />
> >  </form>
> > + {else}
> > +  {$locale->tr("error_submissions_not_enabled")}
> > + {/if}
> >  {include file=3D"$blogtemplate/footer.template"}
> > \ No newline at end of file
> >
> > _______________________________________________
> > pLog-svn mailing list
> > pLog-svn at devel.plogworld.net
> > http://devel.plogworld.net/mailman/listinfo/plog-svn
> >
> >
>=20
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.plogworld.net
> http://devel.plogworld.net/mailman/listinfo/plog-svn




More information about the pLog-svn mailing list