[pLog-svn] r1198 - in plugins/trunk/textparser: . class
class/action class/view locale templates
mark at devel.plogworld.net
mark at devel.plogworld.net
Thu Feb 24 07:49:23 GMT 2005
Author: mark
Date: 2005-02-24 07:49:23 +0000 (Thu, 24 Feb 2005)
New Revision: 1198
Added:
plugins/trunk/textparser/class/view/
plugins/trunk/textparser/class/view/adminplugintextparsersettingsview.class.php
plugins/trunk/textparser/locale/locale_zh_TW.php
Modified:
plugins/trunk/textparser/class/action/adminplugintextparsersettingsaction.class.php
plugins/trunk/textparser/class/action/adminplugintextparserupdatesettingsaction.class.php
plugins/trunk/textparser/locale/locale_en_UK.php
plugins/trunk/textparser/plugintextparser.class.php
plugins/trunk/textparser/templates/settings.template
Log:
Text parser is completed! Need a readme.txt file to descript what is this for.
Modified: plugins/trunk/textparser/class/action/adminplugintextparsersettingsaction.class.php
===================================================================
--- plugins/trunk/textparser/class/action/adminplugintextparsersettingsaction.class.php 2005-02-24 04:00:39 UTC (rev 1197)
+++ plugins/trunk/textparser/class/action/adminplugintextparsersettingsaction.class.php 2005-02-24 07:49:23 UTC (rev 1198)
@@ -1,7 +1,7 @@
<?php
include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
- include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+ include_once( PLOG_CLASS_PATH."plugins/textparser/class/view/adminplugintextparsersettingsview.class.php" );
/**
* shows a form with the current configuration
@@ -23,7 +23,7 @@
if( $filter == "" ) $filter = PLUGIN_TEXTPARSER_FILTER_WIKI;
// create a view and export the settings to the template
- $this->_view = new AdminPluginTemplatedView( $this->_blogInfo, "textparser", "settings", true );
+ $this->_view = new AdminPluginTextParserSettingsView( $this->_blogInfo );
$this->_view->setValue( "pluginEnabled", $pluginEnabled );
$this->_view->setValue( "filter", $filter );
Modified: plugins/trunk/textparser/class/action/adminplugintextparserupdatesettingsaction.class.php
===================================================================
--- plugins/trunk/textparser/class/action/adminplugintextparserupdatesettingsaction.class.php 2005-02-24 04:00:39 UTC (rev 1197)
+++ plugins/trunk/textparser/class/action/adminplugintextparserupdatesettingsaction.class.php 2005-02-24 07:49:23 UTC (rev 1198)
@@ -1,7 +1,7 @@
<?php
include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
- include_once( PLOG_CLASS_PATH."class/view/admin/adminmessageview.class.php" );
+ include_once( PLOG_CLASS_PATH."plugins/textparser/class/view/adminplugintextparsersettingsview.class.php" );
/**
* updates the plugin configuration
@@ -40,8 +40,8 @@
// save the blogs settings
$blogs = new Blogs();
if( !$blogs->updateBlog( $this->_blogInfo->getId(), $this->_blogInfo )) {
- $this->_view = new AdminErrorView( $this->_blogInfo );
- $this->_view->setValue( "message", $this->_locale->tr("error_updating_settings"));
+ $this->_view = new AdminPluginTextParserSettingsView( $this->_blogInfo );
+ $this->_view->setErrorMessage( "message", $this->_locale->tr("error_updating_settings"));
$this->setCommonData();
return false;
@@ -52,8 +52,8 @@
$this->_session->setValue( "blogInfo", $this->_blogInfo );
$this->saveSession();
- $this->_view = new AdminMessageView( $this->_blogInfo );
- $this->_view->setMessage( $this->_locale->tr("textparser_settings_saved_ok"));
+ $this->_view = new AdminPluginTextParserSettingsView( $this->_blogInfo );
+ $this->_view->setSuccessMessage( $this->_locale->tr("textparser_settings_saved_ok"));
$this->setCommonData();
return true;
Added: plugins/trunk/textparser/class/view/adminplugintextparsersettingsview.class.php
===================================================================
--- plugins/trunk/textparser/class/view/adminplugintextparsersettingsview.class.php 2005-02-24 04:00:39 UTC (rev 1197)
+++ plugins/trunk/textparser/class/view/adminplugintextparsersettingsview.class.php 2005-02-24 07:49:23 UTC (rev 1198)
@@ -0,0 +1,31 @@
+<?php
+
+ include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+
+ /**
+ * implements the main view of the feed reader plugin
+ */
+ class AdminPluginTextParserSettingsView extends AdminPluginTemplatedView
+ {
+
+ function AdminPluginTextParserSettingsView( $blogInfo )
+ {
+ $this->AdminPluginTemplatedView( $blogInfo, "textparser", "settings" );
+ }
+
+ function render()
+ {
+ // load some configuration settings
+ $blogSettings = $this->_blogInfo->getSettings();
+ $pluginEnabled = $blogSettings->getValue( "plugin_textparser_enabled" );
+ $filter = $blogSettings->getValue( "plugin_textparser_filter" );
+ if( $filter == "" ) $filter = PLUGIN_TEXTPARSER_FILTER_WIKI;
+
+ // create a view and export the settings to the template
+ $this->setValue( "pluginEnabled", $pluginEnabled );
+ $this->setValue( "filter", $filter );
+
+ parent::render();
+ }
+ }
+?>
\ No newline at end of file
Modified: plugins/trunk/textparser/locale/locale_en_UK.php
===================================================================
--- plugins/trunk/textparser/locale/locale_en_UK.php 2005-02-24 04:00:39 UTC (rev 1197)
+++ plugins/trunk/textparser/locale/locale_en_UK.php 2005-02-24 07:49:23 UTC (rev 1198)
@@ -1,3 +1,13 @@
<?php
-$messages["TextParser"] = "TextParser";
+$messages["TextParser"] = "Text Parser";
+
+$messages["textparser_plugin_enabled"] = "Enable this plugin";
+$messages["textparser_plugin"] = "Text Parser Plugin";
+$messages["textparser_parser"] = "The text parser will apply to all blog articles. Currently, only support Wiki, Textile, phpBB and Markdown";
+
+$messages["textparser_settings_saved_ok"] = "Text Parser settings saved successfully!";
+
+$messages["label_configuration"] = "Configuration";
+$messages["label_enable"] = "Enable";
+$messages["label_parser"] = "Parser";
?>
\ No newline at end of file
Added: plugins/trunk/textparser/locale/locale_zh_TW.php
===================================================================
--- plugins/trunk/textparser/locale/locale_zh_TW.php 2005-02-24 04:00:39 UTC (rev 1197)
+++ plugins/trunk/textparser/locale/locale_zh_TW.php 2005-02-24 07:49:23 UTC (rev 1198)
@@ -0,0 +1,13 @@
+<?php
+$messages["TextParser"] = "文章解析語法設定";
+
+$messages["textparser_plugin_enabled"] = "啟動外掛程式";
+$messages["textparser_plugin"] = "文章解析語法外掛程式";
+$messages["textparser_parser"] = "此解析語法會用在本網誌的所有文章編輯上,共有 Wiki、Textile、phpBB 與 Markdown 等四種語法。";
+
+$messages["textparser_settings_saved_ok"] = "文章解析語法設定儲存成功。";
+
+$messages["label_configuration"] = "設定";
+$messages["label_enable"] = "啟動";
+$messages["label_parser"] = "語法";
+?>
\ No newline at end of file
Modified: plugins/trunk/textparser/plugintextparser.class.php
===================================================================
--- plugins/trunk/textparser/plugintextparser.class.php 2005-02-24 04:00:39 UTC (rev 1197)
+++ plugins/trunk/textparser/plugintextparser.class.php 2005-02-24 07:49:23 UTC (rev 1198)
@@ -21,7 +21,7 @@
$this->desc = "A plugin that allows users to use wiki markup in their posts.";
$this->author = "The pLog Team";
$this->id = "textparser";
- $this->locales = Array( "en_UK" );
+ $this->locales = Array( "en_UK", "zh_TW" );
// register the event we are going to need
$this->registerNotification( EVENT_TEXT_FILTER );
@@ -31,7 +31,7 @@
$this->registerAdminAction( "updatePluginTextParserSettings", "AdminPluginTextParserUpdateSettingsAction" );
// and finally add an entry to the menu
- $this->addMenuEntry( "/menu/controlCenter/manageSettings", "Textparser", "admin.php?op=pluginTextParserSettings", "" );
+ $this->addMenuEntry( "/menu/Manage/managePosts", "TextParser", "admin.php?op=pluginTextParserSettings", "" );
}
/**
Modified: plugins/trunk/textparser/templates/settings.template
===================================================================
--- plugins/trunk/textparser/templates/settings.template 2005-02-24 04:00:39 UTC (rev 1197)
+++ plugins/trunk/textparser/templates/settings.template 2005-02-24 07:49:23 UTC (rev 1198)
@@ -1,20 +1,36 @@
{include file="$admintemplatepath/header.template"}
-{include file="$admintemplatepath/navigation.template" showOpt=Textparser title=$locale->tr("Textparser")}
-<p>
- <form name="settings" method="post">
- <input type="checkbox" name="pluginEnabled" value="1" {if $pluginEnabled}checked="checked"{/if}/>
- {$locale->tr("text_parser_enabled")}<br/><br/>
- {$locale->tr("text_parser_used")}:<br/>
- <select name="filter">
- <option value="1" {if $filter==1}selected="selected"{/if}>Wiki markup</option>
- <option value="2" {if $filter==2}selected="selected"{/if}>Textile</option>
- <option value="3" {if $filter==3}selected="selected"{/if}>phpBB</option>
- <option value="4" {if $filter==4}selected="selected"{/if}>Markdown</option>
- </select>
- <br/><br/>
+{include file="$admintemplatepath/navigation.template" showOpt=TextParser title=$locale->tr("textparser_plugin")}
+<form name="textparserSettings" method="post">
+ <fieldset class="inputField">
+ <legend>{$locale->tr("label_configuration")}</legend>
+ {include file="$admintemplatepath/successmessage.template"}
+ {include file="$admintemplatepath/errormessage.template"}
+ <div class="field">
+ <label for="pluginEnabled">{$locale->tr("label_enable")}</label>
+ <span class="required"></span>
+ <div class="formHelp">
+ <input class="checkbox" type="checkbox" name="pluginEnabled" id="pluginEnabled" {if $pluginEnabled} checked="checked" {/if} value="1" />{$locale->tr("textparser_plugin_enabled")}
+ </div>
+ </div>
+
+ <div class="field">
+ <label for="filter">{$locale->tr("label_parser")}</label>
+ <span class="required"></span>
+ <div class="formHelp">{$locale->tr("textparser_parser")}</div>
+ <select name="filter" id="filter">
+ <option value="1" {if $filter==1}selected="selected"{/if}>Wiki Markup</option>
+ <option value="2" {if $filter==2}selected="selected"{/if}>Textile</option>
+ <option value="3" {if $filter==3}selected="selected"{/if}>phpBB</option>
+ <option value="4" {if $filter==4}selected="selected"{/if}>Markdown</option>
+ </select>
+ </div>
+
+ </fieldset>
+ <div class="buttons">
<input type="hidden" name="op" value="updatePluginTextParserSettings" />
- <input type="submit" name="update" value="{$locale->tr("update_settings")}" />
- </form>
-</p>
+ <input type="reset" name="{$locale->tr("reset")}" />
+ <input type="submit" name="{$locale->tr("update_settings")}" value="{$locale->tr("update")}" />
+ </div>
+</form>
{include file="$admintemplatepath/footernavigation.template"}
{include file="$admintemplatepath/footer.template"}
\ No newline at end of file
More information about the pLog-svn
mailing list