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

mark at devel.lifetype.net mark at devel.lifetype.net
Mon Mar 20 04:37:19 GMT 2006


Author: mark
Date: 2006-03-20 04:37:17 +0000 (Mon, 20 Mar 2006)
New Revision: 3089

Modified:
   plog/trunk/class/action/admin/adminglobalsettingsaction.class.php
   plog/trunk/class/action/admin/adminupdateglobalsettingsaction.class.php
   plog/trunk/class/view/admin/adminglobalsettingslistview.class.php
   plog/trunk/templates/admin/globalsettings.template
Log:
Fix the global settings to use the $this->_request object to decide which page to show instead of using $smarty.request.show

Modified: plog/trunk/class/action/admin/adminglobalsettingsaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminglobalsettingsaction.class.php	2006-03-19 22:21:42 UTC (rev 3088)
+++ plog/trunk/class/action/admin/adminglobalsettingsaction.class.php	2006-03-20 04:37:17 UTC (rev 3089)
@@ -19,8 +19,8 @@
         function perform()
         {
             // if no problem, continue
-            $section = $this->_request->getValue( "section" );
-            $this->_view = new AdminGlobalSettingsListView( $this->_blogInfo, $section );
+            $show = $this->_request->getValue( "show" );
+            $this->_view = new AdminGlobalSettingsListView( $this->_blogInfo, $show );
             $this->setCommonData();
 
             return true;

Modified: plog/trunk/class/action/admin/adminupdateglobalsettingsaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateglobalsettingsaction.class.php	2006-03-19 22:21:42 UTC (rev 3088)
+++ plog/trunk/class/action/admin/adminupdateglobalsettingsaction.class.php	2006-03-20 04:37:17 UTC (rev 3089)
@@ -51,6 +51,9 @@
 
         function perform()
         {
+        	// get the global setting section
+        	$show = $this->_request->getValue( "show" );
+        	
         	// we can proceed to update the config
             foreach( $this->_newConfigOpts as $key => $value ) {
             	$this->_config->setValue( $key, $value );
@@ -60,14 +63,14 @@
 
             // depending on the result, we shall show one thing or another...
             if( $res ) {
-            	$this->_view = new AdminGlobalSettingsListView( $this->_blogInfo );
+            	$this->_view = new AdminGlobalSettingsListView( $this->_blogInfo, $show );
                 $this->_view->setSuccessMessage( $this->_locale->tr("site_config_saved_ok"));
                 $this->setCommonData();
 				// clear the contents of all the caches
 				CacheControl::resetAllCaches();
             }
             else {
-            	$this->_view = new AdminGlobalSettingsListView( $this->_blogInfo );
+            	$this->_view = new AdminGlobalSettingsListView( $this->_blogInfo, $show );
                 $this->_view->setErrorMessage( $this->_locale->tr("error_saving_site_config"));
                 $this->setCommonData();
             }

Modified: plog/trunk/class/view/admin/adminglobalsettingslistview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminglobalsettingslistview.class.php	2006-03-19 22:21:42 UTC (rev 3088)
+++ plog/trunk/class/view/admin/adminglobalsettingslistview.class.php	2006-03-20 04:37:17 UTC (rev 3089)
@@ -4,6 +4,8 @@
 	include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
 	include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
 	
+	define( "ADMINISTRATOR_BLOG", 1 );
+	
     /**
      * \ingroup View
      * @private
@@ -12,27 +14,26 @@
 	 */
 	class AdminGlobalSettingsListView extends AdminTemplatedView
 	{
-		var $_section;
+		var $_show;
 		
-	    // list with the defined sections
+	    // list with the defined shows
 	
-		function AdminGlobalSettingsListView( $blogInfo, $section = "all" )
+		function AdminGlobalSettingsListView( $blogInfo, $show = "all" )
 		{
 			$this->AdminTemplatedView( $blogInfo, "globalsettings" );
+			$this->_show = $show;
 			
-			$this->_section = $section;
-			
-			// array with the defined sections
-			$this->_sections = Array( "general", "summary", "templates", "url", "email",
+			// array with the defined shows
+			$this->_shows = Array( "general", "summary", "templates", "url", "email",
 	                                  "uploads", "helpers", "interfaces", "security",
 	                                  "bayesian", "resources", "search" );			
 		}
 		
 		function render()
 		{
-			// if the section is not correct, then use the default "general"
-			if( !in_array( $this->_section, $this->_sections ))
-				$this->_section = "general";
+			// if the show is not correct, then use the default "general"
+			if( !in_array( $this->_show, $this->_shows ))
+				$this->_show = "general";
 			 
 			// export all the config parameters
             $config =& Config::getConfig();
@@ -42,9 +43,9 @@
             	$this->setValue( $key, $value );
             }			
 			$this->setValue( "blogId", $config->getValue( "default_blog_id" ));
-
-            // set the section too
-            $this->setValue( "section", $this->_section );
+			
+            // set the show too
+            $this->setValue( "show", $this->_show );
             
             parent::render();
 		}

Modified: plog/trunk/templates/admin/globalsettings.template
===================================================================
--- plog/trunk/templates/admin/globalsettings.template	2006-03-19 22:21:42 UTC (rev 3088)
+++ plog/trunk/templates/admin/globalsettings.template	2006-03-20 04:37:17 UTC (rev 3089)
@@ -1,48 +1,48 @@
-{if $smarty.request.show == "general"}
+{if $show == "general"}
 {assign var=file value="$admintemplatepath/globalsettings_general.template"}
 {assign var=show value="general"}
 {assign var=optName value="editSiteSettings"}
-{elseif $smarty.request.show == "summary"}
+{elseif $show == "summary"}
 {assign var=file value="$admintemplatepath/globalsettings_summary.template"}
 {assign var=show value="summary"}
 {assign var=optName value="summarySettings"}
-{elseif $smarty.request.show == "templates"}
+{elseif $show == "templates"}
 {assign var=file value="$admintemplatepath/globalsettings_templates.template"}
 {assign var=show value="templates"}
 {assign var=optName value="templateSettings"}
-{elseif $smarty.request.show == "urls"}
+{elseif $show == "urls"}
 {assign var=file value="$admintemplatepath/globalsettings_url.template"}
 {assign var=show value="urls"}
 {assign var=optName value="urlSettings"}
-{elseif $smarty.request.show == "email"}
+{elseif $show == "email"}
 {assign var=file value="$admintemplatepath/globalsettings_email.template"}
 {assign var=show value="email"}
 {assign var=optName value="emailSettings"}
-{elseif $smarty.request.show == "helpers"}
+{elseif $show == "helpers"}
 {assign var=file value="$admintemplatepath/globalsettings_helpers.template"}
 {assign var=show value="helpers"}
 {assign var=optName value="helpersSettings"}
-{elseif $smarty.request.show == "upload"}
+{elseif $show == "upload"}
 {assign var=file value="$admintemplatepath/globalsettings_uploads.template"}
 {assign var=show value="upload"}
 {assign var=optName value="uploadSettings"}
-{elseif $smarty.request.show == "interfaces"}
+{elseif $show == "interfaces"}
 {assign var=file value="$admintemplatepath/globalsettings_interfaces.template"}
 {assign var=show value="interfaces"}
 {assign var=optName value="interfacesSettings"}
-{elseif $smarty.request.show == "security"}
+{elseif $show == "security"}
 {assign var=file value="$admintemplatepath/globalsettings_security.template"}
 {assign var=show value="security"}
 {assign var=optName value="securitySettings"}
-{elseif $smarty.request.show == "bayesian"}
+{elseif $show == "bayesian"}
 {assign var=file value="$admintemplatepath/globalsettings_bayesian.template"}
 {assign var=show value="bayesian"}
 {assign var=optName value="bayesianSettings"}
-{elseif $smarty.request.show == "resources"}
+{elseif $show == "resources"}
 {assign var=file value="$admintemplatepath/globalsettings_resources.template"}
 {assign var=show value="resources"}
 {assign var=optName value="resourcesSettings"}
-{elseif $smarty.request.show == "search"}
+{elseif $show == "search"}
 {assign var=file value="$admintemplatepath/globalsettings_search.template"}
 {assign var=show value="search"}
 {assign var=optName value="searchSettings"}



More information about the pLog-svn mailing list