source: extensions/rv_gmaps/trunk/include/picture_map.inc.php @ 8304

Last change on this file since 8304 was 8304, checked in by rvelices, 13 years ago

rv_gmaps co;patible with piwigo trunk (future 2.2)

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1<?php
2global $page, $template, $conf, $rvm_dir;
3
4$template->concat( 'PLUGIN_PICTURE_ACTIONS' , sprintf(RVM_ACTION_MODEL,
5        duplicate_picture_url(), l10n('return to normal view mode'), '', 'map', 'map'
6));
7
8$template->assign(
9  array(
10    'RVM_PLUGIN_VERSION' => RVM_PLUGIN_VERSION,
11    'GMAPS_API_KEY' => $conf['gmaps_api_key'],
12    'PLUGIN_ROOT_URL' => get_absolute_root_url().'plugins/'.$rvm_dir,
13                'PLUGIN_LOCATION' => 'plugins/'.$rvm_dir,
14  )
15  );
16
17$page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
18
19
20add_event_handler(
21  'render_element_content',
22  'rvm_picture_map_content',
23  EVENT_HANDLER_PRIORITY_NEUTRAL-5,
24  2
25  );
26
27add_event_handler( 'loc_end_picture', 'rvm_end_picture'  );
28
29
30function rvm_picture_map_content($content, $picture)
31{
32  include_once( dirname(__FILE__) .'/functions_map.php');
33  global $template;
34  $template->set_filename( 'map_content', dirname(__FILE__).'/../template/picture_map_content.tpl' );
35  $template->assign(
36    array(
37      'TN_SRC' => $picture['thumbnail'],
38      'U_NO_MAP' => duplicate_picture_url(),
39      'U_BLOWUP' => rvm_make_blowup_url( array('ll'=>$picture), array('start','box') ),
40      'COMMENT_IMG' => trigger_event('render_element_description', $picture['comment'])
41    )
42  );
43  if ( isset($picture['lat']) )
44  {
45    $template->assign( 'coordinates',
46        array(
47          'LAT' => $picture['lat'],
48          'LON' => $picture['lon'],
49        )
50      );
51  }
52  return $template->parse( 'map_content', true);
53}
54
55function rvm_end_picture()
56{
57  global $template;
58  $template->assign( 'COMMENT_IMG', null);  // no legend below picture (we put it left)
59  $rating = & $template->get_template_vars('rating');
60  if (isset($rating))
61    $rating['F_ACTION'] = add_url_params( $rating['F_ACTION'], array('map'=>null) );
62}
63
64?>
Note: See TracBrowser for help on using the repository browser.