[pLog-svn] r5744 - in plog/trunk: class/action/admin class/template/smarty/plugins js/location js/ui/pages locale locale/admin templates/admin

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sat Jul 28 07:06:46 EDT 2007


Author: oscar
Date: 2007-07-28 07:06:46 -0400 (Sat, 28 Jul 2007)
New Revision: 5744

Modified:
   plog/trunk/class/action/admin/adminaction.class.php
   plog/trunk/class/action/admin/adminaddpostaction.class.php
   plog/trunk/class/action/admin/adminchangepostslocationaction.class.php
   plog/trunk/class/template/smarty/plugins/function.location_chooser.php
   plog/trunk/js/location/location.js
   plog/trunk/js/ui/pages/posts.js
   plog/trunk/locale/admin/locale_en_UK.php
   plog/trunk/locale/locale_en_UK.php
   plog/trunk/templates/admin/editposts.template
   plog/trunk/templates/admin/editposts_table.template
   plog/trunk/templates/admin/jslocale.template
Log:
Some more fixes and localization for the Google Maps stuff


Modified: plog/trunk/class/action/admin/adminaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaction.class.php	2007-07-28 09:21:37 UTC (rev 5743)
+++ plog/trunk/class/action/admin/adminaction.class.php	2007-07-28 11:06:46 UTC (rev 5744)
@@ -322,11 +322,12 @@
 		function getLocationFromRequest()
 		{
 			$config =& Config::getConfig();
-			if( $config->getValue( "location_data_enabled", false )) {
+			if( $config->getValue( "location_data_enabled", false ))
 				$locId = $this->_request->getValue( "locationId");
-			}
+			else
+				$locId = 0;
 			
-			return 0;
+			return $locId;
 		}
 		
 		/**

Modified: plog/trunk/class/action/admin/adminaddpostaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddpostaction.class.php	2007-07-28 09:21:37 UTC (rev 5743)
+++ plog/trunk/class/action/admin/adminaddpostaction.class.php	2007-07-28 11:06:46 UTC (rev 5744)
@@ -33,6 +33,7 @@
         	$this->registerFieldValidator( "globalArticleCategoryId", new IntegerValidator(), true,  $this->_locale->tr("error_no_global_article_category_selected"));
 			$this->registerFieldValidator( "postUser", new IntegerValidator(), false, $this->_locale->tr("error_invalid_user" ));
 			$this->registerFieldValidator( "postStatus", new IntegerValidator(), false, $this->_locale->tr( "error_incorrect_value" ));
+			$this->registerFieldValidator( "locationId", new IntegerValidator(), true, $this->_locale->tr("error_incorrect_value" ));
         	$view = new AdminNewPostView( $this->_blogInfo );
         	$view->setErrorMessage( $this->_locale->tr("error_adding_post"));
         	$this->setValidationErrorView( $view );

Modified: plog/trunk/class/action/admin/adminchangepostslocationaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminchangepostslocationaction.class.php	2007-07-28 09:21:37 UTC (rev 5743)
+++ plog/trunk/class/action/admin/adminchangepostslocationaction.class.php	2007-07-28 11:06:46 UTC (rev 5744)
@@ -28,7 +28,7 @@
         {
         	$this->AdminAction( $actionInfo, $request );
 			$this->registerFieldValidator( "postIds", new ArrayValidator());
-			$this->registerFieldValidator( "postLocation", new IntegerValidator() );
+			$this->registerFieldValidator( "locationId", new IntegerValidator() );
 			$view = new AdminPostsListView( $this->_blogInfo );
 			$view->setErrorMessage( $this->_locale->tr("error_incorrect_article_id"));
 			$this->setValidationErrorView( $view );
@@ -44,7 +44,7 @@
 			// prepare the parameters.. If there's only one category id, then add it to
 			// an array.
 			$this->_postIds = $this->_request->getValue( "postIds" );
-			$this->_postLocation = $this->_request->getValue( "postLocation" );
+			$this->_postLocation = $this->_request->getValue( "locationId" );
             
         	// Chanages the post status field by selection
             $articles = new Articles();
@@ -110,7 +110,8 @@
 			
 			lt_include( PLOG_CLASS_PATH."class/view/admin/ajax/adminajaxview.class.php" );
             $this->_view = new AdminAjaxView( $this->_blogInfo );
-			$this->_view->setResult( $results );
+			$this->_view->setMessage( $results );
+			$this->_view->setSuccess( true );
 
             // better to return true if everything fine
             return true;			

Modified: plog/trunk/class/template/smarty/plugins/function.location_chooser.php
===================================================================
--- plog/trunk/class/template/smarty/plugins/function.location_chooser.php	2007-07-28 09:21:37 UTC (rev 5743)
+++ plog/trunk/class/template/smarty/plugins/function.location_chooser.php	2007-07-28 11:06:46 UTC (rev 5744)
@@ -57,7 +57,7 @@
 		$default = null;
 	
 	// whether to use the location display icon next to the drop-down list
-	isset( $params["showDisplayLink"]) ? $showDisplayLink = true : $showDisplayLink = false;
+	isset( $params["showDisplayLink"]) ? $showDisplayLink = $params["showDisplayLink"] : $showDisplayLink = false;
 	
 	// whether to include an option labelled as "All" with an id of '-1', only meaningful for filtering
 	isset( $params["showAllOption"] ) ? $showAllOption = $params["showAllOption"] : $showAllOption = false;	

Modified: plog/trunk/js/location/location.js
===================================================================
--- plog/trunk/js/location/location.js	2007-07-28 09:21:37 UTC (rev 5743)
+++ plog/trunk/js/location/location.js	2007-07-28 11:06:46 UTC (rev 5744)
@@ -79,14 +79,14 @@
 {
 	if( s.options[s.selectedIndex].value == -2 ) {
 		this.o = new Lifetype.UI.ContentOverlay( YAHOO.util.Dom.generateId(), '?op=locationChooser' );		
-		this.o.show();			
+		this.o.show();
 	}
 }
 
 Lifetype.UI.Location.Selector.addNew = function( a ) 
 {
 	this.o = new Lifetype.UI.ContentOverlay( YAHOO.util.Dom.generateId(), '?op=locationChooser' );		
-	this.o.show();	
+	this.o.show();
 	
 	return( false );
 }
@@ -98,13 +98,19 @@
 		return false;
 		
 	locId = list.options[list.selectedIndex].value;
+
+	Lifetype.UI.Location.Selector.display( id );
+}
+
+Lifetype.UI.Location.Selector.display = function( locId )
+{
 	url = '?op=adminLocationDisplay&locId=' + locId;
 	
 	this.o = new Lifetype.UI.ContentOverlay( YAHOO.util.Dom.generateId(), url );
 	// and bind it to the onclick event
 	this.o.show();
 	
-	return( false );
+	return( false );	
 }
 
 Lifetype.UI.Location.Selector.hide = function()

Modified: plog/trunk/js/ui/pages/posts.js
===================================================================
--- plog/trunk/js/ui/pages/posts.js	2007-07-28 09:21:37 UTC (rev 5743)
+++ plog/trunk/js/ui/pages/posts.js	2007-07-28 11:06:46 UTC (rev 5744)
@@ -24,7 +24,7 @@
 		}
 	}
 	else if( op == 'changePostsLocation' ) {
-		if ( document.getElementById("postsList").postLocation.value == -1 ) {
+		if ( document.getElementById("postsList").locationId.value == -1 ) {
 	    	window.alert(tr('error_post_location'));
 		}
 		else {

Modified: plog/trunk/locale/admin/locale_en_UK.php
===================================================================
--- plog/trunk/locale/admin/locale_en_UK.php	2007-07-28 09:21:37 UTC (rev 5743)
+++ plog/trunk/locale/admin/locale_en_UK.php	2007-07-28 11:06:46 UTC (rev 5744)
@@ -1275,4 +1275,13 @@
 $messages['select_all'] = 'Select all';
 
 $messages['help_trim_whitespace_output'] = 'Removes all unnecessary blank spaces from rendered templates, which can make pages up to 40% smaller. It is adivsable to keep this enabled, unless you are concerned with performance [ Default = Yes ]';
+
+$messages['error_post_location'] = 'Please select a location';
+$messages['error_no_marker_set'] = 'Please place a marker first';
+$messages['error_no_description_set'] = 'Please provide a description';
+$messages['enter_location_name'] = 'Please enter a name for the location';
+$messages['error_adding_location'] = 'There was an error adding the location';
+$messages['location_added_ok'] = 'Location successfully added';
+$messages['error_updating_location'] = 'There was an error updating the location';
+$messages['location_updated_ok'] = 'Location successfully updated';
 ?>
\ No newline at end of file

Modified: plog/trunk/locale/locale_en_UK.php
===================================================================
--- plog/trunk/locale/locale_en_UK.php	2007-07-28 09:21:37 UTC (rev 5743)
+++ plog/trunk/locale/locale_en_UK.php	2007-07-28 11:06:46 UTC (rev 5744)
@@ -150,4 +150,6 @@
 $messages["pluginEditCommentsOk"] = "Comment saved successfully!";
 $messages["pluginEditCommentsCancelled"] = "Comment edits discarded.";
 $messages["pluginEditCommentsFailed"] = "Comment editing failed.";
+
+$messages['location'] = 'Location';
 ?>
\ No newline at end of file

Modified: plog/trunk/templates/admin/editposts.template
===================================================================
--- plog/trunk/templates/admin/editposts.template	2007-07-28 09:21:37 UTC (rev 5743)
+++ plog/trunk/templates/admin/editposts.template	2007-07-28 11:06:46 UTC (rev 5744)
@@ -69,7 +69,7 @@
                     <div class="list_nav_option">
                     <label for="location">{$locale->tr("location")}</label>
                     <br />
-					{location_chooser blogId=$blog->getId() showAddNew=0 showDisplayLink=1 showAllOption=1 default=$currentlocation}
+					{location_chooser blogId=$blog->getId() showAddNew=false showDisplayLink=true showAllOption=true default=$currentlocation}
                     </div>
 					{/if}
 
@@ -130,19 +130,11 @@
 		              {/foreach}
 		            </select>
 		            <input type="button" name="changePostsCategory" value="{$locale->tr("change_category")}" class="submit" onClick="Lifetype.UI.Pages.Posts.submitPostsList('changePostsCategory');" />
+		
 			 		<!-- location stuff -->
 					{if $location_data_enabled}
                     <label for="location">{$locale->tr("location")}</label>
-                    <select name="postLocation" id="postLocation">
-                     <option value="-1">-{$locale->tr("select")}-</option>
-                     <option value="0">{$locale->tr("none")}</option>
-					 {foreach from=$locations item=location}
-					   <option value="{$location->getId()}">{$location->getDescription()}</option>
-					 {/foreach}
-                    </select>
-					<a href="#" onClick="Lifetype.UI.Location.displaySelectedLocationFromId('postLocation', [ 0, -1 ] );">
-					  <img src="imgs/admin/icon_globe-16.png" alt="View" style="border:0px" />
-					</a>
+					{location_chooser blogId=$blog->getId() showAddNew=false showDisplayLink=false showAllOption=false}
 		            <input type="button" name="changePostsLocation" value="{$locale->tr("change_location")}" class="submit" onClick="Lifetype.UI.Pages.Posts.submitPostsList('changePostsLocation');" />
 					{/if}		
 		        </fieldset>

Modified: plog/trunk/templates/admin/editposts_table.template
===================================================================
--- plog/trunk/templates/admin/editposts_table.template	2007-07-28 09:21:37 UTC (rev 5743)
+++ plog/trunk/templates/admin/editposts_table.template	2007-07-28 11:06:46 UTC (rev 5744)
@@ -32,7 +32,7 @@
 				  {if $post->hasLocationData()}
 				    <br/><span style="font-weight:normal">
 				    {assign var=location value=$post->getLocation()}
-					{$locale->tr("location")}: <a href="javascript:void(0)" onClick="window.open('?op=adminLocationDisplay&locId={$location->getId()}','Location Viewer','scrollbars=no,resizable=no,toolbar=no,height=500,width=590')">{$location->getDescription()}</a>
+					{$locale->tr("location")}: <a href="#" onClick="Lifetype.UI.Location.Selector.display('{$location->getId()}');return(false)">{$location->getDescription()}</a>
 					</span>
 				  {/if}
 				{/if}

Modified: plog/trunk/templates/admin/jslocale.template
===================================================================
--- plog/trunk/templates/admin/jslocale.template	2007-07-28 09:21:37 UTC (rev 5743)
+++ plog/trunk/templates/admin/jslocale.template	2007-07-28 11:06:46 UTC (rev 5744)
@@ -12,9 +12,6 @@
 // editcomments.template
 Lifetype.Locale.add( 'error_comment_status', '{$locale->tr("error_comment_status")}' );
 
-// resources.template
-Lifetype.Locale.add( 'error_post_location', '{$locale->tr("error_post_location")}' );
-
 // siteblogs.template
 Lifetype.Locale.add( 'error_select_status', '{$locale->tr("error_select_status")}' );
 



More information about the pLog-svn mailing list