Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<<<<<<< HEAD
=======
Changes from v2.8.d to v2.9.a
- Added "Select Place" functionality to batchmanagement
- Allow more SSL geo providers
- Fix logitude column
- Update language, thanks to the contributors

>>>>>>> refs/remotes/Piwigo/master
Changes from v2.8.c to v2.8.d
- Fix PHP syntax

Expand Down
19 changes: 19 additions & 0 deletions admin/admin_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@
'2' => l10n('NEVER'),
);

// TF, 20160102: give choice where to show clicked picture
// Available popup click targets
$available_popup_click_target = array(
'0' => l10n('BLANK'),
'1' => l10n('TOP'),
// '2' => l10n('SELF'),
// '3' => l10n('PARENT'),
);

// Available layout value
$available_layout = array(
'1' => 'osm-map.tpl',
Expand Down Expand Up @@ -167,6 +176,7 @@
'popupinfo_link' => isset($_POST['osm_left_popupinfo_link']),
'popupinfo_comment' => isset($_POST['osm_left_popupinfo_comment']),
'popupinfo_author' => isset($_POST['osm_left_popupinfo_author']),
'popup_click_target'=> $_POST['osm_left_popup_click_target'],
'zoom' => $_POST['osm_left_zoom'],
'center' => $osm_left_center,
'autocenter' => get_boolean($_POST['osm_left_autocenter']),
Expand All @@ -177,6 +187,10 @@
'height' => $_POST['osm_cat_height'],
'width' => $_POST['osm_cat_width'],
'index' => $_POST['osm_cat_index'],
// TF, 20160102: improve performance by hiding gpx tracks of sub-categories
'nogpxforsubcat' => get_boolean($_POST['osm_nogpxforsubcat']),
// TF, 20160102: improve performance by only showing firsat image of sub-categories
'firstimageforsubcat' => get_boolean($_POST['osm_firstimageforsubcat']),
),
'main_menu' => array(
'enabled' => get_boolean($_POST['osm_main_menu']),
Expand All @@ -199,7 +213,11 @@
'attrimagery' => get_boolean($_POST['osm_attrimagery']),
'attrplugin' => get_boolean($_POST['osm_attrplugin']),
'mapquestapi' => $_POST['osm_mapquestapi'],
<<<<<<< HEAD
),
=======
),
>>>>>>> refs/remotes/Piwigo/master
'pin' => array(
'pin' => $_POST['osm_pin'],
'pinpath' => $_POST['osm_pinpath'],
Expand Down Expand Up @@ -229,6 +247,7 @@
'AVAILABLE_BASELAYER' => $available_baselayer,
'AVAILABLE_PIN' => $available_pin,
'AVAILABLE_POPUP' => $available_popup,
'AVAILABLE_POPUP_CLICK_TARGET' => $available_popup_click_target,
'AVAILABLE_LAYOUT' => $available_layout,
'NB_GEOTAGGED' => $nb_geotagged,
'OSM_PATH' => OSM_PATH,
Expand Down
22 changes: 22 additions & 0 deletions admin/admin_config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ Refer to the <a href="https://github.com/xbgmsharp/piwigo-openstreetmap/wiki" ta
<label><input type="radio" name="osm_left_autocenter" value="false" {if not $left_menu.autocenter}checked="checked"{/if} onchange="autocenter_toggle(this);"/> {'No'|@translate}</label>
<br/><small>{'The map will be automatically centered and zoomed to contain all infos.'|@translate}</small>
</li>
<<<<<<< HEAD
<li>
<label>{'LEFTPOPUPCLICKTARGET'|@translate} : </label>
<select name="osm_left_popup_click_target">
{html_options options=$AVAILABLE_POPUP_CLICK_TARGET selected=$left_menu.popup_click_target}
</select>
<br/><small>{'LEFTPOPUPCLICKTARGET_DESC'|@translate}</small>
</li>
=======
>>>>>>> refs/remotes/Piwigo/master
<li id="osm_left_zoom_block">
<label>{'ZOOM'|@translate} : </label>
<select name="osm_left_zoom">
Expand Down Expand Up @@ -155,6 +165,18 @@ Refer to the <a href="https://github.com/xbgmsharp/piwigo-openstreetmap/wiki" ta
<input type="text" value="{$category_description.width}" name="osm_cat_width" size="4" required placeholder="auto"/>
<br/><small>{'WIDTH_DESC'|@translate}</small>
</li>
<li>
<label>{'NOGPXFORSUBCAT'|@translate} : </label>
<label><input type="radio" name="osm_nogpxforsubcat" value="true" {if $category_description.nogpxforsubcat}checked="checked"{/if}/> {'Yes'|@translate}</label>
<label><input type="radio" name="osm_nogpxforsubcat" value="false" {if not $category_description.nogpxforsubcat}checked="checked"{/if}/> {'No'|@translate}</label>
<br/><small>{'NOGPXFORSUBCAT_DESC'|@translate}</small>
</li>
<li>
<label>{'FIRSTIMAGEFORSUBCAT'|@translate} : </label>
<label><input type="radio" name="osm_firstimageforsubcat" value="true" {if $category_description.firstimageforsubcat}checked="checked"{/if}/> {'Yes'|@translate}</label>
<label><input type="radio" name="osm_firstimageforsubcat" value="false" {if not $category_description.firstimageforsubcat}checked="checked"{/if}/> {'No'|@translate}</label>
<br/><small>{'FIRSTIMAGEFORSUBCAT_DESC'|@translate}</small>
</li>
</ul>
</fieldset>
<fieldset>
Expand Down
8 changes: 7 additions & 1 deletion category.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ function osm_render_category()
osm_load_language();
load_language('plugin.lang', OSM_PATH);

$js_data = osm_get_items($page);
// TF, 20160102: pass config as parameter
$js_data = osm_get_items($conf, $page);
if ($js_data != array())
{
$local_conf = array();
Expand All @@ -56,7 +57,12 @@ function osm_render_category()
$local_conf['center_lng'] = 0;
$local_conf['zoom'] = 2;
$local_conf['autocenter'] = 1;
<<<<<<< HEAD
// TF, 20160102: pass config as parameter
$local_conf['paths'] = osm_get_gps($conf, $page);
=======
$local_conf['paths'] = osm_get_gps($page);
>>>>>>> refs/remotes/Piwigo/master
$height = isset($conf['osm_conf']['category_description']['height']) ? $conf['osm_conf']['category_description']['height'] : '200';
$width = isset($conf['osm_conf']['category_description']['width']) ? $conf['osm_conf']['category_description']['width'] : 'auto';
$js = osm_get_js($conf, $local_conf, $js_data);
Expand Down
26 changes: 18 additions & 8 deletions gpx.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');

// Add GPX support file extensions
array_push($conf['file_ext'], 'gpx');
// TF, 22.10.2015: handle kml as well!
array_push($conf['file_ext'], 'gpx', 'kml');

// Hook on to an event to display videos as standard images
add_event_handler('render_element_content', 'osm_render_media', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
Expand All @@ -41,9 +42,10 @@ function osm_render_media($content, $picture)
{
return $content;
}
// If not a GPX file
// If not a GPX or KML file
if ( (array_key_exists('path', @$picture['current']))
&& strpos($picture['current']['path'],".gpx") === false)
&& (strpos($picture['current']['path'],".gpx") === false
&& strpos($picture['current']['path'],".kml") === false))
{
return $content;
}
Expand All @@ -67,10 +69,17 @@ function osm_render_media($content, $picture)
$js = osm_get_js($conf, $local_conf, $js_data);

// Select the template
$template->set_filenames(
array('osm_content' => dirname(__FILE__)."/template/osm-gpx.tpl")
);

// TF, 22.10.2015: handle kml as well!
if (strpos($picture['current']['path'],".gpx") === false)
{
$template->set_filenames(
array('osm_content' => dirname(__FILE__)."/template/osm-kml.tpl")
);
} else {
$template->set_filenames(
array('osm_content' => dirname(__FILE__)."/template/osm-gpx.tpl")
);
}
// Assign the template variables
$template->assign(
array(
Expand All @@ -91,7 +100,8 @@ function osm_render_media($content, $picture)
add_event_handler('get_mimetype_location', 'osm_get_mimetype_icon');
function osm_get_mimetype_icon($location, $element_info)
{
if ($element_info == 'gpx')
// TF, 22.10.2015: handle kml as well!
if ($element_info == 'gpx' || $element_info == 'kml')
{
$location = 'plugins/'
. basename(dirname(__FILE__))
Expand Down
Loading