[pLog-svn] r6004 - in plog/trunk: class/action/admin class/dao class/data/pager class/locale class/view/admin locale locale/admin templates/LifeType/en_UK

mark at devel.lifetype.net mark at devel.lifetype.net
Tue Oct 23 05:02:42 EDT 2007


Author: mark
Date: 2007-10-23 05:02:41 -0400 (Tue, 23 Oct 2007)
New Revision: 6004

Modified:
   plog/trunk/class/action/admin/adminaddresourceaction.class.php
   plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php
   plog/trunk/class/dao/blogs.class.php
   plog/trunk/class/data/pager/pager.class.php
   plog/trunk/class/locale/locales.class.php
   plog/trunk/class/view/admin/adminresourceslistview.class.php
   plog/trunk/locale/admin/locale_fr_FR.php
   plog/trunk/locale/locale_zh_CN.php
   plog/trunk/locale/locale_zh_TW.php
   plog/trunk/templates/LifeType/en_UK/strings.txt
Log:
Merge from LifeType 1.2 development branches rev. 5700:5750

Modified: plog/trunk/class/action/admin/adminaddresourceaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddresourceaction.class.php	2007-10-23 08:40:56 UTC (rev 6003)
+++ plog/trunk/class/action/admin/adminaddresourceaction.class.php	2007-10-23 09:02:41 UTC (rev 6004)
@@ -78,7 +78,7 @@
         	$resources = new GalleryResources();
 			
 			if( $this->_destView == "resourceList" ) {
-				$this->_view = new AdminSimpleResourcesListView( $this->_blogInfo, Array( "albumId" => $this->_albumId ));
+				$this->_view = new AdminSimpleResourcesListView( $this->_blogInfo, Array( "albumId" => $this->_albumId, "gotoLastPage" => true ));
 				$this->_view->setValue( "destination", $this->_destination );
 			}
 			elseif ($this->_destView == "userPictureSelect" ) {
@@ -86,7 +86,7 @@
 				$this->_view->setValue( "destination", $this->_destination );
 			}
 			else
-				$this->_view = new AdminResourcesListView( $this->_blogInfo, Array( "albumId" => $this->_albumId ));
+				$this->_view = new AdminResourcesListView( $this->_blogInfo, Array( "albumId" => $this->_albumId, "gotoLastPage" => true ));
 			
 			$successMessage = "";
 			$errorMessage = "";

Modified: plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php	2007-10-23 08:40:56 UTC (rev 6003)
+++ plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php	2007-10-23 09:02:41 UTC (rev 6004)
@@ -83,7 +83,7 @@
 			$album = $this->addAlbum();
 			
             if( $this->userHasPermission( "view_resources" ))
-           		$this->_view = new AdminResourcesListView( $this->_blogInfo, Array( "albumId" => $this->_parentId ));
+           		$this->_view = new AdminResourcesListView( $this->_blogInfo, Array( "albumId" => $this->_parentId, "gotoLastPage" => true ));
            	else
            		$this->_view = new AdminNewAlbumView( $this->_blogInfo );
            	

Modified: plog/trunk/class/dao/blogs.class.php
===================================================================
--- plog/trunk/class/dao/blogs.class.php	2007-10-23 08:40:56 UTC (rev 6003)
+++ plog/trunk/class/dao/blogs.class.php	2007-10-23 09:02:41 UTC (rev 6004)
@@ -224,7 +224,7 @@
             }
 				
 			if( $where != "" )
-				$where = " WHERE $where";
+				$where = " WHERE $where";			
 
             $query = "SELECT * FROM ".$this->getPrefix()."blogs $where ORDER BY id DESC";
 
@@ -370,4 +370,4 @@
             return $blogInfo;
         }
     }
-?>
\ No newline at end of file
+?>

Modified: plog/trunk/class/data/pager/pager.class.php
===================================================================
--- plog/trunk/class/data/pager/pager.class.php	2007-10-23 08:40:56 UTC (rev 6003)
+++ plog/trunk/class/data/pager/pager.class.php	2007-10-23 09:02:41 UTC (rev 6004)
@@ -89,6 +89,17 @@
             $this->_baseUrl = $url;
         }
 
