[pLog-svn] r3080 - in plog/trunk/class: action/admin dao view/admin

oscar at devel.lifetype.net oscar at devel.lifetype.net
Fri Mar 17 18:10:07 GMT 2006


Author: oscar
Date: 2006-03-17 18:10:07 +0000 (Fri, 17 Mar 2006)
New Revision: 3080

Modified:
   plog/trunk/class/action/admin/adminaddglobalarticlecategoryaction.class.php
   plog/trunk/class/action/admin/admindeleteglobalarticlecategoryaction.class.php
   plog/trunk/class/action/admin/adminupdateglobalarticlecategoryaction.class.php
   plog/trunk/class/dao/globalarticlecategories.class.php
   plog/trunk/class/dao/globalarticlecategory.class.php
   plog/trunk/class/view/admin/adminglobalarticlecategorieslistview.class.php
Log:
fixed some problems with global article categories


Modified: plog/trunk/class/action/admin/adminaddglobalarticlecategoryaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddglobalarticlecategoryaction.class.php	2006-03-17 17:53:12 UTC (rev 3079)
+++ plog/trunk/class/action/admin/adminaddglobalarticlecategoryaction.class.php	2006-03-17 18:10:07 UTC (rev 3080)
@@ -55,7 +55,7 @@
                                               	     $this->_categoryDescription );
 											   
 			// fire the pre event...
-			$this->notifyEvent( EVENT_PRE_GLOBAL_CATEGORY_ADD, Array( "category" => &$category ));
+			$this->notifyEvent( EVENT_PRE_ADD_GLOBAL_CATEGORY, Array( "category" => &$category ));
 
             // once we have built the object, we can add it to the database!
              if( $categories->addGlobalArticleCategory( $category )) {
@@ -68,7 +68,7 @@
 				$this->_view->setSuccessMessage( $this->_locale->pr("global_category_added_ok", $category->getName()));
 				
 				// fire the post event
-				$this->notifyEvent( EVENT_POST_GLOBAL_CATEGORY_ADD, Array( "category" => &$category ));
+				$this->notifyEvent( EVENT_POST_ADD_GLOBAL_CATEGORY, Array( "category" => &$category ));
 				
 				$this->setCommonData();				
             }

Modified: plog/trunk/class/action/admin/admindeleteglobalarticlecategoryaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admindeleteglobalarticlecategoryaction.class.php	2006-03-17 17:53:12 UTC (rev 3079)
+++ plog/trunk/class/action/admin/admindeleteglobalarticlecategoryaction.class.php	2006-03-17 18:10:07 UTC (rev 3080)
@@ -57,7 +57,7 @@
 			
             foreach( $this->_categoryIds as $categoryId ) {
             	// get the category
-            	$this->notifyEvent( EVENT_PRE_GLOBAL_CATEGORY_DELETE, Array( "category" => &$category ));
+            	$this->notifyEvent( EVENT_PRE_DELETE_GLOBAL_CATEGORY, Array( "category" => &$category ));
                 $category   = $categories->getGlobalArticleCategory( $categoryId );
 						if( $category ) {
 									// if everything correct, we can proceed and delete it
@@ -70,7 +70,7 @@
 								$successMessage = $this->_locale->pr( "global_categories_deleted_ok", $totalOk );
 								
 							// fire the pre-event
-							$this->notifyEvent( EVENT_POST_CATEGORY_DELETE, Array( "category" => &$category ));
+							$this->notifyEvent( EVENT_POST_DELETE_GLOBAL_CATEGORY, Array( "category" => &$category ));
 				
 					}
 				}

Modified: plog/trunk/class/action/admin/adminupdateglobalarticlecategoryaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateglobalarticlecategoryaction.class.php	2006-03-17 17:53:12 UTC (rev 3079)
+++ plog/trunk/class/action/admin/adminupdateglobalarticlecategoryaction.class.php	2006-03-17 18:10:07 UTC (rev 3080)
@@ -58,7 +58,7 @@
 		
         	// fetch the category we're trying to update
             $categories = new GlobalArticleCategories();
-            $category   = $categories->getCategory( $this->_categoryId );
+            $category   = $categories->getGlobalArticleCategory( $this->_categoryId );
             if( !$category ) {
             	$this->_view = new AdminGlobalArticleCategoriesListView( $this->_blogInfo );
                 $this->_view->setErrorMessage( $this->_locale->tr("error_fetching_category"));
@@ -68,11 +68,10 @@
             }
 			
 			// fire the pre-event
-			$this->notifyEvent( EVENT_PRE_CATEGORY_UPDATE, Array( "category" => &$category ));			
+			$this->notifyEvent( EVENT_PRE_UPDATE_GLOBAL_CATEGORY, Array( "category" => &$category ));			
 
             // update the fields
             $category->setName( $this->_categoryName );
-            $category->setUrl( "" );
          
 			$category->setProperties( $this->_properties );
 			$category->setDescription( $this->_categoryDescription );
