[pLog-svn] r6048 - in plog/trunk: class/view/admin templates/admin

mark at devel.lifetype.net mark at devel.lifetype.net
Fri Nov 16 02:42:45 EST 2007


Author: mark
Date: 2007-11-16 02:42:45 -0500 (Fri, 16 Nov 2007)
New Revision: 6048

Modified:
   plog/trunk/class/view/admin/adminnewpostview.class.php
   plog/trunk/templates/admin/newpost.template
Log:
Add the default value to postStatus, or it will cause AjaxFromProcesser in IE.

It is really sucks that IE reset the form and does not assign a default value to selection ... :(

Firefox does assign the value ...

But, I have no idea which browser implement the right behavior.

Modified: plog/trunk/class/view/admin/adminnewpostview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminnewpostview.class.php	2007-11-16 07:38:05 UTC (rev 6047)
+++ plog/trunk/class/view/admin/adminnewpostview.class.php	2007-11-16 07:42:45 UTC (rev 6048)
@@ -1,20 +1,20 @@
 <?php
 
-    
-    
-    
-        
-    
-    
-    
-    
+
+
+
+
+
+
+
+
     /**
      * \ingroup View
      * @private
-     */    
+     */
     class AdminNewPostView extends AdminTemplatedView
     {
-    
+
         function AdminNewPostView( $blogInfo )
         {
             $this->AdminTemplatedView( $blogInfo, "newpost" );
@@ -22,15 +22,15 @@
 
         function render()
         {
-            
 
+
             // fetch the categories
             $categories = new ArticleCategories();
             $blogSettings = $this->_blogInfo->getSettings();
             $categoriesOrder = $blogSettings->getValue( "categories_order" );
             $blogCategories = $categories->getBlogCategories( $this->_blogInfo->getId(),
                                                               false, $categoriesOrder );
-            
+
             // global article categories
             $globalArticleCategories = new GlobalArticleCategories();
             $globalCategories = $globalArticleCategories->getGlobalArticleCategories();
@@ -56,12 +56,12 @@
             $this->setValue( "hours", Timestamp::getAllHours());
             $this->setValue( "minutes", Timestamp::getAllMinutes());
             $this->setValue( "customfields", $blogFields );
-            $this->setValue( "poststatus", ArticleStatus::getStatusList());
+            $this->setValue( "articlestatus", ArticleStatus::getStatusList());
             $this->setValue( "sendPings", $config->getValue( "send_xmlrpc_pings_enabled_by_default", true ));
             $this->setValue( "xmlRpcPingEnabled", $config->getValue( "xmlrpc_ping_enabled", false ));
             $this->setValue( "autoSaveNewDraftsTimeMillis", $config->getValue( "autosave_new_drafts_time_millis" ));
             if(!$this->getValue("postDateTime"))
-                $this->setValue( "postDateTime", $t->getDay()."/".$t->getMonth()."/".$t->getYear()." ".$t->getHour().":".$t->getMinutes());    
+                $this->setValue( "postDateTime", $t->getDay()."/".$t->getMonth()."/".$t->getYear()." ".$t->getHour().":".$t->getMinutes());
 
             parent::render();
         }

Modified: plog/trunk/templates/admin/newpost.template
===================================================================
--- plog/trunk/templates/admin/newpost.template	2007-11-16 07:38:05 UTC (rev 6047)
+++ plog/trunk/templates/admin/newpost.template	2007-11-16 07:42:45 UTC (rev 6048)
@@ -96,7 +96,8 @@
 		 <span class="required">*</span>
 		 <div class="formHelp">{$locale->tr("post_status_help")}</div>
 		 <select name="postStatus" id="postStatus">
-		   {foreach from=$poststatus key=name item=status}
+		   {if empty($postStatus)}{assign var=postStatus value=1}{/if}
+		   {foreach from=$articlestatus key=name item=status}
              {if $name != "post_status_deleted"}
                <option value="{$status}" {if $postStatus == $status}
                   selected="selected"{/if}>{$locale->tr($name)}</option>



More information about the pLog-svn mailing list