[pLog-svn] r5708 - plog/branches/lifetype-1.2/class/locale

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sun Jul 22 14:38:03 EDT 2007


Author: oscar
Date: 2007-07-22 14:38:03 -0400 (Sun, 22 Jul 2007)
New Revision: 5708

Modified:
   plog/branches/lifetype-1.2/class/locale/locales.class.php
Log:
Fixed issue http://bugs.lifetype.net/view.php?id=1354 -- the admin locale is also now removed when removing a locale (previously it would only remove the front-end one)

Modified: plog/branches/lifetype-1.2/class/locale/locales.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/locale/locales.class.php	2007-07-22 18:30:04 UTC (rev 5707)
+++ plog/branches/lifetype-1.2/class/locale/locales.class.php	2007-07-22 18:38:03 UTC (rev 5708)
@@ -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" );
 



More information about the pLog-svn mailing list