Index: extensions/rv_gmaps/trunk/admin/admin.php
===================================================================
--- extensions/rv_gmaps/trunk/admin/admin.php	(revision 17285)
+++ extensions/rv_gmaps/trunk/admin/admin.php	(revision 17286)
@@ -14,5 +14,4 @@
 $tabsheet = new tabsheet();
 $tabsheet->add( 'config', 'Configuration', add_url_params( $my_base_url, array('tab'=>'config') ) );
-$tabsheet->add( 'edit', 'Edit', add_url_params( $my_base_url, array('tab'=>'edit') ) );
 $tabsheet->add( 'sync', 'Synchronize', add_url_params( $my_base_url, array('tab'=>'sync') ) );
 $tabsheet->select($page['tab']);
Index: extensions/rv_gmaps/trunk/admin/admin_boot.php
===================================================================
--- extensions/rv_gmaps/trunk/admin/admin_boot.php	(revision 17286)
+++ extensions/rv_gmaps/trunk/admin/admin_boot.php	(revision 17286)
@@ -0,0 +1,94 @@
+<?php
+defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
+
+include_once( dirname(dirname(__FILE__)) .'/include/functions.php');
+
+add_event_handler('invalidate_user_cache', 'rvm_invalidate_cache' );
+
+add_event_handler('get_admin_plugin_menu_links', 'rvm_plugin_admin_menu' );
+function rvm_plugin_admin_menu($menu)
+{
+	array_push($menu,
+			array(
+				'NAME' => 'Maps & Earth',
+				'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/admin.php')
+			)
+		);
+	return $menu;
+}
+
+add_event_handler('get_batch_manager_prefilters', 'rvm_get_batch_manager_prefilters');
+function rvm_get_batch_manager_prefilters($prefilters)
+{
+	rvm_load_language();
+	$prefilters[] = array('ID' => 'geotagged', 'NAME' => l10n('Geotagged'));
+	$prefilters[] = array('ID' => 'not geotagged', 'NAME' => l10n('Not geotagged'));
+	return $prefilters;
+}
+
+add_event_handler('perform_batch_manager_prefilters', 'rvm_perform_batch_manager_prefilters', 50, 2);
+function rvm_perform_batch_manager_prefilters($filter_sets, $prefilter)
+{
+	if ($prefilter==="geotagged")
+		$query = 'lat IS NOT NULL AND lon IS NOT NULL';
+	elseif ($prefilter==="not geotagged")
+		$query = 'lat IS NULL OR lon IS NULL';
+
+	if ( isset($query) )
+	{
+    $query = '
+SELECT id
+  FROM '.IMAGES_TABLE.'
+  WHERE '.$query;
+		$filter_sets[] = array_from_query($query, 'id');
+	}
+	return $filter_sets;
+}
+
+add_event_handler('loc_end_element_set_global', 'rvm_loc_end_element_set_global');
+function rvm_loc_end_element_set_global()
+{
+	rvm_load_language();
+	global $template;
+	$template->append('element_set_global_plugins_actions',
+		array('ID' => 'geotag', 'NAME'=>l10n('Geotag'), 'CONTENT' => '
+  <label>Latitude (-90=S to 90=N)
+    <input type="text" size="8" name="lat">
+  </label>
+  <label>Longitude (-180=E to 180=W)
+    <input type="text" size="9" name="lon">
+  </label> (Empty values will erase coordinates)
+'));
+}
+
+add_event_handler('element_set_global_action', 'rvm_element_set_global_action', 50, 2);
+function rvm_element_set_global_action($action, $collection)
+{
+	if ($action!=="geotag")
+		return;
+	global $page;
+	$lat = trim($_POST['lat']);
+	$lon = trim($_POST['lon']);
+	if ( strlen($lat)>0 and strlen($lon)>0 )
+	{
+		if ( (double)$lat<=90 and (double)$lat>=-90
+				and (double)$lon<=180 and (double)$lat>=-180 )
+			$update_query = 'lat='.$lat.', lon='.$lon;
+		else
+			$page['errors'][] = 'Invalid lat or lon value';
+	}
+	elseif ( strlen($lat)==0 and strlen($lon)==0 )
+		$update_query = 'lat=NULL, lon=NULL';
+	else
+		$page['errors'][] = 'Both lat/lon must be empty or not empty';
+
+	if (isset($update_query))
+	{
+		$update_query = '
+UPDATE '.IMAGES_TABLE.' SET '.$update_query.'
+  WHERE id IN ('.implode(',',$collection).')';
+    pwg_query($update_query);
+    rvm_invalidate_cache();
+  }
+}
+?>
Index: extensions/rv_gmaps/trunk/admin/admin_edit.php
===================================================================
--- extensions/rv_gmaps/trunk/admin/admin_edit.php	(revision 17285)
+++ 	(revision )
@@ -1,147 +1,0 @@
-<?php 
-if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-
-$admin_url = PHPWG_ROOT_PATH.'admin.php';
-
-if ( !isset($_GET['cat']) )
-  $_GET['cat'] = 'caddie';
-$_GET['mode'] = 'map';
-include (PHPWG_ROOT_PATH.'admin/batch_manager.php');
-
-$template->concat('TABSHEET_TITLE', ' '.l10n_dec('%d photo', '%d photos', count($page['cat_elements_id'])));
-
-if ( isset($_POST['submit']) )
-{
-  $collection = array();
-
-  switch ($_POST['target'])
-  {
-    case 'all' :
-      $collection = $page['cat_elements_id'];
-      break;
-    case 'selection' :
-      if (!isset($_POST['selection']) or count($_POST['selection']) == 0)
-        array_push($page['errors'], l10n('Select at least one photo'));
-      else
-        $collection = $_POST['selection'];
-      break;
-  }
-  if ( count($collection)>0 )
-  {
-    $lat = trim($_POST['lat']);
-    $lon = trim($_POST['lon']);
-
-    if ( strlen($lat)>0 and strlen($lon)>0 )
-    {
-      if ( (double)$lat<=90 and (double)$lat>=-90
-          and (double)$lon<=180 and (double)$lat>=-180 )
-        $update_query = 'lat='.$lat.', lon='.$lon;
-      else
-        $page['errors'][] = 'Invalid lat or lon value';
-    }
-    elseif ( strlen($lat)==0 and strlen($lon)==0 )
-      $update_query = 'lat=NULL, lon=NULL';
-    else
-      $page['errors'][] = 'Both lat/lon must be empty or not empty';
-
-    if (isset($update_query))
-    {
-      $update_query = '
-UPDATE '.IMAGES_TABLE.' SET '.$update_query.'
-  WHERE id IN ('.implode(',',$collection).')';
-      pwg_query($update_query);
-      rvm_invalidate_cache();
-    }
-  }
-}
-
-$specials_selected = null;
-foreach( array('caddie'=>'Caddie', 'recent'=>'Recent photos') as $k => $v)
-{
-	$link = $admin_url.get_query_string_diff(array('start','cat')).'&amp;cat='.$k;
-	$template->append(
-		'specials',
-		array(
-			$link => l10n($v),
-			),
-		true
-		);
-	if ($k == $_GET['cat']) $specials_selected = $link;
-}
-$template->assign('specials_selected', $specials_selected);
-
-$query = '
-SELECT id,name,uppercats,global_rank
-  FROM '.CATEGORIES_TABLE.'
-;';
-$result = pwg_query($query);
-$categories = array();
-$selecteds = array();
-if (!empty($result))
-{
-	while ($row = mysql_fetch_assoc($result))
-	{
-		$url = $admin_url.get_query_string_diff(array('start','cat')).'&amp;cat='.$row['id'];
-		if ( $row['id']==$_GET['cat'] ) $selecteds[] = $url;
-		$row['id']=$url;
-		array_push($categories, $row);
-	}
-}
-usort($categories, 'global_rank_compare');
-display_select_categories($categories, $selecteds, 'categories', false);
-
-if (!empty($_GET['display']))
-{
-  if ('all' == $_GET['display'])
-    $page['nb_images'] = count($page['cat_elements_id']);
-  else
-    $page['nb_images'] = intval($_GET['display']);
-}
-else
-  $page['nb_images'] = 20;
-
-if ( !empty($page['cat_elements_id']) )
-{
-  $nav_bar = create_navigation_bar(
-    $admin_url.get_query_string_diff(array('start')),
-    count($page['cat_elements_id']),
-    $page['start'],
-    $page['nb_images']
-    );
-  $template->assign('navbar', $nav_bar);
-}
-
-$images=array();
-if ( !empty($page['cat_elements_id']) )
-{
-  $query='
-SELECT id,representative_ext,name,path,file,lat,lon FROM '.IMAGES_TABLE.'
-  WHERE id IN ('.implode(',',$page['cat_elements_id']).')
-  '.$conf['order_by'].'
-  LIMIT '.$page['start'].', '.$page['nb_images'].'
-;';
-  $result = pwg_query($query);
-  while ( $row=mysql_fetch_assoc($result) )
-    $images[] = $row;
-}
-
-foreach ($images as $image)
-{
-	$tpl_var = array_merge( $image,
-      array(
-        'U_TN' => DerivativeImage::thumb_url($image),
-        'TITLE' => render_element_name($image)
-      )
-    );
-  if ( isset($image['lat']) )
-    $tpl_var['U_MAP'] = rvm_make_map_picture_url( array('image_id'=>$image['id'], 'image_file'=>$image['file']) );
-	$template->append('thumbnails', $tpl_var);
-}
-
-$template->assign(
-    array(
-      'U_DISPLAY'=> $admin_url.get_query_string_diff(array('display'))
-    ) 
-  );
-
-?>
Index: extensions/rv_gmaps/trunk/admin/admin_edit.tpl
===================================================================
--- extensions/rv_gmaps/trunk/admin/admin_edit.tpl	(revision 17285)
+++ 	(revision )
@@ -1,74 +1,0 @@
-
-<form>
-Set:
-<select onchange="document.location = this.options[this.selectedIndex].value;">
-  <optgroup label="Specials">
-    {html_options options=$specials selected=$specials_selected}
-  </optgroup>
-  <optgroup label="{'Albums'|@translate}">
-  	{html_options options=$categories selected=$categories_selected}
-  </optgroup>
-  <!-- <optgroup label="{'Tags'|@translate}"></optgroup> -->
-</select>
-</form>
-
-<fieldset>
-  <legend>{'Display options'|@translate}</legend>
-  <p>{'photos per page'|@translate}:
-      <a href="{$U_DISPLAY}&amp;display=20">20</a>
-    | <a href="{$U_DISPLAY}&amp;display=50">50</a>
-    | <a href="{$U_DISPLAY}&amp;display=100">100</a>
-    | <a href="{$U_DISPLAY}&amp;display=all">{'all'|@translate}</a>
-  </p>
-</fieldset>
-
-<form action="" method="post">
-
-<fieldset>
-	<legend>{'Photos'|@translate}</legend>
-
-	{if !empty($navbar)}{include file='navigation_bar.tpl'}{/if}
-  {if not empty($thumbnails)}
-	<ul class="thumbnails">
-		{foreach from=$thumbnails item=thumbnail}
-		<li><span class="wrap1">
-			<label>
-				<span class="wrap2"><span>
-					<img src="{$thumbnail.U_TN}" alt="{$thumbnail.file}" title="{$thumbnail.TITLE}" class="thumbnail">
-				</span></span>
-				<input type="checkbox" name="selection[]" value="{$thumbnail.id}">
-			</label>
-
-			<span class="thumbLegend">
-			{if isset($thumbnail.U_MAP)}
-			<a href="{$thumbnail.U_MAP}" target="_blank">{$thumbnail.lat},{$thumbnail.lon}</a>
-			{/if}
-			</span>
-
-			</span>
-		</li>
-		{/foreach}
-	</ul>
-	{/if}
-</fieldset>
-
-
-<fieldset>
-  <legend>{'Form'|@translate}</legend>
-
-  <label>Latitude (-90=S to 90=N)
-    <input type="text" size="8" name="lat">
-  </label>
-  <label>Longitude (-180=E to 180=W)
-    <input type="text" size="9" name="lon">
-  </label>
-  <p>
-    {'target'|@translate}
-    <label><input type="radio" name="target" value="all"> {'all'|@translate}</label>
-    <label><input type="radio" name="target" value="selection" checked="checked"> {'selection'|@translate}</label>
-  </p>
-
-  <p><input type="submit" value="{'Submit'|@translate}" name="submit"></p>
-</fieldset>
-
-</form>
Index: extensions/rv_gmaps/trunk/changelog.txt
===================================================================
--- extensions/rv_gmaps/trunk/changelog.txt	(revision 17285)
+++ extensions/rv_gmaps/trunk/changelog.txt	(revision 17286)
@@ -1,2 +1,5 @@
+2.4.c
+- photos are now geotagged in the batch manager instead of a special plugin page
+
 2.4.b
 - language updates
Index: extensions/rv_gmaps/trunk/language/en_UK/lang.php
===================================================================
--- extensions/rv_gmaps/trunk/language/en_UK/lang.php	(revision 17285)
+++ extensions/rv_gmaps/trunk/language/en_UK/lang.php	(revision 17286)
@@ -22,3 +22,7 @@
 
 $lang['More photos near this location']='More photos near this location';
+
+$lang['Geotagged']='Geotagged';
+$lang['Not geotagged']='Not geotagged';
+$lang['Geotag']='Geotag';
 ?>
Index: extensions/rv_gmaps/trunk/main.inc.php
===================================================================
--- extensions/rv_gmaps/trunk/main.inc.php	(revision 17285)
+++ extensions/rv_gmaps/trunk/main.inc.php	(revision 17286)
@@ -1,5 +1,5 @@
 <?php /*
 Plugin Name: RV Maps&Earth
-Version: 2.4.b
+Version: 2.4.c
 Description: Extend your gallery with Google Maps and Google Earth ...
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=122
@@ -15,5 +15,4 @@
 
 add_event_handler('picture_pictures_data', 'rvm_picture_pictures_data' );
-add_event_handler('get_admin_plugin_menu_links', 'rvm_plugin_admin_menu' );
 
 global $rvm_dir;
@@ -125,18 +124,4 @@
 }
 
-function rvm_plugin_admin_menu($menu)
-{
-	include_once( dirname(__FILE__) .'/include/functions.php');
-	add_event_handler('invalidate_user_cache', 'rvm_invalidate_cache' );
-
-	array_push($menu,
-			array(
-				'NAME' => 'Maps & Earth',
-				'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/admin/admin.php')
-			)
-		);
-	return $menu;
-}
-
 function rvm_format_exif($exif, $file, $map)
 {
@@ -153,3 +138,7 @@
   return $exif;
 }
+
+if (defined('IN_ADMIN')) {
+	include_once(dirname(__FILE__).'/admin/admin_boot.php');
+}
 ?>
