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

Last change on this file since 13092 was 13092, checked in by rvelices, 12 years ago

rv_gmaps compatible with core version 2.4

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