[3447] | 1 | <?php |
---|
| 2 | global $page, $template, $conf, $rvm_dir; |
---|
| 3 | |
---|
[8304] | 4 | $template->concat( 'PLUGIN_PICTURE_ACTIONS' , sprintf(RVM_ACTION_MODEL, |
---|
| 5 | duplicate_picture_url(), l10n('return to normal view mode'), '', 'map', 'map' |
---|
| 6 | )); |
---|
[3447] | 7 | |
---|
| 8 | $template->assign( |
---|
| 9 | array( |
---|
| 10 | 'RVM_PLUGIN_VERSION' => RVM_PLUGIN_VERSION, |
---|
| 11 | 'PLUGIN_ROOT_URL' => get_absolute_root_url().'plugins/'.$rvm_dir, |
---|
[8304] | 12 | 'PLUGIN_LOCATION' => 'plugins/'.$rvm_dir, |
---|
[3447] | 13 | ) |
---|
| 14 | ); |
---|
| 15 | |
---|
| 16 | $page['meta_robots']=array('noindex'=>1, 'nofollow'=>1); |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | add_event_handler( |
---|
| 20 | 'render_element_content', |
---|
| 21 | 'rvm_picture_map_content', |
---|
| 22 | EVENT_HANDLER_PRIORITY_NEUTRAL-5, |
---|
| 23 | 2 |
---|
| 24 | ); |
---|
| 25 | |
---|
[28598] | 26 | add_event_handler( 'loc_end_picture', 'rvm_end_picture' ); |
---|
[3447] | 27 | |
---|
| 28 | |
---|
| 29 | function 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( |
---|
[23083] | 36 | 'MAP_TYPE' => rvm_get_config_var('map_type', 'ROADMAP'), |
---|
[3447] | 37 | 'U_NO_MAP' => duplicate_picture_url(), |
---|
[26331] | 38 | 'U_BLOWUP' => rvm_make_blowup_url( array('ll'=> array('lat'=>$picture['latitude'],'lon'=>$picture['longitude'])), array('start','box') ), |
---|
[28598] | 39 | 'COMMENT_IMG' => trigger_change('render_element_description', $picture['comment']) |
---|
[3447] | 40 | ) |
---|
| 41 | ); |
---|
[26331] | 42 | if ( isset($picture['latitude']) ) |
---|
[3447] | 43 | { |
---|
| 44 | $template->assign( 'coordinates', |
---|
| 45 | array( |
---|
[26331] | 46 | 'LAT' => $picture['latitude'], |
---|
| 47 | 'LON' => $picture['longitude'], |
---|
[3447] | 48 | ) |
---|
| 49 | ); |
---|
| 50 | } |
---|
| 51 | return $template->parse( 'map_content', true); |
---|
| 52 | } |
---|
| 53 | |
---|
| 54 | function rvm_end_picture() |
---|
| 55 | { |
---|
| 56 | global $template; |
---|
| 57 | $template->assign( 'COMMENT_IMG', null); // no legend below picture (we put it left) |
---|
| 58 | } |
---|
| 59 | |
---|
[6639] | 60 | ?> |
---|