@@ -80,7 +79,7 @@
 			// this is view we're going to use to show our messages
 			$this->_view = new AdminGlobalArticleCategoriesListView( $this->_blogInfo );			
 			
-            if( !$categories->updateCategory( $category )) {
+            if( !$categories->updateGlobalArticleCategory( $category )) {
                 $this->_view->setErrorMessage( $this->_locale->tr("error_updating_article_category"));
             }
 			else {
@@ -88,7 +87,7 @@
 				$this->_view->setSuccessMessage( $this->_locale->pr("article_category_updated_ok", $category->getName()));
 				
 				// fire the post-event
-				$this->notifyEvent( EVENT_POST_CATEGORY_UPDATE, Array( "category" => &$category ));			
+				$this->notifyEvent( EVENT_POST_UPDATE_GLOBAL_CATEGORY, Array( "category" => &$category ));			
 				
 				// clear the cache
 				CacheControl::resetBlogCache( $this->_blogInfo->getId());			

Modified: plog/trunk/class/dao/globalarticlecategories.class.php
===================================================================
--- plog/trunk/class/dao/globalarticlecategories.class.php	2006-03-17 17:53:12 UTC (rev 3079)
+++ plog/trunk/class/dao/globalarticlecategories.class.php	2006-03-17 18:10:07 UTC (rev 3080)
@@ -36,7 +36,7 @@
 		function addGlobalArticleCategory( &$category )
 		{
 			if( ($result = $this->add( $category, Array( CACHE_GLOBALCATEGORIES => "getId" )))) {
-				$this->_cache->removeData( "all", CACHE_GLOBALCATEGORIES_ALL );
+				$this->_cache->removeData( "_all_", CACHE_GLOBALCATEGORIES_ALL );
 			}
 				
 			return( $result );
@@ -54,7 +54,7 @@
 		{
 			if( ($result = $this->delete( "id", $id ))) {
 				$this->_cache->removeData( $id, CACHE_GLOBALCATEGORIES );
-				$this->_cache->removeData( "all", CACHE_GLOBALCATEGORIES_ALL );
+				$this->_cache->removeData( "_all_", CACHE_GLOBALCATEGORIES_ALL );
 			}
 			
 			return( $result );
@@ -70,7 +70,7 @@
 		{
 			if(( $result = $this->update( $category ))) {
 				$this->_cache->removeData( $category->getId(), CACHE_GLOBALCATEGORIES );
-				$this->_cache->removeData( "all", CACHE_GLOBALCATEGORIES_ALL );
+				$this->_cache->removeData( "_all_", CACHE_GLOBALCATEGORIES_ALL );
 			}
 			
 			return( $result );

Modified: plog/trunk/class/dao/globalarticlecategory.class.php
===================================================================
--- plog/trunk/class/dao/globalarticlecategory.class.php	2006-03-17 17:53:12 UTC (rev 3079)
+++ plog/trunk/class/dao/globalarticlecategory.class.php	2006-03-17 18:10:07 UTC (rev 3080)
@@ -15,6 +15,9 @@
 		var $_name;
 		var $_description;
 		var $_properties;
+		var $_mangledName;
+		var $_numArticles;
+		var $_numActiveArticles;
 
 		function GlobalArticleCategory( $name, $description = "", $properties = Array(), $id = -1 )
 		{
@@ -26,7 +29,7 @@
 			$this->_properties = $properties;
 			$this->_numArticles = 0;
 			$this->_numActiveArticles = 0;
-			$this->_mangledName;
+			$this->_mangledName = "";
 			
 			$this->_pk = "id";
 			$this->_fields = Array( "id" => "getId",
@@ -90,11 +93,11 @@
 		 * @param status A valid post status
          * @return An integer value
          */
-        function getNumArticles( $status = ARTICLE_STATUS_ACTIVE )        
+        function getNumArticles( $status = POST_STATUS_PUBLISHED )        
         {
-        	if( $status == ARTICLE_STATUS_ALL )
+        	if( $status == POST_STATUS_ALL )
         		return( $this->_numArticles );
-        	elseif( $status == ARTICLE_STATUS_ACTIVE )
+        	elseif( $status == POST_STATUS_PUBLISHED )
         		return( $this->_numActiveArticles );
         	else {
 	        	include_once( PLOG_CLASS_PATH."class/dao/globalarticlecategories.class.php" );        	

Modified: plog/trunk/class/view/admin/adminglobalarticlecategorieslistview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminglobalarticlecategorieslistview.class.php	2006-03-17 17:53:12 UTC (rev 3079)
+++ plog/trunk/class/view/admin/adminglobalarticlecategorieslistview.class.php	2006-03-17 18:10:07 UTC (rev 3080)
@@ -28,7 +28,10 @@
         {
         	$this->AdminTemplatedView( $blogInfo, "globalarticlecategories" );
 			
-			$this->_searchTerms = $params['searchTerms'];
+			if( isset( $params['searchTerms'] ))
+				$this->_searchTerms = $params['searchTerms'];
+			else
+				$this->_searchTerms = "";
         }
 
         /**



More information about the pLog-svn mailing list