21 require_once(
'class.gmapsMap.php');
22 require_once(
'class.gmapsPointCtg.php');
23 require_once(
'class.gmapsPoint.php');
24 require_once(
'class.gmapsService.php');
25 require_once(
'class.gmapsPolylineCtg.php');
26 require_once(
'class.gmapsPolyline.php');
27 require_once(
'class.gmapsPolygonCtg.php');
28 require_once(
'class.gmapsPolygon.php');
29 require_once(
'class.gmapsImage.php');
30 require_once(
'class.gmapsCollection.php');
31 require_once(
'class.gmapsCollectionImage.php');
32 require_once(
'class.gmapsVideo.php');
33 require_once(
'class.gmapsEvent.php');
34 require_once(
'class.gmapsAttachment.php');
35 require_once(
'class.gmapsMarker.php');
50 class gmaps extends AbstractEvtClass {
267 parent::__construct();
269 $this->_instance = $mdlId;
270 $this->_instanceName = $this->_db->getFieldFromId($this->_tbl_module,
'name',
'id', $this->_instance);
271 $this->_instanceLabel = $this->_db->getFieldFromId($this->_tbl_module,
'label',
'id', $this->_instance);
273 $this->_data_dir = $this->_data_dir.$this->_os.$this->_instanceName;
274 $this->_data_www = $this->_data_www.
"/".$this->_instanceName;
279 $this->_optionsValue = array(
280 'title'=>_(
"Mappe interattive"),
281 'list_fields'=>
'label,categories'
284 $this->_title = htmlChars($this->setOption(
'title', array(
'value'=>$this->_optionsValue[
'title'],
'translation'=>
true)));
285 $this->_default_map = htmlChars($this->setOption(
'default_map', array(
'value'=>
'',
'translation'=>
false)));
286 $this->_list_fields = $this->setOption(
'list_fields', array(
'value'=>$this->_optionsValue[
'list_fields'],
'translation'=>
false));
288 $list_fields_exp = _(
"Inserire i campi separati da virgole<br/>Campi disponibili:<ul>
289 <li><b>label</b>: etichetta (punti e percorsi)</li>
290 <li><b>categories</b>: categorie (punti e percorsi)</li>
291 <li><b>address</b>: indirizzo (punti)</li>
292 <li><b>cap</b>: cap (punti)</li>
293 <li><b>city</b>: città (punti)</li>
294 <li><b>services</b>: servizi (punti)</li>
296 $this->_options =
new options($this->_className, $this->_instance);
297 $this->_optionsLabels = array(
298 "title"=>array(
'label'=>_(
"Titolo del modulo"),
'value'=>$this->_optionsValue[
'title'],
'required'=>
false),
299 "default_map"=>array(
'label'=>array(_(
"Mappa di default"), _(
"ID della mappa da mostrare nella vista quando non viene passato un id tramite GET")),
'value'=>
'',
'required'=>
false),
300 "list_fields"=>array(
'label'=>array(_(
"Campi mostrati nelle liste (mappa full, itinerari, aree)"), $list_fields_exp),
'value'=>$this->_optionsValue[
'list_fields'],
'required'=>
false)
303 $this->_action = cleanVar($_REQUEST,
'action',
'string',
'');
304 $this->_block = cleanVar($_REQUEST,
'block',
'string',
'');
306 $this->_list_point_items = 15;
308 $this->_icon_attachment =
"<img class=\"icon_tooltip\" src=\"".$this->_class_img.
"/ico_attachment.gif\" alt=\""._(
"allegati").
"\" title=\""._(
"allegati").
"\" />";
309 $this->_icon_event =
"<img class=\"icon_tooltip\" src=\"".$this->_class_img.
"/ico_event.gif\" alt=\""._(
"eventi").
"\" title=\""._(
"eventi").
"\" />";
310 $this->_icon_image =
"<img class=\"icon_tooltip\" src=\"".$this->_class_img.
"/ico_image.gif\" alt=\""._(
"immagini").
"\" title=\""._(
"immagini").
"\" />";
311 $this->_icon_video =
"<img class=\"icon_tooltip\" src=\"".$this->_class_img.
"/ico_video.gif\" alt=\""._(
"video").
"\" title=\""._(
"video").
"\" />";
312 $this->_icon_collection =
"<img class=\"icon_tooltip\" src=\"".$this->_class_img.
"/ico_collection.gif\" alt=\""._(
"collezioni").
"\" title=\""._(
"collezioni").
"\" />";
313 $this->_icon_map_element =
"<img class=\"icon_tooltip\" src=\"".$this->_class_img.
"/ico_map_element.gif\" alt=\""._(
"elementi mappa").
"\" title=\""._(
"elementi mappa").
"\" />";
314 $this->_icon_polyline_points =
"<img class=\"icon_tooltip\" src=\"".$this->_class_img.
"/ico_map_element.gif\" alt=\""._(
"punti percorso").
"\" title=\""._(
"punti percorso").
"\" />";
315 $this->_icon_polygon_points =
"<img class=\"icon_tooltip\" src=\"".$this->_class_img.
"/ico_map_element.gif\" alt=\""._(
"punti area").
"\" title=\""._(
"punti percorso").
"\" />";
328 return array(
"tables"=>array(
'gmaps_map',
'gmaps_map_point',
'gmaps_map_polyline',
'gmaps_point',
'gmaps_point_image',
'gmaps_point_video',
'gmaps_point_event',
'gmaps_point_attachment',
'gmaps_point_collection',
'gmaps_point_collection_image',
'gmaps_point_service',
'gmaps_point_point_ctg',
'gmaps_point_ctg',
'gmaps_polyline',
'gmaps_polyline_point',
'gmaps_polyline_ctg',
'gmaps_polyline_polyline_ctg',
'gmaps_polygon',
'gmaps_polygon_point',
'gmaps_polygon_ctg',
'gmaps_polygon_polygon_ctg',
'gmaps_service',
'gmaps_marker',
'gmaps_opt',
'gmaps_grp',
'gmaps_usr'),
329 "css"=>array(
'gmaps.css'),
330 "folderStructure"=>array(
331 CONTENT_DIR.OS.
'gmaps'=>array(
334 "polyline_ctg"=>null,
340 'collections'=>array(
359 $this->accessGroup(
'');
374 $opt_id = $this->_db->getFieldFromId($this->_tbl_opt,
"id",
"instance", $this->_instance);
375 language::deleteTranslations($this->_tbl_opt, $opt_id);
377 $query =
"DELETE FROM ".$this->_tbl_opt.
" WHERE instance='$this->_instance'";
378 $res = $res && $this->_db->actionquery($query);
383 $query =
"DELETE FROM ".$this->_tbl_usr.
" WHERE instance='$this->_instance'";
384 $res = $res && $this->_db->actionquery($query);
390 foreach($classElements[
'css'] as $css) {
391 unlink(APP_DIR.OS.$this->_className.OS.baseFileName($css).
"_".$this->_instanceName.
".css");
397 foreach($classElements[
'folderStructure'] as $fld=>$fldStructure) {
398 $this->deleteFileDir($fld.OS.$this->_instanceName,
true);
417 "view" => array(
"label"=>_(
"Visualizzazione mappa (aggiungere l'id della mappa: es. &id=1, di default viene caricata la mappa impostata da opzioni)"),
"role"=>
'1'),
418 "viewFull" => array(
"label"=>_(
"Visualizzazione mappa con lista elementi (aggiungere l'id della mappa: es. &id=1, di default viene caricata la mappa impostata da opzioni)"),
"role"=>
'1')
432 return $this->_instanceName;
446 $this->setAccess($this->_access_base);
448 $get_id = cleanVar($_GET,
'id',
'int',
'');
450 $map =
new gmapsMap($map_id, $this);
452 $registry = registry::instance();
453 $registry->addJs(
"http://maps.googleapis.com/maps/api/js?key=AIzaSyArAE-uBvCZTRaf_eaFn4umUdESmoUvoxM&sensor=true");
454 $registry->addJs(SITE_WWW.
"/app/gmaps/markerclusterer_packed.js");
455 $registry->addJs(SITE_WWW.
"/app/gmaps/infobox.js");
456 $registry->addJs(SITE_WWW.
"/app/gmaps/MooComplete.js");
457 $registry->addJs(SITE_WWW.
"/app/gmaps/ProgressBar.js");
458 $registry->addJs(SITE_WWW.
"/app/gmaps/gmaps.js");
459 $registry->addCss(SITE_WWW.
"/app/gmaps/gmaps_".$this->_instanceName.
".css");
460 $registry->addCss(SITE_WWW.
"/app/gmaps/MooComplete.css");
464 $buffer .=
"<section id=\"view_gmaps_".$this->_instanceName.
"\">";
465 $buffer .= $this->
map($map);
466 $buffer .=
"</section>";
482 $this->setAccess($this->_access_base);
484 $get_id = cleanVar($_GET,
'id',
'int',
'');
486 $map =
new gmapsMap($map_id, $this);
488 $registry = registry::instance();
489 $registry->addJs(
"http://maps.googleapis.com/maps/api/js?key=AIzaSyArAE-uBvCZTRaf_eaFn4umUdESmoUvoxM&sensor=true");
490 $registry->addJs(SITE_WWW.
"/app/gmaps/markerclusterer_packed.js");
491 $registry->addJs(SITE_WWW.
"/app/gmaps/infobox.js");
492 $registry->addJs(SITE_WWW.
"/app/gmaps/MooComplete.js");
493 $registry->addJs(SITE_WWW.
"/app/gmaps/ProgressBar.js");
494 $registry->addJs(SITE_WWW.
"/app/gmaps/gmaps.js");
495 $registry->addCss(SITE_WWW.
"/app/gmaps/gmaps_".$this->_instanceName.
".css");
496 $registry->addCss(SITE_WWW.
"/app/gmaps/MooComplete.css");
500 $buffer .=
"<section id=\"viewfull_gmaps_".$this->_instanceName.
"\">";
501 $buffer .= $this->
map($map,
true);
502 $buffer .=
"</section>";
516 $this->setAccess($this->_access_base);
518 $id = cleanVar($_GET,
'id',
'int',
'');
521 $registry = registry::instance();
522 $registry->addJs(
"http://maps.googleapis.com/maps/api/js?key=AIzaSyArAE-uBvCZTRaf_eaFn4umUdESmoUvoxM&sensor=true");
523 $registry->addJs(SITE_WWW.
"/app/gmaps/markerclusterer_packed.js");
524 $registry->addJs(SITE_WWW.
"/app/gmaps/infobox.js");
525 $registry->addJs(SITE_WWW.
"/app/gmaps/MooComplete.js");
526 $registry->addJs(SITE_WWW.
"/app/gmaps/ProgressBar.js");
527 $registry->addJs(SITE_WWW.
"/app/gmaps/gmaps.js");
528 $registry->addCss(SITE_WWW.
"/app/gmaps/gmaps_".$this->_instanceName.
".css");
529 $registry->addCss(SITE_WWW.
"/app/gmaps/MooComplete.css");
533 $buffer =
"<!DOCTYPE html>";
534 $buffer .=
"<html lang=\"".LANG.
"\">\n";
535 $buffer .=
"<head>\n";
536 $buffer .=
"<meta charset=\"utf-8\" />\n";
537 $buffer .=
"<title>".htmlChars($map->name).
"</title>\n";
538 $buffer .=
"<base href=\"".$pub->getUrl(
'root').SITE_WWW.
"/\" />\n";
539 $buffer .= $registry->variables(
'css');
540 $buffer .= $registry->variables(
'js');
541 $buffer .=
"</head>\n";
543 $buffer .=
"<body style=\"background: transparent;\">\n";
544 $buffer .=
"<section style=\"text-align:left; padding: 0; margin: 0; width:".$map->width.
"; height:".$map->height.
";\">";
545 $buffer .= $this->
map($map);
546 $buffer .=
"</section>";
547 $buffer .=
"</body>\n";
548 $buffer .=
"</html>\n";
563 private function map($map, $list =
false) {
567 $gform =
new Form(
'form_map',
'post',
false, array(
'tblLayout'=>
false));
569 $buffer .=
"<nav id=\"gmaps_nav\">";
572 $buffer .= _(
"Help");
574 $buffer .=
"<li data-menu=\"maphelp\">"._(
"<p>Utilizzare la voce 'Mappa' per modificare il tipo di mappa.<br/>Utilizzare il campo di testo per ricercare punti di interesse, percorsi o aree nella mappa, iniziando a digitare le chiavi di ricerca verranno visualizzati dei suggerimenti, selezionare quello desiderato e premere il bottone 'cerca'. Per tornare alla visualizzazione completa premere il bottone 'tutti'. <br />Se si desidera filtrare per categoria utlizzare l'apposito menu a tendina.</p>").
"</li>";
578 $buffer .= _(
"Mappa");
580 $buffer .=
"<li class=\"link\" data-menu=\"maptype\" data-type=\"hybrid\">"._(
"Ibrida").
"</li>";
581 $buffer .=
"<li class=\"link selected\" data-menu=\"maptype\" data-type=\"roadmap\">"._(
"roadmap").
"</li>";
582 $buffer .=
"<li class=\"link\" data-menu=\"maptype\" data-type=\"satellite\">"._(
"satellite").
"</li>";
583 $buffer .=
"<li class=\"link\" data-menu=\"maptype\" data-type=\"terrain\">"._(
"terrain").
"</li>";
587 $buffer .=
"<input type=\"text\" name=\"text_search\" id=\"text_search\" value=\"\" placeholder=\""._(
"cerca...").
"\" />";
588 $buffer .=
" <input type=\"button\" name=\"button_search\" id=\"button_search\" value=\""._(
"cerca").
"\" />";
589 $buffer .=
" <input type=\"button\" name=\"button_search_reset\" id=\"button_search_reset\" value=\""._(
"tutti").
"\" />";
597 $buffer .=
"<select id=\"ctg_search\">";
598 $buffer .=
"<option selected>"._(
"tutte le categorie").
"</option>";
599 if(count($point_ctgs)) {
600 $buffer .=
"<optgroup label=\""._(
"Punti di interesse").
"\">";
601 foreach($point_ctgs as $id=>$label) {
602 $buffer .=
"<option value=\"point_".$id.
"\">".$label.
"</option>";
604 $buffer .=
"</optgroup>";
606 if(count($polyline_ctgs)) {
607 $buffer .=
"<optgroup label=\""._(
"Percorsi").
"\">";
608 foreach($polyline_ctgs as $id=>$label) {
609 $buffer .=
"<option value=\"polyline_".$id.
"\">".$label.
"</option>";
612 if(count($polygon_ctgs)) {
613 $buffer .=
"<optgroup label=\""._(
"Aree").
"\">";
614 foreach($polygon_ctgs as $id=>$label) {
615 $buffer .=
"<option value=\"polygon_".$id.
"\">".$label.
"</option>";
618 $buffer .=
"</optgroup>";
619 $buffer .=
"</select>";
623 $buffer .=
"<div id=\"map_canvas\" style=\"width:".$map->width.
";height:".$map->height.
"\"></div>";
626 foreach(explode(
',', $this->_list_fields) as $f) {
628 if(in_array($f, array(
'label',
'categories',
'address',
'cap',
'city',
'services'))) {
632 $voices =
"'".implode(
"', '", $voices).
"'";
634 $buffer .=
"<script>";
635 $buffer .=
"window.addEvent('load', function() {";
636 $buffer .=
"var gmap = new Gmap($('map_canvas'), {elements_list: ".($list ?
'true' :
'false').
", elements_voices: [".$voices.
"], points_label: '".jsVar(_(
'Punti di interesse')).
"', polylines_label: '".jsVar(
"Percorsi").
"', polygons_label: '"._(
"Aree").
"', empty_search_result: '".jsVar(_(
"La ricerca non ha prodotto risultati")).
"'});";
637 $points_ids = $map->points_id();
638 $points_polylines = array();
639 $points_polygons = array();
640 foreach($map->polylines() as $polyline) {
641 foreach($polyline->points_id() as $point_id) {
642 $points_ids[] = $point_id;
643 if(!isset($points_polylines[$point_id]))
644 $points_polylines[$point_id] = array($polyline->id);
645 else $points_polylines[$point_id][] = $polyline->id;
648 foreach($map->polygons() as $polygon) {
649 foreach($polygon->points_id() as $point_id) {
650 $points_ids[] = $point_id;
651 if(!isset($points_polygons[$point_id]))
652 $points_polygons[$point_id] = array($polygon->id);
653 else $points_polygons[$point_id][] = $polygon->id;
657 $points_ids = array_unique($points_ids);
659 if(count($points_ids)) {
660 $points =
'var points = {};';
661 foreach($points_ids as $point_id) {
662 $point_obj =
new gmapsPoint($point_id, $this);
663 $point_polylines = isset($points_polylines[$point_id]) ? $points_polylines[$point_id] : array();
664 $point_polygons = isset($points_polygons[$point_id]) ? $points_polygons[$point_id] : array();
665 $points .=
"points.id".$point_obj->id.
" = ".$point_obj->jsObject(
'gmap', $point_polylines, $point_polygons, $map->id);
668 $buffer .=
"gmap.addPoints(points);";
671 if(count($map->polylines())) {
672 $polylines =
'var polylines = {};';
673 foreach($map->polylines() as $polyline_obj) {
674 $polylines .=
"polylines.id".$polyline_obj->id.
" = ".$polyline_obj->jsObject(
'gmap', $map->id);
676 $buffer .= $polylines;
677 $buffer .=
"gmap.addPolylines(polylines);";
680 if(count($map->polygons())) {
681 $polygons =
'var polygons = {};';
682 foreach($map->polygons() as $polygon_obj) {
683 $polygons .=
"polygons.id".$polygon_obj->id.
" = ".$polygon_obj->jsObject(
'gmap', $map->id);
685 $buffer .= $polygons;
686 $buffer .=
"gmap.addPolygons(polygons);";
689 $buffer .=
"gmap.renderMap();";
691 $buffer .=
"</script>";
704 $this->setAccess($this->_access_base);
706 $point_id = cleanVar($_GET,
'point_id',
'int',
'');
707 $polyline_id = cleanVar($_GET,
'polyline_id',
'int',
'');
708 $polygon_id = cleanVar($_GET,
'polygon_id',
'int',
'');
709 $map_id = cleanVar($_GET,
'map_id',
'int',
'');
715 $buffer =
"<section>";
716 $buffer .=
"<h1>".htmlCHars($point->ml(
'label')).
"</h1>";
718 $nation = $this->_db->getFieldFromId(
'nation', $_SESSION[
'lng'],
'id', $point->nation);
719 $caddress = htmlChars($point->ml(
'address').
', '.$point->cap.
' '.$point->ml(
'city').
', '.$nation);
720 $buffer .=
"<p><i>".$caddress.
"</i></p>";
722 $remove_images =
false;
723 if($images = $point->images()) {
725 $buffer .= $image->thumb(
'left');
726 $remove_images =
true;
728 $buffer .= cutHtmlText(HtmlChars($point->ml(
'description')), 220,
'...',
false,
false, $remove_images, array(
'endingPosition'=>
'in'));
729 $buffer .=
"<p><a href=\"".$this->_plink->aLink($this->_instanceName,
'point', array(
"id"=>$point->id,
'map'=>$map_id)).
"\">"._(
"leggi tutto").
"</a></p>";
730 $buffer .=
"<div class=\"null\"></div>";
731 $buffer .=
"</section>";
733 elseif($polyline_id) {
737 $buffer =
"<section>";
738 $buffer .=
"<h1>".htmlCHars($polyline->ml(
'label')).
"</h1>";
740 $buffer .= cutHtmlText(HtmlChars($polyline->ml(
'description')), 220,
'...',
false,
false,
false, array(
'endingPosition'=>
'in'));
741 $buffer .=
"<p><a href=\"".$this->_plink->aLink($this->_instanceName,
'itinerary', array(
"id"=>$polyline->id,
'map'=>$map_id)).
"\">"._(
"leggi tutto").
"</a></p>";
742 $buffer .=
"<div class=\"null\"></div>";
743 $buffer .=
"</section>";
745 elseif($polygon_id) {
749 $buffer =
"<section>";
750 $buffer .=
"<h1>".htmlCHars($polygon->ml(
'label')).
"</h1>";
752 $buffer .= cutHtmlText(HtmlChars($polygon->ml(
'description')), 220,
'...',
false,
false,
false, array(
'endingPosition'=>
'in'));
753 $buffer .=
"<p><a href=\"".$this->_plink->aLink($this->_instanceName,
'area', array(
"id"=>$polygon->id,
'map'=>$map_id)).
"\">"._(
"leggi tutto").
"</a></p>";
754 $buffer .=
"<div class=\"null\"></div>";
755 $buffer .=
"</section>";
770 $registry = registry::instance();
771 $registry->addJs(
"http://maps.googleapis.com/maps/api/js?key=AIzaSyArAE-uBvCZTRaf_eaFn4umUdESmoUvoxM&sensor=true");
772 $registry->addJs(SITE_WWW.
"/app/gmaps/markerclusterer_packed.js");
773 $registry->addJs(SITE_WWW.
"/app/gmaps/infobox.js");
774 $registry->addJs(SITE_WWW.
"/app/gmaps/MooComplete.js");
775 $registry->addJs(SITE_WWW.
"/app/gmaps/ProgressBar.js");
776 $registry->addJs(SITE_WWW.
"/app/gmaps/gmaps.js");
777 $registry->addCss(SITE_WWW.
"/app/gmaps/gmaps_".$this->_instanceName.
".css");
778 $registry->addCss(SITE_WWW.
"/app/gmaps/MooComplete.css");
780 $id = cleanVar($_GET,
'id',
'int',
'');
781 $map_id = cleanVar($_GET,
'map',
'int',
'');
785 $link_map =
"<a href=\"".$this->_plink->aLink($this->_instanceName,
'viewFull', array(
'id'=>$map_id)).
"\">"._(
"mappa").
"</a>";
787 $title = $polyline->ml(
'label');
788 $htmlsection =
new htmlSection(array(
'class'=>
'public',
'id'=>
'itinerary_gmaps_'.$this->_instanceName,
'headerTag'=>
'header',
'headerLabel'=>$title,
'headerLinks'=>$link_map));
790 $buffer =
"<div id=\"itinerary_map\">";
792 $buffer .=
"<nav id=\"gmaps_nav\">";
795 $buffer .= _(
"Help");
797 $buffer .=
"<li data-menu=\"maphelp\">"._(
"<p>Utilizzare la voce 'Mappa' per modificare il tipo di mappa.<br/>Utilizzare il campo di testo per ricercare punti di interesse o percorsi nella mappa, iniziando a digitare le chiavi di ricerca verranno visualizzati dei suggerimenti, selezionare quello desiderato e premere il bottone 'cerca'. Per tornare alla visualizzazione completa premere il bottone 'tutti'. <br />Se si desidera filtrare per categoria utlizzare l'apposito menu a tendina.</p>").
"</li>";
801 $buffer .= _(
"Mappa");
803 $buffer .=
"<li class=\"link\" data-menu=\"maptype\" data-type=\"hybrid\">"._(
"Ibrida").
"</li>";
804 $buffer .=
"<li class=\"link selected\" data-menu=\"maptype\" data-type=\"roadmap\">"._(
"roadmap").
"</li>";
805 $buffer .=
"<li class=\"link\" data-menu=\"maptype\" data-type=\"satellite\">"._(
"satellite").
"</li>";
806 $buffer .=
"<li class=\"link\" data-menu=\"maptype\" data-type=\"terrain\">"._(
"terrain").
"</li>";
810 $buffer .=
"<input type=\"text\" name=\"text_search\" id=\"text_search\" value=\"\" placeholder=\""._(
"cerca...").
"\" />";
811 $buffer .=
" <input type=\"button\" name=\"button_search\" id=\"button_search\" value=\""._(
"cerca").
"\" />";
812 $buffer .=
" <input type=\"button\" name=\"button_search_reset\" id=\"button_search_reset\" value=\""._(
"tutti").
"\" />";
816 $buffer .=
"<select id=\"ctg_search\">";
817 $buffer .=
"<option selected>"._(
"tutte le categorie").
"</option>";
818 $buffer .=
"<optgroup label=\""._(
"Punti di interesse").
"\">";
820 $buffer .=
"<option value=\"point_".$id.
"\">".$label.
"</option>";
822 $buffer .=
"</optgroup>";
823 $buffer .=
"</select>";
827 $buffer .=
"<div id=\"map_canvas\" class=\"map\"></div>";
831 foreach(explode(
',', $this->_list_fields) as $f) {
833 if(in_array($f, array(
'label',
'categories',
'address',
'cap',
'city',
'services'))) {
837 $voices =
"'".implode(
"', '", $voices).
"'";
839 $buffer .=
"<script>";
840 $buffer .=
"window.addEvent('load', function() {";
841 $buffer .=
"var gmap = new Gmap($('map_canvas'), {elements_list: true, elements_voices: [".$voices.
"] ,empty_search_result: '".jsVar(_(
"La ricerca non ha prodotto risultati")).
"'});";
842 $points_ids = $polyline->points_id();
844 if(count($points_ids)) {
845 $points =
'var points = {};';
846 foreach($points_ids as $point_id) {
847 $point_obj =
new gmapsPoint($point_id, $this);
848 $point_polylines = array($polyline->id);
849 $points .=
"points.id".$point_obj->id.
" = ".$point_obj->jsObject(
'gmap', $point_polylines, array(), $map_id);
852 $buffer .=
"gmap.addPoints(points);";
855 $polylines =
'var polylines = {};';
856 $polylines .=
"polylines.id".$polyline->id.
" = ".$polyline->jsObject(
'gmap', $map_id);
857 $buffer .= $polylines;
858 $buffer .=
"gmap.addPolylines(polylines);";
859 $buffer .=
"gmap.renderMap();";
861 $buffer .=
"</script>";
862 $buffer .= htmlChars($polyline->description);
864 $htmlsection->content = $buffer;
866 return $htmlsection->render();
877 $registry = registry::instance();
878 $registry->addJs(
"http://maps.googleapis.com/maps/api/js?key=AIzaSyArAE-uBvCZTRaf_eaFn4umUdESmoUvoxM&sensor=true");
879 $registry->addJs(SITE_WWW.
"/app/gmaps/markerclusterer_packed.js");
880 $registry->addJs(SITE_WWW.
"/app/gmaps/infobox.js");
881 $registry->addJs(SITE_WWW.
"/app/gmaps/MooComplete.js");
882 $registry->addJs(SITE_WWW.
"/app/gmaps/ProgressBar.js");
883 $registry->addJs(SITE_WWW.
"/app/gmaps/gmaps.js");
884 $registry->addCss(SITE_WWW.
"/app/gmaps/gmaps_".$this->_instanceName.
".css");
885 $registry->addCss(SITE_WWW.
"/app/gmaps/MooComplete.css");
887 $id = cleanVar($_GET,
'id',
'int',
'');
888 $map_id = cleanVar($_GET,
'map',
'int',
'');
892 $title = $polygon->ml(
'label');
893 $link_map =
"<a href=\"".$this->_plink->aLink($this->_instanceName,
'viewFull', array(
'id'=>$map_id)).
"\">"._(
"mappa").
"</a>";
895 $htmlsection =
new htmlSection(array(
'class'=>
'public',
'id'=>
'area_gmaps_'.$this->_instanceName,
'headerTag'=>
'header',
'headerLabel'=>$title,
'headerLinks'=>$link_map));
897 $buffer =
"<div id=\"area_map\">";
899 $buffer .=
"<nav id=\"gmaps_nav\">";
902 $buffer .= _(
"Help");
904 $buffer .=
"<li data-menu=\"maphelp\">"._(
"<p>Utilizzare la voce 'Mappa' per modificare il tipo di mappa.<br/>Utilizzare il campo di testo per ricercare punti di interesse o aree nella mappa, iniziando a digitare le chiavi di ricerca verranno visualizzati dei suggerimenti, selezionare quello desiderato e premere il bottone 'cerca'. Per tornare alla visualizzazione completa premere il bottone 'tutti'. <br />Se si desidera filtrare per categoria utlizzare l'apposito menu a tendina.</p>").
"</li>";
908 $buffer .= _(
"Mappa");
910 $buffer .=
"<li class=\"link\" data-menu=\"maptype\" data-type=\"hybrid\">"._(
"Ibrida").
"</li>";
911 $buffer .=
"<li class=\"link selected\" data-menu=\"maptype\" data-type=\"roadmap\">"._(
"roadmap").
"</li>";
912 $buffer .=
"<li class=\"link\" data-menu=\"maptype\" data-type=\"satellite\">"._(
"satellite").
"</li>";
913 $buffer .=
"<li class=\"link\" data-menu=\"maptype\" data-type=\"terrain\">"._(
"terrain").
"</li>";
917 $buffer .=
"<input type=\"text\" name=\"text_search\" id=\"text_search\" value=\"\" placeholder=\""._(
"cerca...").
"\" />";
918 $buffer .=
" <input type=\"button\" name=\"button_search\" id=\"button_search\" value=\""._(
"cerca").
"\" />";
919 $buffer .=
" <input type=\"button\" name=\"button_search_reset\" id=\"button_search_reset\" value=\""._(
"tutti").
"\" />";
923 $buffer .=
"<select id=\"ctg_search\">";
924 $buffer .=
"<option selected>"._(
"tutte le categorie").
"</option>";
925 $buffer .=
"<optgroup label=\""._(
"Punti di interesse").
"\">";
927 $buffer .=
"<option value=\"point_".$id.
"\">".$label.
"</option>";
929 $buffer .=
"</optgroup>";
930 $buffer .=
"</select>";
934 $buffer .=
"<div id=\"map_canvas\" class=\"map\"></div>";
938 foreach(explode(
',', $this->_list_fields) as $f) {
940 if(in_array($f, array(
'label',
'categories',
'address',
'cap',
'city',
'services'))) {
944 $voices =
"'".implode(
"', '", $voices).
"'";
946 $buffer .=
"<script>";
947 $buffer .=
"window.addEvent('load', function() {";
948 $buffer .=
"var gmap = new Gmap($('map_canvas'), {elements_list: true, elements_voices: [".$voices.
"] ,empty_search_result: '".jsVar(_(
"La ricerca non ha prodotto risultati")).
"'});";
949 $points_ids = $polygon->points_id();
951 if(count($points_ids)) {
952 $points =
'var points = {};';
953 foreach($points_ids as $point_id) {
954 $point_obj =
new gmapsPoint($point_id, $this);
955 $point_polygons = array($polygon->id);
956 $points .=
"points.id".$point_obj->id.
" = ".$point_obj->jsObject(
'gmap', array(), $point_polygons, $map_id);
959 $buffer .=
"gmap.addPoints(points);";
962 $polygons =
'var polygons = {};';
963 $polygons .=
"polygons.id".$polygon->id.
" = ".$polygon->jsObject(
'gmap', $map_id);
964 $buffer .= $polygons;
965 $buffer .=
"gmap.addPolygons(polygons);";
966 $buffer .=
"gmap.renderMap();";
968 $buffer .=
"</script>";
969 $buffer .= htmlChars($polygon->description);
971 $htmlsection->content = $buffer;
973 return $htmlsection->render();
984 $registry = registry::instance();
986 $id = cleanVar($_GET,
'id',
'int',
'');
987 $map_id = cleanVar($_GET,
'map',
'int',
'');
991 $registry->addCss(SITE_WWW.
"/app/gmaps/gmaps_".$this->_instanceName.
".css");
993 $title = $point->ml(
'label');
994 $link_map =
"<a href=\"".$this->_plink->aLink($this->_instanceName,
'viewFull', array(
'id'=>$map_id)).
"\">"._(
"Mappa").
"</a>";
996 $htmlsection =
new htmlSection(array(
'class'=>
'public',
'headerTag'=>
'header',
'headerLabel'=>$link_map.
' > '.$title));
998 $htmltab =
new htmlTab(array(
"linkPosition"=>
'right',
"title"=>
''));
1002 if(count($point->collections())) {
1003 $link_collections =
"<a href=\"".$this->_plink->aLink($this->_instanceName,
'point', array(
"id"=>$point->id,
'map'=>$map_id,
'block'=>
'collections')).
"\">"._(
"Collezioni").
"</a>";
1004 $links[] = $link_collections;
1006 if(count($point->attachments())) {
1007 $link_attachments =
"<a href=\"".$this->_plink->aLink($this->_instanceName,
'point', array(
"id"=>$point->id,
'map'=>$map_id,
'block'=>
'attachments')).
"\">"._(
"Allegati").
"</a>";
1008 $links[] = $link_attachments;
1010 if(count($point->events())) {
1011 $link_events =
"<a href=\"".$this->_plink->aLink($this->_instanceName,
'point', array(
"id"=>$point->id,
'map'=>$map_id,
'block'=>
'events')).
"\">"._(
"Eventi").
"</a>";
1012 $links[] = $link_events;
1014 if(count($point->videos())) {
1015 $link_videos =
"<a href=\"".$this->_plink->aLink($this->_instanceName,
'point', array(
"id"=>$point->id,
'map'=>$map_id,
'block'=>
'videos')).
"\">"._(
"Video").
"</a>";
1016 $links[] = $link_videos;
1018 if(count($point->images())) {
1019 $link_images =
"<a href=\"".$this->_plink->aLink($this->_instanceName,
'point', array(
"id"=>$point->id,
'map'=>$map_id,
'block'=>
'images')).
"\">"._(
"Immagini").
"</a>";
1020 $links[] = $link_images;
1022 $link_info =
"<a href=\"".$this->_plink->aLink($this->_instanceName,
'point', array(
"id"=>$point->id,
'map'=>$map_id,
'block'=>
'info')).
"\">"._(
"Informazioni").
"</a>";
1023 $links[] = $link_info;
1024 $link_main =
"<a href=\"".$this->_plink->aLink($this->_instanceName,
'point', array(
"id"=>$point->id,
'map'=>$map_id)).
"\">"._(
"Descrizione").
"</a>";
1025 $links[] = $link_main;
1026 $sel_link = $link_main;
1028 if($this->_block ==
'images') {
1030 $sel_link = $link_images;
1032 elseif($this->_block ==
'videos') {
1034 $sel_link = $link_videos;
1036 elseif($this->_block ==
'events') {
1038 $sel_link = $link_events;
1040 elseif($this->_block ==
'attachments') {
1042 $sel_link = $link_attachments;
1044 elseif($this->_block ==
'info') {
1046 $sel_link = $link_info;
1048 elseif($this->_block ==
'collections') {
1050 $sel_link = $link_collections;
1054 $sel_link = $link_main;
1057 $htmltab->navigationLinks = $links;
1058 $htmltab->selectedLink = $sel_link;
1059 $htmltab->htmlContent = $buffer;
1060 $buffer = $htmltab->render();
1062 $htmlsection->content = $buffer;
1064 return $htmlsection->render();
1076 $registry = registry::instance();
1077 $registry->addCss(SITE_WWW.
"/app/gmaps/gmaps_".$this->_instanceName.
".css");
1079 $collection_id = cleanVar($_GET,
'collection',
'int',
'');
1081 $htmlsection =
new htmlSection(array(
'class'=>
'public',
'headerTag'=>
'header'));
1083 if($collection_id) {
1084 $registry->addJs(
"http://ajs.otto.to.it/sources/dev/ajs/ajs.js");
1087 $buffer =
"<h2>".htmlChars($collection->ml(
'name')).
" - <a href=\"".$this->_plink->aLink($this->_instanceName,
'point', array(
'id'=>$point->id,
'block'=>
'collections'),
'').
"\">"._(
"tutte le collezioni").
"</a></h2>";
1088 $buffer .=
"<div id=\"img_container\">";
1089 $buffer .=
"</div>";
1091 $js_images =
"var images = [";
1093 foreach($collection->images() as $img) {
1095 thumb: '".$img->thumbPath().
"',
1096 img: '".$img->path().
"',
1097 title: '".jsVar($img->ml(
'title')).
"',
1098 description: '".jsVar($img->ml(
'description')).
"',
1099 credits: '".jsVar($img->ml(
'credits')).
"'
1102 $js_image =
"var images = [".implode(
',', $images).
"];";
1104 $buffer .=
"<script>";
1105 $buffer .= $js_image.
"\n";
1106 $buffer .=
"ajs.use(['ajs.ui.moogallery'], function() {
1107 var mygallery = new ajs.ui.moogallery('img_container', images);
1109 $buffer .=
"</script>";
1113 if(count($point->collections())) {
1114 $buffer =
"<table class=\"gmaps_collections\">";
1115 foreach($point->collections() as $collection) {
1117 $buffer .=
"<td><a href=\"".$collection->path().
"\" rel=\"lightbox\"><img src=\"".$collection->thumbPath().
"\" /></a></td>";
1119 $buffer .=
"<h2>".htmlChars($collection->ml(
'name')).
"</h2>";
1120 $buffer .=
"<p>".htmlChars($collection->ml(
'description')).
"</p>";
1121 $buffer .=
"<p><a href=\"".$this->_plink->aLink($this->_instanceName,
'point', array(
'id'=>$point->id,
'block'=>
'collections',
'collection'=>$collection->id),
'').
"\">"._(
"Vedi gli oggetti").
"</a></p>";
1125 $buffer .=
"</table>";
1128 $buffer =
"<p>"._(
"Non risultano collezioni pubblicate").
"</p>";
1132 $htmlsection->content = $buffer;
1134 return $htmlsection->render();
1146 $registry = registry::instance();
1147 $registry->addJs(
"http://ajs.otto.to.it/sources/dev/ajs/ajs.js");
1148 $registry->addCss(SITE_WWW.
"/app/gmaps/gmaps_".$this->_instanceName.
".css");
1150 $htmlsection =
new htmlSection(array(
'class'=>
'public',
'headerTag'=>
'header'));
1152 $buffer =
"<div id=\"img_container\">";
1153 $buffer .=
"</div>";
1155 $js_images =
"var images = [";
1157 foreach($point->images() as $img) {
1159 thumb: '".$img->thumbPath().
"',
1160 img: '".$img->path().
"',
1161 title: '".jsVar($img->ml(
'title')).
"',
1162 description: '".jsVar($img->ml(
'description')).
"',
1163 credits: '".jsVar($img->ml(
'credits')).
"'
1166 $js_image =
"var images = [".implode(
',', $images).
"];";
1168 $buffer .=
"<script>";
1169 $buffer .= $js_image.
"\n";
1170 $buffer .=
"ajs.use(['ajs.ui.moogallery'], function() {
1171 var mygallery = new ajs.ui.moogallery('img_container', images);
1173 $buffer .=
"</script>";
1175 $htmlsection->content = $buffer;
1177 return $htmlsection->render();
1191 $registry = registry::instance();
1192 $registry->addCss(SITE_WWW.
"/app/gmaps/gmaps_".$this->_instanceName.
".css");
1194 $htmlsection =
new htmlSection(array(
'class'=>
'public',
'headerTag'=>
'header'));
1196 if(count($point->videos())) {
1197 $buffer =
"<table class=\"gmaps_video\">";
1198 foreach($point->videos() as $video) {
1200 $buffer .=
"<td>".$video->code.
"</td>";
1202 $buffer .=
"<p class=\"title\">".htmlChars($video->ml(
'title')).
"</p>";
1203 $buffer .=
"<p>".htmlChars($video->ml(
'description')).
"</p>";
1204 if($video->credits) {
1205 $buffer .=
"<p>"._(
"credits").
': '.htmlChars($video->ml(
'credits')).
"</p>";
1210 $buffer .=
"</table>";
1213 $buffer =
"<p>"._(
"Non risultano video pubblicati").
"</p>";
1216 $htmlsection->content = $buffer;
1218 return $htmlsection->render();
1232 $registry = registry::instance();
1233 $registry->addCss(SITE_WWW.
"/app/gmaps/gmaps_".$this->_instanceName.
".css");
1235 $htmlsection =
new htmlSection(array(
'class'=>
'public',
'headerTag'=>
'header'));
1237 if(count($point->events())) {
1238 $buffer =
"<table class=\"gmaps_event\">";
1240 $buffer .=
"<th class=\"thIcon\"></th>";
1241 $buffer .=
"<th>"._(
"Data").
"</th>";
1242 $buffer .=
"<th>"._(
"Durata").
"</th>";
1243 $buffer .=
"<th>"._(
"Evento").
"</th>";
1244 $buffer .=
"<th>"._(
"Descizione").
"</th>";
1246 foreach($point->events() as $event) {
1248 $buffer .=
"<td><a href=\"".$event->imagePath().
"\" rel=\"lightbox\"><img src=\"".$event->thumbPath().
"\" /></a></td>";
1249 $buffer .=
"<td>".dbDateToDate($event->date,
'/').
"</td>";
1250 $buffer .=
"<td>".$event->duration.
"</td>";
1251 $buffer .=
"<td>".htmlChars($event->ml(
'name')).
"</td>";
1252 $buffer .=
"<td>".htmlChars($event->ml(
'description')).
"</td>";
1255 $buffer .=
"</table>";
1258 $buffer =
"<p>"._(
"Non risultano eventi pubblicati").
"</p>";
1261 $htmlsection->content = $buffer;
1263 return $htmlsection->render();
1277 $registry = registry::instance();
1278 $registry->addCss(SITE_WWW.
"/app/gmaps/gmaps_".$this->_instanceName.
".css");
1280 $htmlsection =
new htmlSection(array(
'class'=>
'public',
'headerTag'=>
'header'));
1282 if(count($point->attachments())) {
1283 $buffer =
"<table class=\"gmaps_attachment\">";
1284 foreach($point->attachments() as $a) {
1286 $buffer .=
"<td><a href=\"".$a->filePath().
"\">".pub::icon(
'download').
"</a></td>";
1287 $buffer .=
"<td>".$a->filename.
"</td>";
1288 $buffer .=
"<td>".round($a->size/1000, 1).
" Kb</td>";
1289 $buffer .=
"<td>".htmlChars($a->ml(
'description')).
"</td>";
1292 $buffer .=
"</table>";
1295 $buffer =
"<p>"._(
"Non risultano allegati pubblicati").
"</p>";
1298 $htmlsection->content = $buffer;
1300 return $htmlsection->render();
1314 $title = _(
"Informazioni");
1315 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header'));
1319 $categories = array();
1320 foreach($point->ctgs() as $ctg) {
1321 $categories[] = htmlChars($ctg->ml(
'name'));
1324 $buffer .=
"<p><b>"._(
"Categorie").
"</b>: ".implode(
', ', $categories).
"</p>";
1326 $services = array();
1327 foreach($point->services() as $service) {
1328 $services[] = htmlChars($service->ml(
'name'));
1331 if(count($services)) {
1332 $buffer .=
"<p><b>"._(
"Servizi").
"</b>: ".implode(
', ', $services).
"</p>";
1336 $buffer .=
"<p><b>"._(
"Telefono").
"</b>: ".$point->phone.
"</p>";
1340 $buffer .=
"<p><b>"._(
"Email").
"</b>: <a href=\"mailto:".$point->email.
"\">".$point->email.
"</a></p>";
1344 $buffer .=
"<p><b>"._(
"Sito web").
"</b>: <a href=\"".$point->web.
"\">".$point->web.
"</a></p>";
1347 $nation = $this->_db->getFieldFromId(
'nation', $_SESSION[
'lng'],
'id', $point->nation);
1348 $buffer .=
"<p><b>"._(
"Indirizzo").
"</b>: ".htmlChars($point->ml(
'address').
', '.$point->cap.
' '.$point->ml(
'city').
', '.$nation).
"</p>";
1350 $buffer .= htmlChars($point->ml(
'information'));
1352 if($point->opening_hours) {
1353 $buffer .=
"<p><b>"._(
"Orari di apertura").
"</b>: ".$point->ml(
'opening_hours').
"</p>";
1356 $htmlsection->content = $buffer;
1358 return $htmlsection->render();
1370 $title = _(
"Descrizione");
1371 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header'));
1375 $buffer = htmlChars($point->ml(
'description'));
1377 $buffer .=
"<div class=\"null\"></div>";
1379 $htmlsection->content = $buffer;
1381 return $htmlsection->render();
1392 $this->accessGroup(
'ALL');
1394 $htmltab =
new htmlTab(array(
"linkPosition"=>
'right',
"title"=>$this->_instanceLabel));
1395 $link_admin =
"<a href=\"".$this->_home.
"?evt[$this->_instanceName-manageDoc]&block=permissions\">"._(
"Permessi").
"</a>";
1396 $link_options =
"<a href=\"".$this->_home.
"?evt[$this->_instanceName-manageDoc]&block=options\">"._(
"Opzioni").
"</a>";
1397 $link_polygon =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polygon\">"._(
"Aree").
"</a>";
1398 $link_polygon_ctg =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polygon_ctg\">"._(
"Ctg A").
"</a>";
1399 $link_polyline =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polyline\">"._(
"Percorsi").
"</a>";
1400 $link_polyline_ctg =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polyline_ctg\">"._(
"Ctg P").
"</a>";
1401 $link_point =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point\">"._(
"Punti di interesse").
"</a>";
1402 $link_point_ctg =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_ctg\">"._(
"Ctg PI").
"</a>";
1403 $link_service =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=service\">"._(
"Servizi").
"</a>";
1404 $link_marker =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=marker\">"._(
"Markers").
"</a>";
1405 $link_dft =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]\">"._(
"Mappe").
"</a>";
1406 $sel_link = $link_dft;
1408 if($this->_block ==
'options') {
1409 $buffer = sysfunc::manageOptions($this->_instance, $this->_className);
1410 $sel_link = $link_options;
1412 elseif($this->_block ==
'permissions') {
1413 $buffer = sysfunc::managePermissions($this->_instance, $this->_className);
1414 $sel_link = $link_admin;
1416 elseif($this->_block ==
'service') {
1418 $sel_link = $link_service;
1420 elseif($this->_block ==
'marker') {
1422 $sel_link = $link_marker;
1424 elseif($this->_block ==
'point_ctg') {
1426 $sel_link = $link_point_ctg;
1428 elseif($this->_block ==
'point_image') {
1430 $sel_link = $link_point;
1432 elseif($this->_block ==
'point_video') {
1434 $sel_link = $link_point;
1436 elseif($this->_block ==
'point_event') {
1438 $sel_link = $link_point;
1440 elseif($this->_block ==
'point_attachment') {
1442 $sel_link = $link_point;
1444 elseif($this->_block ==
'point_collection') {
1446 $sel_link = $link_point;
1448 elseif($this->_block ==
'point') {
1450 $sel_link = $link_point;
1452 elseif($this->_block ==
'polygon') {
1454 $sel_link = $link_polygon;
1456 elseif($this->_block ==
'polygon_point') {
1458 $sel_link = $link_polygon;
1460 elseif($this->_block ==
'polygon_ctg') {
1462 $sel_link = $link_polygon_ctg;
1464 elseif($this->_block ==
'polyline') {
1466 $sel_link = $link_polyline;
1468 elseif($this->_block ==
'polyline_point') {
1470 $sel_link = $link_polyline;
1472 elseif($this->_block ==
'polyline_ctg') {
1474 $sel_link = $link_polyline_ctg;
1476 elseif($this->_block ==
'map_item') {
1483 $htmltab->navigationLinks = array($link_admin, $link_options, $link_service, $link_polygon_ctg, $link_polygon, $link_polyline_ctg, $link_polyline, $link_point_ctg, $link_point, $link_marker, $link_dft);
1484 $htmltab->selectedLink = $sel_link;
1485 $htmltab->htmlContent = $buffer;
1486 return $htmltab->render();
1498 $id = cleanVar($_REQUEST,
'id',
'int',
'');
1500 $marker->instance = $this->_instance;
1504 if(in_array($this->_action, array(
'insert',
'modify'))) {
1505 $col2 = $marker->form($this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=marker");
1507 elseif($this->_action ==
'delete') {
1508 $res = $marker->delete();
1509 if($res ===
'points') {
1510 exit(error::errorMessage(array(
'error'=>_(
"Il marker è utilizzato da uno o più punti di interesse. Eliminarli o cambiarne il marker e riprovare")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=marker"));
1512 elseif($res ===
false) {
1513 exit(error::errorMessage(array(
'error'=>_(
"Impossibile eliminare il marker, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=marker"));
1515 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=marker");
1521 $buffer =
"<div class=\"vertical_1\">";
1523 $buffer .=
"</div>";
1525 $buffer .=
"<div class=\"vertical_2\">";
1527 $buffer .=
"</div>";
1529 $buffer .=
"<div class=\"null\"></div>";
1543 $title = _(
"Markers");
1544 $link_insert =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=marker&action=insert\">".pub::icon(
'insert', _(
"nuovo marker")).
"</a>";
1545 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLinks'=>$link_insert,
'headerLabel'=>$title));
1549 if($tot = count($marker_ids)) {
1550 $htmlList =
new htmlList(array(
"numItems"=>$tot,
"separator"=>
true));
1551 $buffer = $htmlList->start();
1552 foreach($marker_ids as $marker_id) {
1554 $link_modify =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=marker&action=modify&id=".$marker->id.
"\">".pub::icon(
'modify').
"</a>";
1555 $link_delete =
"<span class=\"link\" onclick=\"if(confirm('".jsVar(_(
"Sicuro di voler eliminare il servizio?")).
"')) location.href='".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=marker&action=delete&id=".$marker->id.
"';\">".pub::icon(
'delete').
"</span>";
1556 $selected = $marker->id == $sel_id ?
true :
false;
1557 $buffer .= $htmlList->item(htmlChars($marker->label), array($link_modify, $link_delete), $selected,
true);
1559 $buffer .= $htmlList->end();
1562 $buffer =
"<p class=\"message\">"._(
"Non risultano markers registrati").
"</p>";
1565 $htmlsection->content = $buffer;
1567 return $htmlsection->render();
1578 $title = _(
"Informazioni");
1579 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLabel'=>$title));
1581 $buffer = _(
"Gestione dei marker associabili ai punti di interesse");
1583 $htmlsection->content = $buffer;
1585 return $htmlsection->render();
1598 $point_id = cleanVar($_REQUEST,
'point_id',
'int',
'');
1600 $id = cleanVar($_REQUEST,
'id',
'int',
'');
1602 $attachment->point_id = $point->id;
1606 if(in_array($this->_action, array(
'insert',
'modify'))) {
1607 $col2 = $attachment->form($this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_attachment&point_id=$point_id");
1609 elseif($this->_action ==
'delete') {
1610 $res = $attachment->delete();
1611 if($res ===
false) {
1612 exit(error::errorMessage(array(
'error'=>_(
"Impossibile eliminare l'allegato, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_attachment&point_id=".$point_id));
1614 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=point_attachment&point_id=".$point_id);
1620 $buffer =
"<div class=\"vertical_1\">";
1622 $buffer .=
"</div>";
1624 $buffer .=
"<div class=\"vertical_2\">";
1626 $buffer .=
"</div>";
1628 $buffer .=
"<div class=\"null\"></div>";
1641 $point_id = cleanVar($_REQUEST,
'point_id',
'int',
'');
1643 $id = cleanVar($_REQUEST,
'id',
'int',
'');
1644 $mng = cleanVar($_REQUEST,
'mng',
'string',
'');
1646 $collection->point_id = $point->id;
1650 if($mng ==
'image') {
1651 $image_id = cleanVar($_REQUEST,
'image_id',
'int',
'');
1653 $image->collection_id = $collection->id;
1655 if(in_array($this->_action, array(
'insert_image',
'modify_image'))) {
1656 $col2 = $image->form($this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_collection&point_id=$collection->point_id&id=$collection->id&mng=image");
1658 elseif($this->_action ==
'delete_image') {
1659 $res = $image->delete();
1660 if($res ===
false) {
1661 exit(error::errorMessage(array(
'error'=>_(
"Impossibile eliminare l'immagine, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_collection&point_id=".$collection->point_id.
"&id=".$collection->id));
1663 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=point_collection&point_id=".$collection->point_id.
"&id=".$collection->id);
1670 if(in_array($this->_action, array(
'insert',
'modify'))) {
1671 $col2 = $collection->form($this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_collection&point_id=$point_id");
1673 elseif($this->_action ==
'delete') {
1674 $res = $collection->delete();
1675 if($res ===
false) {
1676 exit(error::errorMessage(array(
'error'=>_(
"Impossibile eliminare la collezione, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_collection&point_id=".$point_id));
1678 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=point_collection&point_id=".$point_id);
1685 $buffer =
"<div class=\"vertical_1\">";
1687 $buffer .=
"</div>";
1689 $buffer .=
"<div class=\"vertical_2\">";
1691 $buffer .=
"</div>";
1693 $buffer .=
"<div class=\"null\"></div>";
1708 $title = sprintf(_(
"Allegati del punto di interesse '%s'"), htmlChars($point->label));
1709 $link_insert =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_attachment&point_id=".$point->id.
"&action=insert\">".pub::icon(
'insert', _(
"nuovo allegato")).
"</a>";
1710 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLinks'=>$link_insert,
'headerLabel'=>$title));
1712 if($tot = count($point->attachments())) {
1713 $htmlList =
new htmlList(array(
"numItems"=>$tot,
"separator"=>
true));
1714 $buffer = $htmlList->start();
1715 foreach($point->attachments() as $attachment) {
1716 $link_modify =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_attachment&action=modify&point_id=".$point->id.
"&id=".$attachment->id.
"\">".pub::icon(
'modify').
"</a>";
1717 $link_delete =
"<span class=\"link\" onclick=\"if(confirm('".jsVar(_(
"Sicuro di voler eliminare l'allegato?")).
"')) location.href='".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_attachment&action=delete&point_id=".$point->id.
"&id=".$attachment->id.
"';\">".pub::icon(
'delete').
"</span>";
1718 $selected = $attachment->id == $sel_attachment->id ?
true :
false;
1719 $buffer .= $htmlList->item(htmlChars($attachment->name), array($link_modify, $link_delete), $selected,
true);
1721 $buffer .= $htmlList->end();
1724 $buffer =
"<p class=\"message\">"._(
"Non risultano allegati registrati").
"</p>";
1727 $htmlsection->content = $buffer;
1729 return $htmlsection->render();
1742 $title = sprintf(_(
"Collezioni del punto di interesse '%s'"), htmlChars($point->label));
1743 $link_insert =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_collection&point_id=".$point->id.
"&action=insert\">".pub::icon(
'insert', _(
"nuova collezione")).
"</a>";
1744 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLinks'=>$link_insert,
'headerLabel'=>$title));
1746 if($tot = count($point->collections())) {
1747 $htmlList =
new htmlList(array(
"numItems"=>$tot,
"separator"=>
true));
1748 $buffer = $htmlList->start();
1749 foreach($point->collections() as $collection) {
1750 $link_modify =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_collection&action=modify&point_id=".$point->id.
"&id=".$collection->id.
"\">".pub::icon(
'modify').
"</a>";
1751 $link_delete =
"<span class=\"link\" onclick=\"if(confirm('".jsVar(_(
"Sicuro di voler eliminare la collezione?")).
"')) location.href='".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_collection&action=delete&point_id=".$point->id.
"&id=".$collection->id.
"';\">".pub::icon(
'delete').
"</span>";
1752 $link_images =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_collection&action=modify&point_id=".$point->id.
"&id=".$collection->id.
"&mng=image\">".$this->_icon_image.
"</a>";
1753 $selected = $collection->id == $sel_collection->id ?
true :
false;
1754 $buffer .= $htmlList->item(htmlChars($collection->name), array($link_modify, $link_delete, $link_images), $selected,
true);
1756 $buffer .= $htmlList->end();
1759 $buffer =
"<p class=\"message\">"._(
"Non risultano collezioni registrate").
"</p>";
1762 $htmlsection->content = $buffer;
1764 return $htmlsection->render();
1776 $title = sprintf(_(
"Immagini della collezione '%s'"), htmlChars($collection->name));
1777 $link_insert =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_collection&point_id=".$collection->point_id.
"&id=".$collection->id.
"&mng=image&action=insert_image\">".pub::icon(
'insert', _(
"nuova collezione")).
"</a>";
1778 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLinks'=>$link_insert,
'headerLabel'=>$title));
1780 if($tot = count($collection->images())) {
1781 $htmlList =
new htmlList(array(
"numItems"=>$tot,
"separator"=>
true));
1782 $buffer = $htmlList->start();
1783 foreach($collection->images() as $image) {
1784 $link_modify =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_collection&action=modify_image&point_id=".$collection->point_id.
"&id=".$collection->id.
"&mng=image&image_id=".$image->id.
"\">".pub::icon(
'modify').
"</a>";
1785 $link_delete =
"<span class=\"link\" onclick=\"if(confirm('".jsVar(_(
"Sicuro di voler eliminare l'immagine?")).
"')) location.href='".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_collection&action=delete_image&point_id=".$collection->point_id.
"&id=".$collection->id.
"&mng=image&image_id=".$image->id.
"';\">".pub::icon(
'delete').
"</span>";
1786 $buffer .= $htmlList->item(htmlChars($image->title), array($link_modify, $link_delete),
false,
true);
1788 $buffer .= $htmlList->end();
1791 $buffer =
"<p class=\"message\">"._(
"Non risultano immagini registrate").
"</p>";
1794 $htmlsection->content = $buffer;
1796 return $htmlsection->render();
1807 $title = _(
"Informazioni");
1808 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLabel'=>$title));
1810 $buffer = _(
"Gestione degli allegati associati al punto di interesse");
1812 $htmlsection->content = $buffer;
1814 return $htmlsection->render();
1826 $title = _(
"Informazioni");
1827 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLabel'=>$title));
1829 $buffer = _(
"Gestione delle collezioni associate al punto di interesse, Ciasuna collezione può contenere un numero variabile di immagini.");
1831 $htmlsection->content = $buffer;
1833 return $htmlsection->render();
1845 $point_id = cleanVar($_REQUEST,
'point_id',
'int',
'');
1847 $id = cleanVar($_REQUEST,
'id',
'int',
'');
1849 $event->point_id = $point->id;
1851 $col1 = $this->
listEvent($point, $event);
1853 if(in_array($this->_action, array(
'insert',
'modify'))) {
1854 $col2 = $event->form($this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_event&point_id=$point_id");
1856 elseif($this->_action ==
'delete') {
1857 $res = $event->delete();
1858 if($res ===
false) {
1859 exit(error::errorMessage(array(
'error'=>_(
"Impossibile eliminare l'evento, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_event&point_id=".$point_id));
1861 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=point_event&point_id=".$point_id);
1867 $buffer =
"<div class=\"vertical_1\">";
1869 $buffer .=
"</div>";
1871 $buffer .=
"<div class=\"vertical_2\">";
1873 $buffer .=
"</div>";
1875 $buffer .=
"<div class=\"null\"></div>";
1890 $title = sprintf(_(
"Eventi del punto di interesse '%s'"), htmlChars($point->label));
1891 $link_insert =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_event&point_id=".$point->id.
"&action=insert\">".pub::icon(
'insert', _(
"nuovo evento")).
"</a>";
1892 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLinks'=>$link_insert,
'headerLabel'=>$title));
1894 if($tot = count($point->events())) {
1895 $htmlList =
new htmlList(array(
"numItems"=>$tot,
"separator"=>
true));
1896 $buffer = $htmlList->start();
1897 foreach($point->events() as $event) {
1898 $link_modify =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_event&action=modify&point_id=".$point->id.
"&id=".$event->id.
"\">".pub::icon(
'modify').
"</a>";
1899 $link_delete =
"<span class=\"link\" onclick=\"if(confirm('".jsVar(_(
"Sicuro di voler eliminare l'evento?")).
"')) location.href='".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_event&action=delete&point_id=".$point->id.
"&id=".$event->id.
"';\">".pub::icon(
'delete').
"</span>";
1900 $selected = $event->id == $sel_event->id ?
true :
false;
1901 $buffer .= $htmlList->item(htmlChars($event->name), array($link_modify, $link_delete), $selected,
true);
1903 $buffer .= $htmlList->end();
1906 $buffer =
"<p class=\"message\">"._(
"Non risultano eventi registrati").
"</p>";
1909 $htmlsection->content = $buffer;
1911 return $htmlsection->render();
1922 $title = _(
"Informazioni");
1923 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLabel'=>$title));
1925 $buffer = _(
"Gestione degli eventi associati al punto di interesse");
1927 $htmlsection->content = $buffer;
1929 return $htmlsection->render();
1941 $point_id = cleanVar($_REQUEST,
'point_id',
'int',
'');
1943 $id = cleanVar($_REQUEST,
'id',
'int',
'');
1945 $video->point_id = $point->id;
1947 $col1 = $this->
listVideo($point, $video);
1949 if(in_array($this->_action, array(
'insert',
'modify'))) {
1950 $col2 = $video->form($this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_video&point_id=$point_id");
1952 elseif($this->_action ==
'delete') {
1953 $res = $video->delete();
1954 if($res ===
false) {
1955 exit(error::errorMessage(array(
'error'=>_(
"Impossibile eliminare il video, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_video&point_id=".$point_id));
1957 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=point_video&point_id=".$point_id);
1963 $buffer =
"<div class=\"vertical_1\">";
1965 $buffer .=
"</div>";
1967 $buffer .=
"<div class=\"vertical_2\">";
1969 $buffer .=
"</div>";
1971 $buffer .=
"<div class=\"null\"></div>";
1986 $title = sprintf(_(
"Video del punto di interesse '%s'"), htmlChars($point->label));
1987 $link_insert =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_video&point_id=".$point->id.
"&action=insert\">".pub::icon(
'insert', _(
"nuovo video")).
"</a>";
1988 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLinks'=>$link_insert,
'headerLabel'=>$title));
1990 if($tot = count($point->videos())) {
1991 $htmlList =
new htmlList(array(
"numItems"=>$tot,
"separator"=>
true));
1992 $buffer = $htmlList->start();
1993 foreach($point->videos() as $video) {
1994 $link_modify =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_video&action=modify&point_id=".$point->id.
"&id=".$video->id.
"\">".pub::icon(
'modify').
"</a>";
1995 $link_delete =
"<span class=\"link\" onclick=\"if(confirm('".jsVar(_(
"Sicuro di voler eliminare il video?")).
"')) location.href='".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_video&action=delete&point_id=".$point->id.
"&id=".$video->id.
"';\">".pub::icon(
'delete').
"</span>";
1996 $selected = $video->id == $sel_video->id ?
true :
false;
1997 $buffer .= $htmlList->item(htmlChars($video->title), array($link_modify, $link_delete), $selected,
true);
1999 $buffer .= $htmlList->end();
2002 $buffer =
"<p class=\"message\">"._(
"Non risultano video registrati").
"</p>";
2005 $htmlsection->content = $buffer;
2007 return $htmlsection->render();
2018 $title = _(
"Informazioni");
2019 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLabel'=>$title));
2021 $buffer = _(
"Gestione dei video associati al punto di interesse");
2023 $htmlsection->content = $buffer;
2025 return $htmlsection->render();
2037 $point_id = cleanVar($_REQUEST,
'point_id',
'int',
'');
2039 $id = cleanVar($_REQUEST,
'id',
'int',
'');
2041 $image->point_id = $point->id;
2043 $col1 = $this->
listImage($point, $image);
2045 if(in_array($this->_action, array(
'insert',
'modify'))) {
2046 $col2 = $image->form($this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_image&point_id=$point_id");
2048 elseif($this->_action ==
'delete') {
2049 $res = $image->delete();
2050 if($res ===
false) {
2051 exit(error::errorMessage(array(
'error'=>_(
"Impossibile eliminare l'immagine, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_image&point_id=".$point_id));
2053 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=point_image&point_id=".$point_id);
2059 $buffer =
"<div class=\"vertical_1\">";
2061 $buffer .=
"</div>";
2063 $buffer .=
"<div class=\"vertical_2\">";
2065 $buffer .=
"</div>";
2067 $buffer .=
"<div class=\"null\"></div>";
2082 $title = sprintf(_(
"Immagini del punto di interesse '%s'"), htmlChars($point->label));
2083 $link_insert =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_image&point_id=".$point->id.
"&action=insert\">".pub::icon(
'insert', _(
"nuova immagine")).
"</a>";
2084 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLinks'=>$link_insert,
'headerLabel'=>$title));
2086 if($tot = count($point->images())) {
2087 $htmlList =
new htmlList(array(
"numItems"=>$tot,
"separator"=>
true));
2088 $buffer = $htmlList->start();
2089 foreach($point->images() as $image) {
2090 $link_modify =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_image&action=modify&point_id=".$point->id.
"&id=".$image->id.
"\">".pub::icon(
'modify').
"</a>";
2091 $link_delete =
"<span class=\"link\" onclick=\"if(confirm('".jsVar(_(
"Sicuro di voler eliminare l'immagine?")).
"')) location.href='".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_image&action=delete&point_id=".$point->id.
"&id=".$image->id.
"';\">".pub::icon(
'delete').
"</span>";
2092 $selected = $image->id == $sel_image->id ?
true :
false;
2093 $buffer .= $htmlList->item(htmlChars($image->title), array($link_modify, $link_delete), $selected,
true);
2095 $buffer .= $htmlList->end();
2098 $buffer =
"<p class=\"message\">"._(
"Non risultano immagini registrate").
"</p>";
2101 $htmlsection->content = $buffer;
2103 return $htmlsection->render();
2114 $title = _(
"Informazioni");
2115 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLabel'=>$title));
2117 $buffer = _(
"Gestione delle immagini associate al punto di interesse");
2119 $htmlsection->content = $buffer;
2121 return $htmlsection->render();
2133 $id = cleanVar($_REQUEST,
'id',
'int',
'');
2135 $service->instance = $this->_instance;
2139 if(in_array($this->_action, array(
'insert',
'modify'))) {
2140 $col2 = $service->form($this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=service");
2142 elseif($this->_action ==
'delete') {
2143 $res = $service->delete();
2144 if($res ===
'points') {
2145 exit(error::errorMessage(array(
'error'=>_(
"Il servizio è presente in uno o più punti di interesse. Eliminarli o cambiarne il servizio e riprovare")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=service"));
2147 elseif($res ===
false) {
2148 exit(error::errorMessage(array(
'error'=>_(
"Impossibile eliminare il servizio, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=service"));
2150 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=service");
2156 $buffer =
"<div class=\"vertical_1\">";
2158 $buffer .=
"</div>";
2160 $buffer .=
"<div class=\"vertical_2\">";
2162 $buffer .=
"</div>";
2164 $buffer .=
"<div class=\"null\"></div>";
2179 $title = _(
"Servizi");
2180 $link_insert =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=service&action=insert\">".pub::icon(
'insert', _(
"nuovo servizio")).
"</a>";
2181 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLinks'=>$link_insert,
'headerLabel'=>$title));
2185 if($tot = count($service_ids)) {
2186 $htmlList =
new htmlList(array(
"numItems"=>$tot,
"separator"=>
true));
2187 $buffer = $htmlList->start();
2188 foreach($service_ids as $service_id) {
2190 $link_modify =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=service&action=modify&id=".$service->id.
"\">".pub::icon(
'modify').
"</a>";
2191 $link_delete =
"<span class=\"link\" onclick=\"if(confirm('".jsVar(_(
"Sicuro di voler eliminare il servizio?")).
"')) location.href='".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=service&action=delete&id=".$service->id.
"';\">".pub::icon(
'delete').
"</span>";
2192 $selected = $service->id == $sel_id ?
true :
false;
2193 $buffer .= $htmlList->item(htmlChars($service->name), array($link_modify, $link_delete), $selected,
true);
2195 $buffer .= $htmlList->end();
2198 $buffer =
"<p class=\"message\">"._(
"Non risultano servizi registrati").
"</p>";
2201 $htmlsection->content = $buffer;
2203 return $htmlsection->render();
2214 $title = _(
"Informazioni");
2215 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLabel'=>$title));
2217 $buffer = _(
"Gestione dei servizi associabili ai punti di interesse");
2219 $htmlsection->content = $buffer;
2221 return $htmlsection->render();
2233 $registry = registry::instance();
2234 $registry->addJs(
"http://maps.googleapis.com/maps/api/js?key=AIzaSyArAE-uBvCZTRaf_eaFn4umUdESmoUvoxM&sensor=true");
2236 $id = cleanVar($_REQUEST,
'id',
'int',
'');
2239 $title = sprintf(_(
"Punti di interesse, percorsi ed aree associati alla mappa '%s'"), htmlChars($map->name));
2240 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLabel'=>$title));
2244 if(isset($_POST[
'submit_add'])) {
2245 $add_point_ids = cleanVar($_POST,
'point_add',
'array',
'');
2246 $res = $map->addPoints($add_point_ids);
2247 if(count($add_point_ids) && !$res) {
2248 exit(error::errorMessage(array(
'error'=>_(
"Si è verificato un errore, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=map_item&id=$id"));
2251 $add_polylines_ids = cleanVar($_POST,
'polyline_add',
'array',
'');
2252 $res = $map->addPolylines($add_polylines_ids);
2254 if(count($add_polylines_ids) && !$res) {
2255 exit(error::errorMessage(array(
'error'=>_(
"Si è verificato un errore, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=map_item&id=$id"));
2258 $add_polygons_ids = cleanVar($_POST,
'polygon_add',
'array',
'');
2259 $res = $map->addPolygons($add_polygons_ids);
2261 if(count($add_polygons_ids) && !$res) {
2262 exit(error::errorMessage(array(
'error'=>_(
"Si è verificato un errore, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=map_item&id=$id"));
2265 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=map_item&id=".$id);
2268 elseif(isset($_POST[
'submit_remove'])) {
2269 $remove_point_ids = cleanVar($_POST,
'point_remove',
'array',
'');
2270 $res = $map->removePoints($remove_point_ids);
2271 if(count($remove_point_ids) && !$res) {
2272 exit(error::errorMessage(array(
'error'=>_(
"Si è verificato un errore, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=map_item&id=$id"));
2275 $remove_polyline_ids = cleanVar($_POST,
'polyline_remove',
'array',
'');
2276 $res = $map->removePolylines($remove_polyline_ids);
2277 if(count($remove_polyline_ids) && !$res) {
2278 exit(error::errorMessage(array(
'error'=>_(
"Si è verificato un errore, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=map_item&id=$id"));
2281 $remove_polygon_ids = cleanVar($_POST,
'polygon_remove',
'array',
'');
2282 $res = $map->removePolygons($remove_polygon_ids);
2283 if(count($remove_polygon_ids) && !$res) {
2284 exit(error::errorMessage(array(
'error'=>_(
"Si è verificato un errore, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=map_item&id=$id"));
2287 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=map_item&id=".$id);
2291 $polylines_code =
'';
2292 $polygons_code =
'';
2293 $buffer .=
"<h2>"._(
"Punti di interesse, percorsi ed aree presenti").
"</h2>";
2294 if(count($map->points()) || count($map->polylines()) || count($map->polygons())) {
2295 $gform =
new Form(
'form_remove_map_point',
'post',
false, array(
'tblLayout'=>
false));
2296 $buffer .= $gform->form(
'',
false,
'');
2297 $buffer .= $gform->hidden(
'id', $id);
2298 $buffer .=
"<table class=\"generic\" style=\"margin-bottom: 10px;\">";
2300 if(count($map->points())) {
2303 $buffer .=
"<th>Etichetta punto di interesse</th>";
2304 $buffer .=
"<th>Rimuovi</th>";
2306 foreach($map->points() as $point) {
2307 $points_code .= $point->gmapCode(
'map',
'bounds');
2309 $buffer .=
"<td>".htmlChars($point->label).
"</td>";
2310 $buffer .=
"<td><input type=\"checkbox\" name=\"point_remove[]\" value=\"".$point->id.
"\" /></td>";
2314 if(count($map->polylines())) {
2317 $buffer .=
"<th>Etichetta percorso</th>";
2318 $buffer .=
"<th>Rimuovi</th>";
2320 foreach($map->polylines() as $polyline) {
2321 $polylines_code .= $polyline->gmapCode(
'map',
'bounds');
2323 $buffer .=
"<td>".htmlChars($polyline->label).
"</td>";
2324 $buffer .=
"<td><input type=\"checkbox\" name=\"polyline_remove[]\" value=\"".$polyline->id.
"\" /></td>";
2328 if(count($map->polygons())) {
2331 $buffer .=
"<th>Etichetta percorso</th>";
2332 $buffer .=
"<th>Rimuovi</th>";
2334 foreach($map->polygons() as $polygon) {
2335 $polygons_code .= $polygon->gmapCode(
'map',
'bounds');
2337 $buffer .=
"<td>".htmlChars($polygon->label).
"</td>";
2338 $buffer .=
"<td><input type=\"checkbox\" name=\"polygon_remove[]\" value=\"".$polygon->id.
"\" /></td>";
2342 $buffer .=
"</table>";
2343 $buffer .=
"<p>".$gform->input(
'submit_remove',
'submit', _(
"rimuovi selezionati"), array(
'classField'=>
'submit')).
"</p>";
2344 $buffer .= $gform->cform();
2347 $buffer .=
"<p class=\"message\">"._(
"Non risultano punti di interesse, percorsi o aree associati").
"</p>";
2350 $buffer .=
"<h2>Situazione attuale</h2>";
2351 $buffer .=
"<div id=\"map_canvas\" style=\"width:100%; height: 300px;\"></div>";
2352 $buffer .=
"<script>";
2353 $buffer .=
"window.addEvent('load', function() {
2355 center: new google.maps.LatLng(45, 7),
2357 mapTypeId: google.maps.MapTypeId.ROADMAP
2360 var map = new google.maps.Map($('map_canvas'), myopt);
2361 var bounds = new google.maps.LatLngBounds();
2365 map.fitBounds(bounds);
2368 $buffer .=
"</script>";
2370 $buffer .=
"<h2>"._(
"Ricerca ed aggiunta punti, percorsi ed aree").
"</h2>";
2374 $htmlsection->content = $buffer;
2376 return $htmlsection->render();
2388 $gform =
new Form(
'form_search_add_map_polygon_polyline_point',
'post',
false);
2389 $buffer = $gform->form(
'',
false,
'');
2391 $buffer .= $gform->cselect(
'point_ctg',
'',
gmapsPointCtg::getForSelect($this->_instance), _(
"Categoria punti di interesse"), array(
'id'=>
'point_ctg'));
2392 $buffer .= $gform->cinput(
'point_label',
'text',
'', _(
"Etichetta punti di interesse"), array(
'maxlength'=>200,
'id'=>
'point_label'));
2393 $buffer .= $gform->cselect(
'polyline_ctg',
'',
gmapsPolylineCtg::getForSelect($this->_instance), _(
"Categoria percorsi"), array(
'id'=>
'polyline_ctg'));
2394 $buffer .= $gform->cinput(
'polyline_label',
'text',
'', _(
"Etichetta percorsi"), array(
'maxlength'=>200,
'id'=>
'polyline_label'));
2395 $buffer .= $gform->cselect(
'polygon_ctg',
'',
gmapsPolygonCtg::getForSelect($this->_instance), _(
"Categoria aree"), array(
'id'=>
'polygon_ctg'));
2396 $buffer .= $gform->cinput(
'polygon_label',
'text',
'', _(
"Etichetta aree"), array(
'maxlength'=>200,
'id'=>
'polygon_label'));
2398 $onclick =
"ajaxRequest('post', '".$this->_home.
"?pt[".$this->_instanceName.
"-mapPolygonPolylinePointSearch]', 'id=".$map->id.
"&point_ctg='+$('point_ctg').value+'&point_label='+$('point_label').value+'&polyline_ctg='+$('polyline_ctg').value+'&polyline_label='+$('polyline_label').value+'&polygon_ctg='+$('polygon_ctg').value+'&polygon_label='+$('polygon_label').value, 'map_polygon_polyline_point_search', {load: 'map_polygon_polyline_point_search'})";
2400 $buffer .= $gform->cinput(
'submit_search',
'button', _(
"cerca"),
'', array(
'classField'=>
'submit',
'js'=>
"onclick=\"$onclick\""));
2402 $buffer .= $gform->cform();
2404 $buffer .=
"<div id=\"map_polygon_polyline_point_search\" style=\"margin-top: 10px;\"></div>";
2417 $this->accessGroup(
'ALL');
2419 $id = cleanVar($_POST,
'id',
'int',
'');
2420 $point_ctg = cleanVar($_POST,
'point_ctg',
'int',
'');
2421 $point_label = cleanVar($_POST,
'point_label',
'string',
'');
2422 $polyline_ctg = cleanVar($_POST,
'polyline_ctg',
'int',
'');
2423 $polyline_label = cleanVar($_POST,
'polyline_label',
'string',
'');
2424 $polygon_ctg = cleanVar($_POST,
'polygon_ctg',
'int',
'');
2425 $polygon_label = cleanVar($_POST,
'polygon_label',
'string',
'');
2430 if(count($map->points_id())) {
2431 $where[] =
"id NOT IN (".implode(
',', $map->points_id()).
")";
2433 if(count($map->polylines_id())) {
2434 $nopoints = array();
2435 foreach($map->polylines() as $polyline) {
2436 $nopoints = array_merge($nopoints, $polyline->points_id());
2438 $where[] =
"id NOT IN (".implode(
',', $nopoints).
")";
2440 if(count($map->polygons_id())) {
2441 $nopoints = array();
2442 foreach($map->polygons() as $polygon) {
2443 $nopoints = array_merge($nopoints, $polygon->points_id());
2445 $where[] =
"id NOT IN (".implode(
',', $nopoints).
")";
2448 $where[] =
"id IN (SELECT point_id FROM ".$this->_tbl_point_point_ctg.
" WHERE ctg_id='$point_ctg')";
2451 $where[] =
"label LIKE '%$point_label%'";
2454 $point_ids =
gmapsPoint::get($this->_instance, array(
'where'=>implode(
" AND ", $where)));
2457 if(count($map->polylines_id())) {
2458 $where[] =
"id NOT IN (".implode(
',', $map->polylines_id()).
")";
2461 $where[] =
"id IN (SELECT polyline_id FROM ".$this->_tbl_polyline_polyline_ctg.
" WHERE ctg_id='$polyline_ctg')";
2463 if($polyline_label) {
2464 $where[] =
"label LIKE '%$polyline_label%'";
2467 $polyline_ids =
gmapsPolyline::get($this->_instance, array(
'where'=>implode(
" AND ", $where)));
2470 if(count($map->polygons_id())) {
2471 $where[] =
"id NOT IN (".implode(
',', $map->polygons_id()).
")";
2474 $where[] =
"id IN (SELECT polygon_id FROM ".$this->_tbl_polygon_polygon_ctg.
" WHERE ctg_id='$polygon_ctg')";
2476 if($polygon_label) {
2477 $where[] =
"label LIKE '%$polygon_label%'";
2480 $polygon_ids =
gmapsPolygon::get($this->_instance, array(
'where'=>implode(
" AND ", $where)));
2482 $buffer =
"<p><b>"._(
"Punti di interesse, percorsi e aree").
"</b></p>";
2484 $gform =
new Form(
'form_add_map_polygon_polyline_point',
'post',
false, array(
'tblLayout'=>
false));
2485 $buffer .= $gform->form(
'',
false,
'');
2486 $buffer .= $gform->hidden(
'id', $id);
2487 $buffer .=
"<table class=\"generic\">";
2488 if(count($point_ids)) {
2491 $buffer .=
"<th>"._(
"Etichetta punto di interesse").
"</th>";
2492 $buffer .=
"<th>"._(
"Aggiungi").
"</th>";
2494 foreach($point_ids as $point_id) {
2497 $buffer .=
"<td>".htmlChars($point->label).
"</td>";
2498 $buffer .=
"<td><input type=\"checkbox\" name=\"point_add[]\" value=\"".$point->id.
"\" /></td>";
2502 if(count($polyline_ids)) {
2505 $buffer .=
"<th>"._(
"Etichetta percorso").
"</th>";
2506 $buffer .=
"<th>"._(
"Aggiungi").
"</th>";
2508 foreach($polyline_ids as $polyline_id) {
2511 $buffer .=
"<td>".htmlChars($polyline->label).
"</td>";
2512 $buffer .=
"<td><input type=\"checkbox\" name=\"polyline_add[]\" value=\"".$polyline->id.
"\" /></td>";
2516 if(count($polygon_ids)) {
2519 $buffer .=
"<th>"._(
"Etichetta area").
"</th>";
2520 $buffer .=
"<th>"._(
"Aggiungi").
"</th>";
2522 foreach($polygon_ids as $polygon_id) {
2525 $buffer .=
"<td>".htmlChars($polygon->label).
"</td>";
2526 $buffer .=
"<td><input type=\"checkbox\" name=\"polygon_add[]\" value=\"".$polyline->id.
"\" /></td>";
2530 $buffer .=
"</table>";
2531 $buffer .=
"<p>".$gform->input(
'submit_add',
'submit', _(
"aggiungi selezionati"), array(
'classField'=>
'submit')).
"</p>";
2532 $buffer .= $gform->cform();
2535 if(!count($point_ids) && !count($polyline_ids) && !count($polygon_ids)) {
2536 $buffer =
"<p class=\"message\">"._(
"La ricerca non ha prodotto risultati").
"</p>";
2551 $id = cleanVar($_REQUEST,
'id',
'int',
'');
2553 $map->instance = $this->_instance;
2555 if(in_array($this->_action, array(
'insert',
'modify'))) {
2556 $col = $map->form($this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]");
2558 elseif($this->_action ==
'delete') {
2560 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"");
2568 $buffer .=
"</div>";
2581 $title = _(
"Mappe");
2582 $link_insert =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&action=insert\">".pub::icon(
'insert', _(
"nuova mappa")).
"</a>";
2583 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLinks'=>array($link_insert),
'headerLabel'=>$title));
2588 if($tot = count($map_ids)) {
2590 $buffer .=
"<table class=\"generic\">";
2592 $buffer .=
"<th>"._(
"ID").
"</th>";
2593 $buffer .=
"<th>"._(
"Nome").
"</th>";
2594 $buffer .=
"<th>"._(
"Larghezza").
"</th>";
2595 $buffer .=
"<th>"._(
"Altezza").
"</th>";
2596 $buffer .=
"<th class=\"thIcon\"></th>";
2598 foreach($map_ids as $map_id) {
2599 $map =
new gmapsMap($map_id, $this);
2601 $buffer .=
"<td>".$map->id.
"</td>";
2602 $buffer .=
"<td>".htmlChars($map->name).
"</td>";
2603 $buffer .=
"<td>".htmlChars($map->width).
"</td>";
2604 $buffer .=
"<td>".htmlChars($map->height).
"</td>";
2605 $link_modify =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&action=modify&id=".$map->id.
"\">".pub::icon(
'modify').
"</a>";
2606 $link_delete =
"<span class=\"link\" onclick=\"if(confirm('".jsVar(_(
"Sicuro di voler eliminare la mappa?")).
"')) location.href='".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&action=delete&id=".$map->id.
"';\">".pub::icon(
'delete').
"</span>";
2607 $link_items =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=map_item&id=".$map->id.
"\">".$this->_icon_map_element.
"</a>";
2608 $onclick =
"window.myWin = new layerWindow({'title':'"._(
"Codice embed").
"', 'url':'".$this->_home.
"?pt[".$this->_instanceName.
"-iframeCode]&id=$map_id', 'width':600});window.myWin.display();";
2609 $link_link =
"<span class=\"link\" onclick=\"$onclick\">".pub::icon(
'link', _(
"Codice inserimento iframe")).
"</span>";
2610 $buffer .=
"<td class=\"tdIcon\">$link_modify $link_delete $link_items $link_link</td>";
2614 $buffer .=
"</table>";
2618 $buffer .=
"<p class=\"message\">"._(
"Non risultano mappe registrate").
"</p>";
2621 $htmlsection->content = $buffer;
2623 return $htmlsection->render();
2634 $this->accessGroup(
'ALL');
2636 $id = cleanVar($_GET,
'id',
'int',
'');
2639 $buffer =
"<p>"._(
"Copia il codice seguente ed incollalo nella posizione desideratea all'interno del codice html del sito nel quale vuoi includere la mappa. Potrebbe essere necessario ritoccare i valore width ed height in modo da far scomparire eventuali barre di scorrimento.").
"</p>";
2640 $buffer .=
"<textarea style=\"width:99%\" rows=\"3\" readonly>";
2641 $buffer .=
"<iframe frameborder=\"0\" width=\"".$map->width.
"\" height=\"".$map->height.
"\" src=\"".$this->_url_root.SITE_WWW.
'/'.$this->_plink->aLink($this->_instanceName,
'iframeMap', array(
'id'=>$map->id),
'').
"\">Your browser doesn't support iframes</iframe><script type=\"text/javascript\">function gmaps_chg_parent_url(url) { document.location = url; }</script>";
2642 $buffer .=
"</textarea>";
2656 $registry = registry::instance();
2657 $registry->addJs(
"http://maps.googleapis.com/maps/api/js?key=AIzaSyArAE-uBvCZTRaf_eaFn4umUdESmoUvoxM&sensor=true");
2659 $id = cleanVar($_REQUEST,
'id',
'int',
'');
2662 $title = sprintf(_(
"Punti di interesse associati al percorso '%s'"), htmlChars($polyline->label));
2663 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLabel'=>$title));
2667 if(isset($_POST[
'submit_add'])) {
2668 $add_point_ids = cleanVar($_POST,
'point_add',
'array',
'');
2669 $res = $polyline->addPoints($add_point_ids);
2671 exit(error::errorMessage(array(
'error'=>_(
"Si è verificato un errore, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polyline_point&id=$id"));
2674 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=polyline_point&id=".$id);
2677 elseif(isset($_POST[
'submit_remove'])) {
2678 $remove_point_ids = cleanVar($_POST,
'point_remove',
'array',
'');
2679 $res = $polyline->removePoints($remove_point_ids);
2681 exit(error::errorMessage(array(
'error'=>_(
"Si è verificato un errore, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polyline_point&id=$id"));
2684 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=polyline_point&id=".$id);
2688 $buffer .=
"<h2>"._(
"Punti presenti").
"</h2>";
2690 if(count($polyline->points())) {
2692 $gform =
new Form(
'form_remove_polyline_point',
'post',
false, array(
'tblLayout'=>
false));
2693 $buffer .= $gform->form(
'',
false,
'');
2694 $buffer .= $gform->hidden(
'id', $id);
2695 $buffer .=
"<table class=\"generic\" style=\"margin-bottom: 10px;\">";
2697 $buffer .=
"<th>Etichetta</th>";
2698 $buffer .=
"<th>Rimuovi</th>";
2700 foreach($polyline->points() as $point) {
2702 $buffer .=
"<td>".htmlChars($point->label).
"</td>";
2703 $buffer .=
"<td><input type=\"checkbox\" name=\"point_remove[]\" value=\"".$point->id.
"\" /></td>";
2706 $buffer .=
"</table>";
2707 $buffer .=
"<p>".$gform->input(
'submit_remove',
'submit', _(
"rimuovi selezionati"), array(
'classField'=>
'submit')).
"</p>";
2708 $buffer .= $gform->cform();
2711 $buffer .=
"<p class=\"message\">"._(
"Non risultano punti di interesse associati").
"</p>";
2714 $buffer .=
"<h2>"._(
"Situazione attuale").
"</h2>";
2715 $buffer .=
"<div id=\"map_canvas\" style=\"width:100%; height: 300px;\"></div>";
2716 $buffer .=
"<script>";
2717 $buffer .=
"window.addEvent('load', function() {
2719 center: new google.maps.LatLng(45, 7),
2721 mapTypeId: google.maps.MapTypeId.ROADMAP
2724 var map = new google.maps.Map($('map_canvas'), myopt);
2725 var bounds = new google.maps.LatLngBounds();
2726 ".$polyline->gmapCode(
'map',
'bounds').
"
2727 map.fitBounds(bounds);
2730 $buffer .=
"</script>";
2733 $buffer .=
"<h2>"._(
"Ricerca ed aggiunta punti").
"</h2>";
2737 $htmlsection->content = $buffer;
2739 return $htmlsection->render();
2751 $registry = registry::instance();
2752 $registry->addJs(
"http://maps.googleapis.com/maps/api/js?key=AIzaSyArAE-uBvCZTRaf_eaFn4umUdESmoUvoxM&sensor=true");
2754 $id = cleanVar($_REQUEST,
'id',
'int',
'');
2757 $title = sprintf(_(
"Punti di interesse associati all'area '%s'"), htmlChars($polygon->label));
2758 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLabel'=>$title));
2762 if(isset($_POST[
'submit_add'])) {
2763 $add_point_ids = cleanVar($_POST,
'point_add',
'array',
'');
2764 $res = $polygon->addPoints($add_point_ids);
2766 exit(error::errorMessage(array(
'error'=>_(
"Si è verificato un errore, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polygon_point&id=$id"));
2769 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=polygon_point&id=".$id);
2772 elseif(isset($_POST[
'submit_remove'])) {
2773 $remove_point_ids = cleanVar($_POST,
'point_remove',
'array',
'');
2774 $res = $polygon->removePoints($remove_point_ids);
2776 exit(error::errorMessage(array(
'error'=>_(
"Si è verificato un errore, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polygon_point&id=$id"));
2779 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=polygon_point&id=".$id);
2783 $buffer .=
"<h2>"._(
"Punti presenti").
"</h2>";
2785 if(count($polygon->points())) {
2787 $gform =
new Form(
'form_remove_polygon_point',
'post',
false, array(
'tblLayout'=>
false));
2788 $buffer .= $gform->form(
'',
false,
'');
2789 $buffer .= $gform->hidden(
'id', $id);
2790 $buffer .=
"<table class=\"generic\" style=\"margin-bottom: 10px;\">";
2792 $buffer .=
"<th>Etichetta</th>";
2793 $buffer .=
"<th>Rimuovi</th>";
2795 foreach($polygon->points() as $point) {
2797 $buffer .=
"<td>".htmlChars($point->label).
"</td>";
2798 $buffer .=
"<td><input type=\"checkbox\" name=\"point_remove[]\" value=\"".$point->id.
"\" /></td>";
2801 $buffer .=
"</table>";
2802 $buffer .=
"<p>".$gform->input(
'submit_remove',
'submit', _(
"rimuovi selezionati"), array(
'classField'=>
'submit')).
"</p>";
2803 $buffer .= $gform->cform();
2806 $buffer .=
"<p class=\"message\">"._(
"Non risultano punti di interesse associati").
"</p>";
2809 $buffer .=
"<h2>"._(
"Situazione attuale").
"</h2>";
2810 $buffer .=
"<div id=\"map_canvas\" style=\"width:100%; height: 300px;\"></div>";
2811 $buffer .=
"<script>";
2812 $buffer .=
"window.addEvent('load', function() {
2814 center: new google.maps.LatLng(45, 7),
2816 mapTypeId: google.maps.MapTypeId.ROADMAP
2819 var map = new google.maps.Map($('map_canvas'), myopt);
2820 var bounds = new google.maps.LatLngBounds();
2821 ".$polygon->gmapCode(
'map',
'bounds').
"
2822 map.fitBounds(bounds);
2825 $buffer .=
"</script>";
2828 $buffer .=
"<h2>"._(
"Ricerca ed aggiunta punti").
"</h2>";
2832 $htmlsection->content = $buffer;
2834 return $htmlsection->render();
2847 $gform =
new Form(
'form_search_add_polyline_point',
'post',
false);
2848 $buffer = $gform->form(
'',
false,
'');
2850 $buffer .= $gform->cselect(
'point_ctg',
'',
gmapsPointCtg::getForSelect($this->_instance), _(
"Categoria"), array(
'id'=>
'point_ctg'));
2851 $buffer .= $gform->cinput(
'point_label',
'text',
'', _(
"Etichetta"), array(
'maxlength'=>200,
'id'=>
'point_label'));
2853 $onclick =
"ajaxRequest('post', '".$this->_home.
"?pt[".$this->_instanceName.
"-polylinePointSearch]', 'id=".$polyline->id.
"&ctg='+$('point_ctg').value+'&label='+$('point_label').value, 'polyline_point_search', {load: 'polyline_point_search'})";
2855 $buffer .= $gform->cinput(
'submit_search',
'button', _(
"cerca"),
'', array(
'classField'=>
'submit',
'js'=>
"onclick=\"$onclick\""));
2857 $buffer .= $gform->cform();
2859 $buffer .=
"<div id=\"polyline_point_search\" style=\"margin-top: 10px;\"></div>";
2873 $gform =
new Form(
'form_search_add_polygon_point',
'post',
false);
2874 $buffer = $gform->form(
'',
false,
'');
2876 $buffer .= $gform->cselect(
'point_ctg',
'',
gmapsPointCtg::getForSelect($this->_instance), _(
"Categoria"), array(
'id'=>
'point_ctg'));
2877 $buffer .= $gform->cinput(
'point_label',
'text',
'', _(
"Etichetta"), array(
'maxlength'=>200,
'id'=>
'point_label'));
2879 $onclick =
"ajaxRequest('post', '".$this->_home.
"?pt[".$this->_instanceName.
"-polygonPointSearch]', 'id=".$polygon->id.
"&ctg='+$('point_ctg').value+'&label='+$('point_label').value, 'polygon_point_search', {load: 'polygon_point_search'})";
2881 $buffer .= $gform->cinput(
'submit_search',
'button', _(
"cerca"),
'', array(
'classField'=>
'submit',
'js'=>
"onclick=\"$onclick\""));
2883 $buffer .= $gform->cform();
2885 $buffer .=
"<div id=\"polygon_point_search\" style=\"margin-top: 10px;\"></div>";
2899 $this->accessGroup(
'ALL');
2901 $id = cleanVar($_POST,
'id',
'int',
'');
2902 $ctg = cleanVar($_POST,
'ctg',
'int',
'');
2903 $label = cleanVar($_POST,
'label',
'string',
'');
2908 if(count($polyline->points_id())) {
2909 $where[] =
"id NOT IN (".implode(
',', $polyline->points_id()).
")";
2912 $where[] =
"label LIKE '%$label%'";
2915 $point_ids =
gmapsPoint::get($this->_instance, array(
'where'=>implode(
" AND ", $where),
'ctg'=>$ctg));
2917 if(count($point_ids)) {
2919 $gform =
new Form(
'form_add_polyline_point',
'post',
false, array(
'tblLayout'=>
false));
2920 $buffer = $gform->form(
'',
false,
'');
2921 $buffer .= $gform->hidden(
'id', $id);
2923 $buffer .=
"<table class=\"generic\">";
2925 $buffer .=
"<th>"._(
"Etichetta").
"</th>";
2926 $buffer .=
"<th>"._(
"Aggiungi").
"</th>";
2928 foreach($point_ids as $point_id) {
2931 $buffer .=
"<td>".htmlChars($point->label).
"</td>";
2932 $buffer .=
"<td><input type=\"checkbox\" name=\"point_add[]\" value=\"".$point->id.
"\" /></td>";
2935 $buffer .=
"<table>";
2937 $buffer .=
"<p>".$gform->input(
'submit_add',
'submit', _(
"aggiungi selezionati"), array(
'classField'=>
'submit')).
"</p>";
2938 $buffer .= $gform->cform();
2942 $buffer =
"<p class=\"message\">"._(
"La ricerca non ha prodotto risultati").
"</p>";
2957 $this->accessGroup(
'ALL');
2959 $id = cleanVar($_POST,
'id',
'int',
'');
2960 $ctg = cleanVar($_POST,
'ctg',
'int',
'');
2961 $label = cleanVar($_POST,
'label',
'string',
'');
2966 if(count($polygon->points_id())) {
2967 $where[] =
"id NOT IN (".implode(
',', $polygon->points_id()).
")";
2970 $where[] =
"label LIKE '%$label%'";
2973 $point_ids =
gmapsPoint::get($this->_instance, array(
'where'=>implode(
" AND ", $where),
'ctg'=>$ctg));
2975 if(count($point_ids)) {
2977 $gform =
new Form(
'form_add_polygon_point',
'post',
false, array(
'tblLayout'=>
false));
2978 $buffer = $gform->form(
'',
false,
'');
2979 $buffer .= $gform->hidden(
'id', $id);
2981 $buffer .=
"<table class=\"generic\">";
2983 $buffer .=
"<th>"._(
"Etichetta").
"</th>";
2984 $buffer .=
"<th>"._(
"Aggiungi").
"</th>";
2986 foreach($point_ids as $point_id) {
2989 $buffer .=
"<td>".htmlChars($point->label).
"</td>";
2990 $buffer .=
"<td><input type=\"checkbox\" name=\"point_add[]\" value=\"".$point->id.
"\" /></td>";
2993 $buffer .=
"<table>";
2995 $buffer .=
"<p>".$gform->input(
'submit_add',
'submit', _(
"aggiungi selezionati"), array(
'classField'=>
'submit')).
"</p>";
2996 $buffer .= $gform->cform();
3000 $buffer =
"<p class=\"message\">"._(
"La ricerca non ha prodotto risultati").
"</p>";
3015 $id = cleanVar($_REQUEST,
'id',
'int',
'');
3016 $start = cleanVar($_GET,
'start',
'int',
'');
3018 $polyline->instance = $this->_instance;
3020 if(in_array($this->_action, array(
'insert',
'modify'))) {
3021 $col = $polyline->form($this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polyline&start=$start");
3023 elseif($this->_action ==
'delete') {
3025 $polyline->delete();
3026 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=polyline&start=$start");
3034 $buffer .=
"</div>";
3047 $id = cleanVar($_REQUEST,
'id',
'int',
'');
3048 $start = cleanVar($_GET,
'start',
'int',
'');
3050 $polygon->instance = $this->_instance;
3052 if(in_array($this->_action, array(
'insert',
'modify'))) {
3053 $col = $polygon->form($this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polygon&start=$start");
3055 elseif($this->_action ==
'delete') {
3058 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=polygon&start=$start");
3066 $buffer .=
"</div>";
3080 $title = _(
"Percorsi");
3081 $link_insert =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polyline&action=insert\">".pub::icon(
'insert', _(
"nuovo percorso")).
"</a>";
3082 $onclick =
"myreveal.toggle();";
3083 $link_search =
"<span class=\"link\" onclick=\"".$onclick.
"\">".pub::icon(
'search').
"</span>";
3084 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLinks'=>array($link_insert, $link_search),
'headerLabel'=>$title));
3088 $buffer =
"<div id=\"admin_search_polyline\" style=\"display:".((isset($_SESSION[
'apl_search']) && $_SESSION[
'apl_search']) ?
"block" :
"none").
"; border:1px solid #ddd; background: #eee; padding: 10px; padding-top: 0; margin-bottom: 10px;\">";
3089 $buffer .=
"<p>Le ricerche effettuate rimangono in sessione</p>";
3090 $buffer .= $formsearch;
3091 $buffer .=
"</div>";
3092 $buffer .=
"<script>";
3093 $buffer .=
"myreveal = new Fx.Reveal('admin_search_polyline');";
3094 $buffer .=
"</script>";
3096 $polyline_ids =
gmapsPolyline::get($this->_instance, array(
'where'=>$_SESSION[
'apl_where']));
3097 if($tot = count($polyline_ids)) {
3099 $plist =
new PageList(2, $tot,
'array');
3100 $start = $plist->start();
3101 $end = min($start + 2, $tot);
3103 $buffer .=
"<table class=\"generic\">";
3105 $buffer .=
"<th>"._(
"Categorie").
"</th>";
3106 $buffer .=
"<th>"._(
"Etichetta").
"</th>";
3107 $buffer .=
"<th>"._(
"Colore").
"</th>";
3108 $buffer .=
"<th>"._(
"Spessore").
"</th>";
3109 $buffer .=
"<th class=\"thIcon\"></th>";
3111 for($i = $start; $i < $end; $i++) {
3112 $polyline_id = $polyline_ids[$i];
3118 foreach($polyline->ctgs() as $ctg) {
3119 $ctgs_string .= htmlChars($ctg->name).
", ";
3121 $buffer .= substr($ctgs_string, 0, -2);
3123 $buffer .=
"<td>".htmlChars($polyline->label).
"</td>";
3124 $buffer .=
"<td>".htmlChars($polyline->color).
"</td>";
3125 $buffer .=
"<td>".htmlChars($polyline->width).
"px</td>";
3126 $link_modify =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polyline&action=modify&id=".$polyline->id.
"&start=".$start.
"\">".pub::icon(
'modify').
"</a>";
3127 $link_delete =
"<span class=\"link\" onclick=\"if(confirm('".jsVar(_(
"Sicuro di voler eliminare il percorso?")).
"')) location.href='".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polyline&action=delete&id=".$polyline->id.
"&start=".$start.
"';\">".pub::icon(
'delete').
"</span>";
3128 $link_points =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polyline_point&id=".$polyline->id.
"&start=".$start.
"\">".$this->_icon_polyline_points.
"</a>";
3129 $buffer .=
"<td class=\"tdIcon\">$link_modify $link_delete $link_points</td>";
3133 $buffer .=
"</table>";
3135 $htmlsection->footer =
"<p>".$plist->listReferenceGINO($this->_plink->aLink($this->_instanceName,
'manageDoc',
'',
"block=polyline", array(
"basename"=>
false))).
"</p>";
3139 $buffer .=
"<p class=\"message\">"._(
"Non risultano percorsi registrati").
"</p>";
3142 $htmlsection->content = $buffer;
3144 return $htmlsection->render();
3156 $link_insert =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polygon&action=insert\">".pub::icon(
'insert', _(
"nuova area")).
"</a>";
3157 $onclick =
"myreveal.toggle();";
3158 $link_search =
"<span class=\"link\" onclick=\"".$onclick.
"\">".pub::icon(
'search').
"</span>";
3159 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'h1',
'headerLinks'=>array($link_insert, $link_search),
'headerLabel'=>$title));
3163 $buffer =
"<div id=\"admin_search_polygon\" style=\"display:".((isset($_SESSION[
'apg_search']) && $_SESSION[
'apg_search']) ?
"block" :
"none").
"; border:1px solid #ddd; background: #eee; padding: 10px; padding-top: 0; margin-bottom: 10px;\">";
3164 $buffer .=
"<p>Le ricerche effettuate rimangono in sessione</p>";
3165 $buffer .= $formsearch;
3166 $buffer .=
"</div>";
3167 $buffer .=
"<script>";
3168 $buffer .=
"myreveal = new Fx.Reveal('admin_search_polygon');";
3169 $buffer .=
"</script>";
3171 $polygon_ids =
gmapsPolygon::get($this->_instance, array(
'where'=>$_SESSION[
'apl_where']));
3172 if($tot = count($polygon_ids)) {
3174 $plist =
new PageList(2, $tot,
'array');
3175 $start = $plist->start();
3176 $end = min($start + 2, $tot);
3178 $buffer .=
"<table class=\"generic\">";
3180 $buffer .=
"<th>"._(
"Categorie").
"</th>";
3181 $buffer .=
"<th>"._(
"Etichetta").
"</th>";
3182 $buffer .=
"<th>"._(
"Colore").
"</th>";
3183 $buffer .=
"<th>"._(
"Spessore").
"</th>";
3184 $buffer .=
"<th class=\"thIcon\"></th>";
3186 for($i = $start; $i < $end; $i++) {
3187 $polygon_id = $polygon_ids[$i];
3193 foreach($polygon->ctgs() as $ctg) {
3194 $ctgs_string .= htmlChars($ctg->name).
", ";
3196 $buffer .= substr($ctgs_string, 0, -2);
3198 $buffer .=
"<td>".htmlChars($polygon->label).
"</td>";
3199 $buffer .=
"<td>".htmlChars($polygon->color).
"</td>";
3200 $buffer .=
"<td>".htmlChars($polygon->width).
"px</td>";
3201 $link_modify =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polygon&action=modify&id=".$polygon->id.
"&start=".$start.
"\">".pub::icon(
'modify').
"</a>";
3202 $link_delete =
"<span class=\"link\" onclick=\"if(confirm('".jsVar(_(
"Sicuro di voler eliminare l'area?")).
"')) location.href='".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polygon&action=delete&id=".$polygon->id.
"&start=".$start.
"';\">".pub::icon(
'delete').
"</span>";
3203 $link_points =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polygon_point&id=".$polygon->id.
"&start=".$start.
"\">".$this->_icon_polygon_points.
"</a>";
3204 $buffer .=
"<td class=\"tdIcon\">$link_modify $link_delete $link_points</td>";
3208 $buffer .=
"</table>";
3210 $htmlsection->footer =
"<p>".$plist->listReferenceGINO($this->_plink->aLink($this->_instanceName,
'manageDoc',
'',
"block=polygon", array(
"basename"=>
false))).
"</p>";
3214 $buffer .=
"<p class=\"message\">"._(
"Non risultano aree registrate").
"</p>";
3217 $htmlsection->content = $buffer;
3219 return $htmlsection->render();
3231 if(!isset($_SESSION[
'apl_search'])) {
3232 $_SESSION[
'apl_ctg'] = 0;
3233 $_SESSION[
'apl_label'] =
'';
3234 $_SESSION[
'apl_where'] =
'';
3237 if(isset($_POST[
'submit_search'])) {
3238 $_SESSION[
'apl_ctg'] = cleanVar($_POST,
'apl_ctg',
'int',
'');
3239 $_SESSION[
'apl_label'] = cleanVar($_POST,
'apl_label',
'string',
'');
3243 if($_SESSION[
'apl_ctg']) $where[] =
"id IN (SELECT polyline_id FROM ".$this->_tbl_polyline_polyline_ctg.
" WHERE ctg_id='".$_SESSION[
'apl_ctg'].
"')";
3244 if($_SESSION[
'apl_label']) $where[] =
"label LIKE '%".$_SESSION[
'apl_label'].
"%'";
3246 $_SESSION[
'apl_where'] = implode(
" AND ", $where);
3248 if($_SESSION[
'apl_ctg'] || $_SESSION[
'apl_label']) $_SESSION[
'apl_search'] =
true;
3249 else $_SESSION[
'apl_search'] =
false;
3251 elseif(isset($_POST[
'submit_reset'])) {
3252 $_SESSION[
'apl_ctg'] = 0;
3253 $_SESSION[
'apl_label'] =
'';
3254 $_SESSION[
'apl_where'] =
'';
3255 $_SESSION[
'apl_search'] =
false;
3258 $gform =
new Form(
'form_admin_search_polyline',
'post',
false);
3259 $buffer = $gform->form(
'',
false,
'');
3261 $buffer .= $gform->cselect(
'apl_ctg', $_SESSION[
'apl_ctg'],
gmapsPolylineCtg::getForSelect($this->_instance), _(
"Categoria"), array(
'required'=>
true));
3262 $buffer .= $gform->cinput(
'apl_label',
'text', $_SESSION[
'apl_label'], _(
"Etichetta"), array(
'required'=>
true,
'maxlength'=>200));
3263 $reset = $gform->input(
'submit_reset',
'submit', _(
"azzera"), array(
'classField'=>
'submit'));
3264 $buffer .= $gform->cinput(
'submit_search',
'submit', _(
"cerca"),
'', array(
'classField'=>
'submit',
'text_add'=>
" $reset"));
3266 $buffer .= $gform->cform();
3279 if(!isset($_SESSION[
'apl_search'])) {
3280 $_SESSION[
'apg_ctg'] = 0;
3281 $_SESSION[
'apg_label'] =
'';
3282 $_SESSION[
'apg_where'] =
'';
3285 if(isset($_POST[
'submit_search'])) {
3286 $_SESSION[
'apg_ctg'] = cleanVar($_POST,
'apg_ctg',
'int',
'');
3287 $_SESSION[
'apg_label'] = cleanVar($_POST,
'apg_label',
'string',
'');
3291 if($_SESSION[
'apg_ctg']) $where[] =
"id IN (SELECT polygon_id FROM ".$this->_tbl_polygon_polygon_ctg.
" WHERE ctg_id='".$_SESSION[
'apg_ctg'].
"')";
3292 if($_SESSION[
'apg_label']) $where[] =
"label LIKE '%".$_SESSION[
'apg_label'].
"%'";
3294 $_SESSION[
'apg_where'] = implode(
" AND ", $where);
3296 if($_SESSION[
'apg_ctg'] || $_SESSION[
'apg_label']) $_SESSION[
'apg_search'] =
true;
3297 else $_SESSION[
'apg_search'] =
false;
3299 elseif(isset($_POST[
'submit_reset'])) {
3300 $_SESSION[
'apg_ctg'] = 0;
3301 $_SESSION[
'apg_label'] =
'';
3302 $_SESSION[
'apg_where'] =
'';
3303 $_SESSION[
'apg_search'] =
false;
3306 $gform =
new Form(
'form_admin_search_polygon',
'post',
false);
3307 $buffer = $gform->form(
'',
false,
'');
3309 $buffer .= $gform->cselect(
'apg_ctg', $_SESSION[
'apg_ctg'],
gmapsPolygonCtg::getForSelect($this->_instance), _(
"Categoria"), array(
'required'=>
true));
3310 $buffer .= $gform->cinput(
'apg_label',
'text', $_SESSION[
'apg_label'], _(
"Etichetta"), array(
'required'=>
true,
'maxlength'=>200));
3311 $reset = $gform->input(
'submit_reset',
'submit', _(
"azzera"), array(
'classField'=>
'submit'));
3312 $buffer .= $gform->cinput(
'submit_search',
'submit', _(
"cerca"),
'', array(
'classField'=>
'submit',
'text_add'=>
" $reset"));
3314 $buffer .= $gform->cform();
3328 $id = cleanVar($_REQUEST,
'id',
'int',
'');
3329 $start = cleanVar($_GET,
'start',
'int',
'');
3331 $point->instance = $this->_instance;
3333 if(in_array($this->_action, array(
'insert',
'modify'))) {
3334 $col = $point->form($this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point&start=$start");
3336 elseif($this->_action ==
'delete') {
3338 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=point&start=$start");
3346 $buffer .=
"</div>";
3359 $title = _(
"Punti di interesse");
3360 $link_insert =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point&action=insert\">".pub::icon(
'insert', _(
"nuovo punto di interesse")).
"</a>";
3361 $onclick =
"myreveal.toggle();";
3362 $link_search =
"<span class=\"link\" onclick=\"".$onclick.
"\">".pub::icon(
'search').
"</span>";
3363 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLinks'=>array($link_insert, $link_search),
'headerLabel'=>$title));
3367 $buffer =
"<div id=\"admin_search_point\" style=\"display:".((isset($_SESSION[
'ap_search']) && $_SESSION[
'ap_search']) ?
"block" :
"none").
"; border:1px solid #ddd; background: #eee; padding: 10px; padding-top: 0; margin-bottom: 10px;\">";
3368 $buffer .=
"<p>Le ricerche effettuate rimangono in sessione</p>";
3369 $buffer .= $formsearch;
3370 $buffer .=
"</div>";
3371 $buffer .=
"<script>";
3372 $buffer .=
"myreveal = new Fx.Reveal('admin_search_point');";
3373 $buffer .=
"</script>";
3375 $point_ids =
gmapsPoint::get($this->_instance, array(
'where'=>$_SESSION[
'ap_where']));
3376 if($tot = count($point_ids)) {
3378 $plist =
new PageList($this->_list_point_items, $tot,
'array');
3379 $start = $plist->start();
3380 $end = min($start + $this->_list_point_items, $tot);
3382 $buffer .=
"<table class=\"generic\">";
3384 $buffer .=
"<th>"._(
"Categorie").
"</th>";
3385 $buffer .=
"<th>"._(
"Etichetta").
"</th>";
3386 $buffer .=
"<th>"._(
"Latitudine").
"</th>";
3387 $buffer .=
"<th>"._(
"Longitudine").
"</th>";
3388 $buffer .=
"<th class=\"thIcon\" style=\"width: 160px;\"></th>";
3390 for($i = $start; $i < $end; $i++) {
3391 $point_id = $point_ids[$i];
3397 foreach($point->ctgs() as $ctg) {
3398 $ctgs_string .= htmlChars($ctg->name).
', ';
3400 $buffer .= substr($ctgs_string, 0, -2);
3402 $buffer .=
"<td>".htmlChars($point->label).
"</td>";
3403 $buffer .=
"<td>".htmlChars(round($point->lat, 4)).
"</td>";
3404 $buffer .=
"<td>".htmlChars(round($point->lng, 4)).
"</td>";
3405 $link_modify =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point&action=modify&id=".$point->id.
"&start=".$start.
"\">".pub::icon(
'modify').
"</a>";
3406 $link_delete =
"<span class=\"link\" onclick=\"if(confirm('".jsVar(_(
"Sicuro di voler eliminare il punto di interesse?")).
"')) location.href='".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point&action=delete&id=".$point->id.
"&start=".$start.
"';\">".pub::icon(
'delete').
"</span>";
3407 $link_images =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_image&point_id=".$point->id.
"\">".$this->_icon_image.
"</a>";
3408 $link_videos =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_video&point_id=".$point->id.
"\">".$this->_icon_video.
"</a>";
3409 $link_events =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_event&point_id=".$point->id.
"\">".$this->_icon_event.
"</a>";
3410 $link_attachments =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_attachment&point_id=".$point->id.
"\">".$this->_icon_attachment.
"</a>";
3411 $link_collections =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_collection&point_id=".$point->id.
"\">".$this->_icon_collection.
"</a>";
3412 $buffer .=
"<td class=\"tdIcon\">$link_modify $link_delete $link_images $link_videos $link_events $link_attachments $link_collections</td>";
3416 $buffer .=
"</table>";
3418 $htmlsection->footer =
"<p>".$plist->listReferenceGINO($this->_plink->aLink($this->_instanceName,
'manageDoc',
'',
"block=point", array(
"basename"=>
false))).
"</p>";
3422 $buffer .=
"<p class=\"message\">"._(
"Non risultano punti di interesse registrati").
"</p>";
3425 $htmlsection->content = $buffer;
3427 return $htmlsection->render();
3439 if(!isset($_SESSION[
'ap_search'])) {
3440 $_SESSION[
'ap_ctg'] = 0;
3441 $_SESSION[
'ap_label'] =
'';
3442 $_SESSION[
'ap_where'] =
'';
3445 if(isset($_POST[
'submit_search'])) {
3446 $_SESSION[
'ap_ctg'] = cleanVar($_POST,
'ap_ctg',
'int',
'');
3447 $_SESSION[
'ap_label'] = cleanVar($_POST,
'ap_label',
'string',
'');
3451 if($_SESSION[
'ap_ctg']) $where[] =
"id IN (SELECT point_id FROM ".$this->_tbl_point_point_ctg.
" WHERE ctg_id='".$_SESSION[
'ap_ctg'].
"')";
3452 if($_SESSION[
'ap_label']) $where[] =
"label LIKE '%".$_SESSION[
'ap_label'].
"%'";
3454 $_SESSION[
'ap_where'] = implode(
" AND ", $where);
3456 if($_SESSION[
'ap_ctg'] || $_SESSION[
'ap_label']) $_SESSION[
'ap_search'] =
true;
3457 else $_SESSION[
'ap_search'] =
false;
3459 elseif(isset($_POST[
'submit_reset'])) {
3460 $_SESSION[
'ap_ctg'] = 0;
3461 $_SESSION[
'ap_label'] =
'';
3462 $_SESSION[
'ap_where'] =
'';
3463 $_SESSION[
'ap_search'] =
false;
3466 $gform =
new Form(
'form_admin_search_point',
'post',
false);
3467 $buffer = $gform->form($this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point",
false,
'');
3469 $buffer .= $gform->cselect(
'ap_ctg', $_SESSION[
'ap_ctg'],
gmapsPointCtg::getForSelect($this->_instance), _(
"Categoria"), array(
'required'=>
true));
3470 $buffer .= $gform->cinput(
'ap_label',
'text', $_SESSION[
'ap_label'], _(
"Etichetta"), array(
'required'=>
true,
'maxlength'=>200));
3471 $reset = $gform->input(
'submit_reset',
'submit', _(
"azzera"), array(
'classField'=>
'submit'));
3472 $buffer .= $gform->cinput(
'submit_search',
'submit', _(
"cerca"),
'', array(
'classField'=>
'submit',
'text_add'=>
" $reset"));
3474 $buffer .= $gform->cform();
3487 $id = cleanVar($_REQUEST,
'id',
'int',
'');
3489 $ctg->instance = $this->_instance;
3493 if(in_array($this->_action, array(
'insert',
'modify'))) {
3494 $col2 = $ctg->form($this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polyline_ctg");
3496 elseif($this->_action ==
'delete') {
3497 $res = $ctg->delete();
3498 if($res ===
'polylines') {
3499 exit(error::errorMessage(array(
'error'=>_(
"La categoria contiene dei percorsi, eliminarli o cambiarne la categoria e riprovare")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polyline_ctg"));
3501 elseif($res ===
false) {
3502 exit(error::errorMessage(array(
'error'=>_(
"Impossibile eliminare la categoria, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polyline_ctg"));
3504 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=polyline_ctg");
3510 $buffer =
"<div class=\"vertical_1\">";
3512 $buffer .=
"</div>";
3514 $buffer .=
"<div class=\"vertical_2\">";
3516 $buffer .=
"</div>";
3518 $buffer .=
"<div class=\"null\"></div>";
3532 $id = cleanVar($_REQUEST,
'id',
'int',
'');
3534 $ctg->instance = $this->_instance;
3538 if(in_array($this->_action, array(
'insert',
'modify'))) {
3539 $col2 = $ctg->form($this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polygon_ctg");
3541 elseif($this->_action ==
'delete') {
3542 $res = $ctg->delete();
3543 if($res ===
'polygons') {
3544 exit(error::errorMessage(array(
'error'=>_(
"La categoria contiene delle aree, eliminarle o cambiarne la categoria e riprovare")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polygon_ctg"));
3546 elseif($res ===
false) {
3547 exit(error::errorMessage(array(
'error'=>_(
"Impossibile eliminare la categoria, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polygon_ctg"));
3549 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=polygon_ctg");
3555 $buffer =
"<div class=\"vertical_1\">";
3557 $buffer .=
"</div>";
3559 $buffer .=
"<div class=\"vertical_2\">";
3561 $buffer .=
"</div>";
3563 $buffer .=
"<div class=\"null\"></div>";
3577 $title = _(
"Categorie");
3578 $link_insert =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polyline_ctg&action=insert\">".pub::icon(
'insert', _(
"nuova categoria")).
"</a>";
3579 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLinks'=>$link_insert,
'headerLabel'=>$title));
3583 if($tot = count($ctg_ids)) {
3584 $htmlList =
new htmlList(array(
"numItems"=>$tot,
"separator"=>
true));
3585 $buffer = $htmlList->start();
3586 foreach($ctg_ids as $ctg_id) {
3588 $link_modify =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polyline_ctg&action=modify&id=".$ctg->id.
"\">".pub::icon(
'modify').
"</a>";
3589 $link_delete =
"<span class=\"link\" onclick=\"if(confirm('".jsVar(_(
"Sicuro di voler eliminare la categoria?")).
"')) location.href='".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polyline_ctg&action=delete&id=".$ctg->id.
"';\">".pub::icon(
'delete').
"</span>";
3590 $selected = $ctg->id == $sel_id ?
true :
false;
3591 $buffer .= $htmlList->item(htmlChars($ctg->name), array($link_modify, $link_delete), $selected,
true);
3593 $buffer .= $htmlList->end();
3596 $buffer =
"<p class=\"message\">"._(
"Non risultano categorie registrate").
"</p>";
3599 $htmlsection->content = $buffer;
3601 return $htmlsection->render();
3612 $title = _(
"Categorie");
3613 $link_insert =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polygon_ctg&action=insert\">".pub::icon(
'insert', _(
"nuova categoria")).
"</a>";
3614 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLinks'=>$link_insert,
'headerLabel'=>$title));
3618 if($tot = count($ctg_ids)) {
3619 $htmlList =
new htmlList(array(
"numItems"=>$tot,
"separator"=>
true));
3620 $buffer = $htmlList->start();
3621 foreach($ctg_ids as $ctg_id) {
3623 $link_modify =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polygon_ctg&action=modify&id=".$ctg->id.
"\">".pub::icon(
'modify').
"</a>";
3624 $link_delete =
"<span class=\"link\" onclick=\"if(confirm('".jsVar(_(
"Sicuro di voler eliminare la categoria?")).
"')) location.href='".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=polygon_ctg&action=delete&id=".$ctg->id.
"';\">".pub::icon(
'delete').
"</span>";
3625 $selected = $ctg->id == $sel_id ?
true :
false;
3626 $buffer .= $htmlList->item(htmlChars($ctg->name), array($link_modify, $link_delete), $selected,
true);
3628 $buffer .= $htmlList->end();
3631 $buffer =
"<p class=\"message\">"._(
"Non risultano categorie registrate").
"</p>";
3634 $htmlsection->content = $buffer;
3636 return $htmlsection->render();
3648 $title = _(
"Informazioni");
3649 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLabel'=>$title));
3651 $buffer = _(
"Gestione delle categorie dei percorsi");
3653 $htmlsection->content = $buffer;
3655 return $htmlsection->render();
3667 $title = _(
"Informazioni");
3668 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLabel'=>$title));
3670 $buffer = _(
"Gestione delle categorie delle aree");
3672 $htmlsection->content = $buffer;
3674 return $htmlsection->render();
3687 $id = cleanVar($_REQUEST,
'id',
'int',
'');
3689 $ctg->instance = $this->_instance;
3693 if(in_array($this->_action, array(
'insert',
'modify'))) {
3694 $col2 = $ctg->form($this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_ctg");
3696 elseif($this->_action ==
'delete') {
3697 $res = $ctg->delete();
3698 if($res ===
'points') {
3699 exit(error::errorMessage(array(
'error'=>_(
"La categoria contiene dei punti di interesse, eliminarli o cambiarne la categoria e riprovare")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_ctg"));
3701 elseif($res ===
false) {
3702 exit(error::errorMessage(array(
'error'=>_(
"Impossibile eliminare la categoria, contattare l'amministratore del sistema.")), $this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_ctg"));
3704 EvtHandler::HttpCall($this->_home, $this->_instanceName.
"-manageDoc",
"block=point_ctg");
3710 $buffer =
"<div class=\"vertical_1\">";
3712 $buffer .=
"</div>";
3714 $buffer .=
"<div class=\"vertical_2\">";
3716 $buffer .=
"</div>";
3718 $buffer .=
"<div class=\"null\"></div>";
3732 $title = _(
"Categorie");
3733 $link_insert =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_ctg&action=insert\">".pub::icon(
'insert', _(
"nuova categoria")).
"</a>";
3734 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLinks'=>$link_insert,
'headerLabel'=>$title));
3738 if($tot = count($ctg_ids)) {
3739 $htmlList =
new htmlList(array(
"numItems"=>$tot,
"separator"=>
true));
3740 $buffer = $htmlList->start();
3741 foreach($ctg_ids as $ctg_id) {
3743 $link_modify =
"<a href=\"".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_ctg&action=modify&id=".$ctg->id.
"\">".pub::icon(
'modify').
"</a>";
3744 $link_delete =
"<span class=\"link\" onclick=\"if(confirm('".jsVar(_(
"Sicuro di voler eliminare la categoria?")).
"')) location.href='".$this->_home.
"?evt[".$this->_instanceName.
"-manageDoc]&block=point_ctg&action=delete&id=".$ctg->id.
"';\">".pub::icon(
'delete').
"</span>";
3745 $selected = $ctg->id == $sel_id ?
true :
false;
3746 $buffer .= $htmlList->item(htmlChars($ctg->name), array($link_modify, $link_delete), $selected,
true);
3748 $buffer .= $htmlList->end();
3751 $buffer =
"<p class=\"message\">"._(
"Non risultano categorie registrate").
"</p>";
3754 $htmlsection->content = $buffer;
3756 return $htmlsection->render();
3767 $title = _(
"Informazioni");
3768 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLabel'=>$title));
3770 $buffer = _(
"Gestione delle categorie dei punti di interesse");
3772 $htmlsection->content = $buffer;
3774 return $htmlsection->render();