[pLog-svn] r6795 - in plugins/branches/lifetype-1.2/clean: . class/action templates

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Fri Feb 13 14:41:45 EST 2009


Author: jondaley
Date: 2009-02-13 14:41:45 -0500 (Fri, 13 Feb 2009)
New Revision: 6795

Removed:
   plugins/branches/lifetype-1.2/clean/class/action/admincleandeleteblogaction.class.php
Modified:
   plugins/branches/lifetype-1.2/clean/pluginclean.class.php
   plugins/branches/lifetype-1.2/clean/templates/cleanblogs.template
Log:
we don't really need this action, we can just use the default deleteBlog function

Deleted: plugins/branches/lifetype-1.2/clean/class/action/admincleandeleteblogaction.class.php
===================================================================
--- plugins/branches/lifetype-1.2/clean/class/action/admincleandeleteblogaction.class.php	2009-02-13 19:19:47 UTC (rev 6794)
+++ plugins/branches/lifetype-1.2/clean/class/action/admincleandeleteblogaction.class.php	2009-02-13 19:41:45 UTC (rev 6795)
@@ -1,106 +0,0 @@
-<?php
-
-	lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
-    lt_include( PLOG_CLASS_PATH."plugins/clean/class/view/admincleanview.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/data/validator/arrayvalidator.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
-
-    /**
-     * \ingroup Action
-     * @private
-     *
-	 * it does not delete blogs from the system but simply set them to disabled
-	 */
-	class AdminCleanDeleteBlogAction extends AdminAction
-	{
-		var $_op;
-		var $_blogIds;
-
-    	function AdminCleanDeleteBlogAction( $actionInfo, $request )
-        {
-        	$this->AdminAction( $actionInfo, $request );
-
-			// set up the data validation stuff
-        	$this->_op = $actionInfo->getActionParamValue();
-        	if( $this->_op == "cleanDeleteBlogs" )
-        		$this->registerFieldvalidator( "blogIds", new ArrayValidator( new IntegerValidator()));
-        	else
-        		$this->registerFieldValidator( "blogId", new IntegerValidator());
-        	$view = new AdminCleanView( $this->_blogInfo );
-        	$view->setErrorMessage( $this->_locale->tr("error_no_blogs_selected"));
-        	$this->setValidationErrorView( $view );
-
-			$this->requireAdminPermission( "update_site_blog" );
-        }
-
-        function perform()
-        {
-        	if( $this->_op == "cleanDeleteBlog" ) {
-        		$this->_blogIds = Array();
-        		$this->_blogIds[] = $this->_request->getValue( "blogId" );
-        	}
-        	else
-        		$this->_blogIds = $this->_request->getValue( "blogIds" );
-
-        	$this->_disableBlogs();
-        }
-        
-		/**
-		 * @private
-		 */
-        function _disableBlogs()
-        {
-        	// get the default blog id
-        	$config =& Config::getConfig();
-            $defaultBlogId = $config->getValue( "default_blog_id" );
-
-        	$errorMessage = "";
-        	$successMessage = "";
-        	$totalOk = 0;
-
-            $blogs = new Blogs();
-        	foreach( $this->_blogIds as $blogId ) {
-            	// get some info about the blog before deleting it
-                $blogInfo = $blogs->getBlogInfo( $blogId );
-				if( !$blogInfo ) {
-					$errorMessage .= $this->_locale->pr("error_deleting_blog2", $blogId)."<br/>";
-                    continue;
-				}
-
-					// make sure we're not deleting the default one!
-                if( $defaultBlogId == $blogId ) {
-                    $errorMessage .= $this->_locale->pr("error_blog_is_default_blog",
-                                                        $blogInfo->getBlog())."<br />";
-                    continue;
-                }
-
-                $this->notifyEvent( EVENT_PRE_BLOG_DELETE, Array( "blog" => &$blogInfo ));
-
-                    // disable the blog
-                $blogInfo->setStatus( BLOG_STATUS_DISABLED );
-                if(!$blogs->updateBlog($blogInfo)){
-                    $errorMessage .= $this->_locale->pr("error_deleting_blog",
-                                                        $blogInfo->getBlog())."<br/>";
-                    continue;
-                }
-
-                $totalOk++;
-                if($totalOk < 2)
-                    $successMessage .= $this->_locale->pr("blog_deleted_ok", $blogInfo->getBlog());
-                else
-                    $successMessage = $this->_locale->pr( "blogs_deleted_ok", $totalOk );
-
-                $this->notifyEvent( EVENT_POST_BLOG_DELETE, Array( "blog" => &$blogInfo ));
-			}
-
-
-            $this->_view = new AdminCleanView( $this->_blogInfo );
-            if( $errorMessage != "" ) $this->_view->setErrorMessage( $errorMessage );
-            if( $successMessage != "" ) $this->_view->setSuccessMessage( $successMessage );
-            $this->setCommonData();
-
-            return true;
-        }
-    }
-?>

Modified: plugins/branches/lifetype-1.2/clean/pluginclean.class.php
===================================================================
--- plugins/branches/lifetype-1.2/clean/pluginclean.class.php	2009-02-13 19:19:47 UTC (rev 6794)
+++ plugins/branches/lifetype-1.2/clean/pluginclean.class.php	2009-02-13 19:41:45 UTC (rev 6795)
@@ -21,8 +21,6 @@
 		function init()
 		{
             $this->registerAdminAction( "cleanUnusedBlogs", "AdminCleanAction" );
-			$this->registerAdminAction( "cleanDeleteBlog", "AdminCleanDeleteBlogAction" );
-			$this->registerAdminAction( "cleanDeleteBlogs", "AdminCleanDeleteBlogAction" );			
 			
             $this->addMenuEntry( "/menu/adminSettings/Miscellaneous", "clean_unused_blogs",
                                  "?op=cleanUnusedBlogs",

Modified: plugins/branches/lifetype-1.2/clean/templates/cleanblogs.template
===================================================================
--- plugins/branches/lifetype-1.2/clean/templates/cleanblogs.template	2009-02-13 19:19:47 UTC (rev 6794)
+++ plugins/branches/lifetype-1.2/clean/templates/cleanblogs.template	2009-02-13 19:41:45 UTC (rev 6795)
@@ -99,7 +99,7 @@
        <td>
         <div class="list_action_button">
 	     {check_perms adminperm=update_site_blog}
-         <a href="?op=cleanDeleteBlog&amp;blogId={$siteblog->getId()}" title="{$locale->tr("delete")}">
+         <a href="?op=deleteBlog&amp;blogId={$siteblog->getId()}" title="{$locale->tr("delete")}">
 	       <img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" />
 	     </a>
          <a href="?op=editBlog&amp;blogId={$siteblog->getId()}" title="{$locale->tr("edit")}">
@@ -131,7 +131,7 @@
   <div id="list_action_bar">
 	{adminpager style="list"}
 	{check_perms adminperm=update_site_blog}
-    <input type="hidden" name="op" value="cleanDeleteBlogs"/>
+    <input type="hidden" name="op" value="deleteBlogs"/>
     <input type="submit" name="{$locale->tr("delete")}" value="{$locale->tr("delete")}"/>  
     {/check_perms}
 	{check_perms adminperm=update_site_blog}



More information about the pLog-svn mailing list