+		/**
+		 * Sets the current page
+		 *
+		 * @param curPage
+		 */
+		function setCurPage( $curPage )
+		{
+			$this->_curPage = $curPage;
+			$this->_init();
+		}
+
         /**
         * @return returns the base url
         */

Modified: plog/trunk/class/locale/locales.class.php
===================================================================
--- plog/trunk/class/locale/locales.class.php	2007-10-23 08:40:56 UTC (rev 6003)
+++ plog/trunk/class/locale/locales.class.php	2007-10-23 09:02:41 UTC (rev 6004)
@@ -291,6 +291,19 @@
         }
 
         /**
+         * Given a locale code, returns the path to the file that contains its admin version.
+         *
+         * @param localeCode The code representing the locale
+         * @return A string containing the path (may be absolute or relative, it depends)
+         * to the file containing the given locale. It does *not* check if the file exists
+         * or not, simply returns its path.
+         */
+        function getAdminLocaleFilename( $localeCode )
+        {
+        	return (Locale::getLocaleFolder()."/admin/locale_".$localeCode.".php");
+        }
+
+        /**
          * Removes a locale from the system. First the file containing it is deleted
          * and then we also remove its entry from the configuration.
          *
@@ -310,12 +323,18 @@
             if( !$this->isValidLocale( $localeCode ))
             	return false;
 
+			// remove the blog locale
             $fileName = $this->getLocaleFilename( $localeCode );
-
 			if( File::exists( $fileName )) {
 	            if( !unlink( $fileName ))
         	    	return false;
 			}
+			// and the admin locale
+            $fileName = $this->getAdminLocaleFilename( $localeCode );
+			if( File::exists( $fileName )) {
+	            if( !unlink( $fileName ))
+        	    	return false;
+			}			
 
             $availableLocales = $config->getValue( "locales" );
 

Modified: plog/trunk/class/view/admin/adminresourceslistview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminresourceslistview.class.php	2007-10-23 08:40:56 UTC (rev 6003)
+++ plog/trunk/class/view/admin/adminresourceslistview.class.php	2007-10-23 09:02:41 UTC (rev 6004)
@@ -80,6 +80,20 @@
 					$this->_albumId = ROOT_ALBUM_ID;
 				}
 				else {				
+					// total number of resources in this album, used by the pager
+					$numResources = $galleryResources->getNumUserResources( $this->_blogInfo->getId(),
+					                                                        $this->_albumId,
+					                                                        $this->_resourceType,
+																			$this->_searchTerms,
+																			$this->_locationId );				
+					
+					// create and export the pager
+					$pager = new Pager( $this->_pagerUrl, $this->_page, $numResources, DEFAULT_ITEMS_PER_PAGE );
+					if( isset( $this->_viewParams["gotoLastPage"] )) {
+						$pager->setCurPage( $pager->getEndPage());
+						$this->_page = $pager->getEndPage();
+					}
+					
 					// resources for this page
 					$resources = $galleryResources->getUserResources( $this->_blogInfo->getId(),
 					                                                  $this->_albumId,
@@ -88,19 +102,19 @@
 																	  $this->_locationId,
 					                                                  $this->_page,
 					                                                  DEFAULT_RESOURCES_PER_PAGE );
-																	  
-					// total number of resources in this album, used by the pager
-					$numResources = $galleryResources->getNumUserResources( $this->_blogInfo->getId(),
-					                                                        $this->_albumId,
-					                                                        $this->_resourceType,
-																			$this->_searchTerms,
-																			$this->_locationId );
 				}
 			}
 			else {
 				$album = null;
 				// if we're at the root album but search terms, still call GalleryResources::getUserResources
 				if( $this->_searchTerms || $this->_locationId > -1 ) {
+					// total number of resources for the pager
+					$numResources = $galleryResources->getNumUserResources( $this->_blogInfo->getId(),
+					                                                        GalleryConstants::GALLERY_NO_ALBUM,
+					                                                        $this->_resourceType,
+																			$this->_searchTerms,
+																			$this->_locationId );																		
+					
 					// load the resources matching the given string from *all* albums
 					$resources = $galleryResources->getUserResources( $this->_blogInfo->getId(),
 					                                                  GalleryConstants::GALLERY_NO_ALBUM,
@@ -109,17 +123,13 @@
 																	  $this->_locationId,
 					                                                  $this->_page,						
 					                                                  DEFAULT_RESOURCES_PER_PAGE );
-					// total number of resources for the pager
-					$numResources = $galleryResources->getNumUserResources( $this->_blogInfo->getId(),
-					                                                        GalleryConstants::GALLERY_NO_ALBUM,
-					                                                        $this->_resourceType,
-																			$this->_searchTerms,
-																			$this->_locationId );
 				}
 				else {
 					$albums = $galleryAlbums->getChildAlbums( $this->_albumId, $this->_blogInfo->getId(), $this->_searchTerms );
 					$resources = Array();
 				}
+				// create and export the pager
+				$pager = new Pager( $this->_pagerUrl, $this->_page, $numResources, DEFAULT_ITEMS_PER_PAGE );				
 			}
 			
 			// get a list with the nested albums
@@ -155,12 +165,10 @@
 			$this->notifyEvent( EVENT_RESOURCES_LOADED, Array ( "resources" => &$resources ));
 			$this->setValue( "resources", $resources );
 
-			// finally, create and export the pager
-			$pager = new Pager( $this->_pagerUrl, $this->_page, $numResources, DEFAULT_RESOURCES_PER_PAGE );
-			$this->setValue( "pager", $pager );
+			$this->setValue( "pager", $pager );	
 			$this->setValue( "searchTerms", $this->_searchTerms );
 			
 			parent::render();
 		}
 	}
-?>
\ No newline at end of file
+?>

Modified: plog/trunk/locale/admin/locale_fr_FR.php
===================================================================
--- plog/trunk/locale/admin/locale_fr_FR.php	2007-10-23 08:40:56 UTC (rev 6003)
+++ plog/trunk/locale/admin/locale_fr_FR.php	2007-10-23 09:02:41 UTC (rev 6004)
@@ -293,8 +293,8 @@
 $messages['resource_deleted_ok'] = 'Ressource « %s » supprimée';
 $messages['album_deleted_ok'] = 'Album « %s » supprimé';
 $messages['add_resource'] = 'Ajouter la ressource';
-$messages['add_resource_preview'] = 'Aperçu de la ressource';
-$messages['add_resource_medium'] = 'Aperçu moyenne de la ressource';
+$messages['add_resource_preview'] = 'Ajouter un aperçu (petit)';
+$messages['add_resource_medium'] = 'Ajouter un aperçu (moyen)';
 $messages['add_album'] = 'Ajouter l’album';
 $messages['album_name_help'] = 'Nom court du nouvel album.';
 $messages['parent'] = 'Parent';
@@ -677,7 +677,7 @@
 $messages['trackback_marked_as_spam_ok'] = 'Rétrolien marqué comme indésirable';
 $messages['error_marking_trackback_as_nonspam'] = 'Erreur lors du marquage du rétrolien comme désirable';
 $messages['trackback_marked_as_nonspam_ok'] = 'Rétrolien marqué comme désirable';
-$messages['upload_here'] = 'Téléverser ici';
+$messages['upload_here'] = 'Téléverser…';
 $messages['reply_string'] = 'À';
 $messages['cleanup_users'] = 'Purge des utilisateurs';
 $messages['cleanup_users_help'] = 'Cette action purge tous les utilisateurs qui avaient été supprimés par l’administrateur (marqués comme « supprimés »). Il enlèvera également tous les blogs et leurs contenus de cet utilisateur. Si un utilisateur avait des droits pour poster dans d’autres blogs, tous ses posts seront supprimés. Il n’est pas possible de revenir en arrière après la purge.';

Modified: plog/trunk/locale/locale_zh_CN.php
===================================================================
--- plog/trunk/locale/locale_zh_CN.php	2007-10-23 08:40:56 UTC (rev 6003)
+++ plog/trunk/locale/locale_zh_CN.php	2007-10-23 09:02:41 UTC (rev 6004)
@@ -92,7 +92,7 @@
 $messages['about'] = '关于';
 $messages['download'] = '下载';
 $messages['error_incorrect_email_address'] = '电子邮件信箱格式错误。';
-$messages['invalid_url'] = 'You entered an invalid URL. Please correct and try again';
+$messages['invalid_url'] = '网址格式错误,请输入正确格式';
 
 ////// error messages /////
 $messages['error_fetching_article'] = '找不到您所指定的文章。';

Modified: plog/trunk/locale/locale_zh_TW.php
===================================================================
--- plog/trunk/locale/locale_zh_TW.php	2007-10-23 08:40:56 UTC (rev 6003)
+++ plog/trunk/locale/locale_zh_TW.php	2007-10-23 09:02:41 UTC (rev 6004)
@@ -92,7 +92,7 @@
 $messages['about'] = '關於';
 $messages['download'] = '下載';
 $messages['error_incorrect_email_address'] = '電子郵件信箱格式錯誤。';
-$messages['invalid_url'] = 'You entered an invalid URL. Please correct and try again';
+$messages['invalid_url'] = '網址格式錯誤,請輸入正確格式';
 
 ////// error messages /////
 $messages['error_fetching_article'] = '找不到您所指定的文章。';

Modified: plog/trunk/templates/LifeType/en_UK/strings.txt
===================================================================
--- plog/trunk/templates/LifeType/en_UK/strings.txt	2007-10-23 08:40:56 UTC (rev 6003)
+++ plog/trunk/templates/LifeType/en_UK/strings.txt	2007-10-23 09:02:41 UTC (rev 6004)
@@ -1,7 +1,7 @@
 ltTagline = """LifeType is an open-source blogging platform with support for multiple blogs and users
 in a single installation."""
 
-frontPageLeft = """The latest stable version of LifeType is <b>1.2.3</b>. Click the link below to download.<br/>
+frontPageLeft = """The latest stable version of LifeType is <b>1.2.4</b>. Click the link below to download.<br/>
 Take a look at the <a href="http://www.lifetype.net/blog.php/lifetype-development-journal/page/downloads">Downloads</a> section for more download packages,
 additional template sets and plugins."""
 
@@ -299,9 +299,9 @@
 These are the official downloadable packages containing the most recent stable version. Packages
 are available compressed in either .tar.gz or .zip, and are provided via SourceForge.net.
 <br/><br/>
-<a href="http://prdownloads.sourceforge.net/lifetype/lifetype-1.2.3.tar.gz?download">LifeType 1.2.3 (tar.gz format)</a><br/>
-<a href="http://prdownloads.sourceforge.net/lifetype/lifetype-1.2.3.tar.bz2?download">LifeType 1.2.3 (tar.bz2 format)</a><br/>
-<a href="http://prdownloads.sourceforge.net/lifetype/lifetype-1.2.3.zip?download">LifeType 1.2.3 (zip format)</a><br/>
+<a href="http://prdownloads.sourceforge.net/lifetype/lifetype-1.2.4.tar.gz?download">LifeType 1.2.4 (tar.gz format)</a><br/>
+<a href="http://prdownloads.sourceforge.net/lifetype/lifetype-1.2.4.tar.bz2?download">LifeType 1.2.4 (tar.bz2 format)</a><br/>
+<a href="http://prdownloads.sourceforge.net/lifetype/lifetype-1.2.4.zip?download">LifeType 1.2.4 (zip format)</a><br/>
 </p>
 
 <h2>Plugins</h2>



More information about the pLog-svn mailing list