primo commit
This commit is contained in:
1
administrator/components/com_phocamaps/views/index.html
Normal file
1
administrator/components/com_phocamaps/views/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/*
|
||||
* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @component Phoca Gallery
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
|
||||
$r = $this->r;
|
||||
echo $r->startCp();
|
||||
|
||||
echo '<div class="ph-box-cp">';
|
||||
echo '<div class="ph-left-cp">';
|
||||
|
||||
echo '<div class="ph-cp-item-box">';
|
||||
$link = 'index.php?option='.$this->t['o'].'&view=';
|
||||
foreach ($this->views as $k => $v) {
|
||||
$linkV = $link . $this->t['c'] . $k;
|
||||
echo $r->quickIconButton( $linkV, Text::_($v[0]), $v[1], $v[2]);
|
||||
}
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
echo '<civ class="ph-right-cp">';
|
||||
|
||||
echo '<div class="ph-extension-info-box">';
|
||||
|
||||
echo '<div class="ph-cpanel-logo">'.HTMLHelper::_('image', $this->t['i'] . 'logo-'.str_replace('phoca', 'phoca-', $this->t['c']).'.png', 'Phoca.cz') . '</div>';
|
||||
echo '<div class="ph-cpanel-logo-seal">'. HTMLHelper::_('image', $this->t['i'] . 'logo-phoca.png', 'Phoca.cz' ).'</div>';
|
||||
|
||||
|
||||
echo '<h3>'. Text::_($this->t['l'] . '_VERSION').'</h3>'
|
||||
.'<p>'. $this->t['version'] .'</p>';
|
||||
|
||||
echo '<h3>'. Text::_($this->t['l'] . '_COPYRIGHT').'</h3>'
|
||||
.'<p>© 2007 - '. date("Y"). ' Jan Pavelka</p>'
|
||||
.'<p><a href="https://www.phoca.cz/" target="_blank">www.phoca.cz</a></p>';
|
||||
|
||||
echo '<h3>'. Text::_($this->t['l'] . '_LICENSE').'</h3>'
|
||||
.'<p><a href="http://www.gnu.org/licenses/gpl-2.0.html" target="_blank">GPLv2</a></p>';
|
||||
|
||||
echo '<h3>'. Text::_($this->t['l'] . '_TRANSLATION').': '. Text::_($this->t['l'] . '_TRANSLATION_LANGUAGE_TAG').'</h3>'
|
||||
.'<p>© 2007 - '. date("Y"). ' '. Text::_($this->t['l'] . '_TRANSLATER'). '</p>'
|
||||
.'<p>'.Text::_($this->t['l'] . '_TRANSLATION_SUPPORT_URL').'</p>';
|
||||
|
||||
echo '<p> </p><p>Maps are created by OpenStreetmap<br />or by Google Maps™<br />'
|
||||
.'<p>Google™ is a trademark of <a href="http://www.google.com" target="_blank">Google Inc.</a><br />Google Maps™ is a trademark of <a href="http://www.google.com" target="_blank">Google Inc.</a></p>';
|
||||
|
||||
|
||||
echo '<div class="ph-cp-hr"></div>'
|
||||
.'<div class="btn-group ph-cp-btn-update"><a class="btn btn-large btn-primary" href="https://www.phoca.cz/version/index.php?'.$this->t['c'].'='. $this->t['version'] .'" target="_blank"><i class="icon-loop icon-white"></i> '. Text::_($this->t['l'] . '_CHECK_FOR_UPDATE') .'</a></div>';
|
||||
|
||||
|
||||
echo '<div class="ph-cp-logo-footer"><a href="https://www.phoca.cz/" target="_blank">'.HTMLHelper::_('image', $this->t['i'] . 'logo.png', 'Phoca.cz' ).'</a></div>';
|
||||
echo '<div class="ph-cb"></div>';
|
||||
|
||||
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="ph-extension-links-box">';
|
||||
echo $r->getLinks();
|
||||
echo '</div>';
|
||||
|
||||
echo '</div>';
|
||||
|
||||
echo '</div>';
|
||||
echo $r->endCp();
|
||||
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die();
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
|
||||
class PhocaMapsCpViewPhocaMapsCp extends HtmlView
|
||||
{
|
||||
protected $t;
|
||||
protected $r;
|
||||
protected $view;
|
||||
|
||||
function display($tpl = null) {
|
||||
|
||||
$this->t = PhocaMapsUtils::setVars('cp');
|
||||
$this->r = new PhocaMapsRenderAdminview();
|
||||
$i = ' icon-';
|
||||
$d = 'duotone ';
|
||||
|
||||
$this->views= array(
|
||||
'maps' => array($this->t['l'] . '_MAPS', $i.'global', '#01868B'),
|
||||
'markers' => array($this->t['l'] . '_MARKERS', $d.$i.'location', '#D75348'),
|
||||
'icons' => array($this->t['l'] . '_ICONS', $d.$i.'flag', '#5CA4CD'),
|
||||
'info' => array($this->t['l'] . '_INFO', $d.$i.'info-circle', '#3378cc')
|
||||
);
|
||||
$this->t['version'] = PhocaMapsHelper::getPhocaVersion('com_phocamaps');
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
|
||||
}
|
||||
|
||||
protected function addToolbar() {
|
||||
require_once JPATH_COMPONENT.'/helpers/phocamapscp.php';
|
||||
|
||||
$state = $this->get('State');
|
||||
$canDo = PhocaMapsCpHelper::getActions();
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAMAPS_PM_CONTROL_PANEL' ), 'home' );
|
||||
|
||||
// This button is unnecessary but it is displayed because Joomla! design bug
|
||||
$bar = Toolbar::getInstance( 'toolbar' );
|
||||
$dhtml = '<a href="index.php?option=com_phocamaps" class="btn btn-primary btn-small"><i class="icon-home-2" title="'.Text::_('COM_PHOCAMAPS_CONTROL_PANEL').'"></i> '.Text::_('COM_PHOCAMAPS_CONTROL_PANEL').'</a>';
|
||||
$bar->appendButton('Custom', $dhtml);
|
||||
|
||||
if ($canDo->get('core.admin')) {
|
||||
ToolbarHelper::preferences('com_phocamaps');
|
||||
ToolbarHelper::divider();
|
||||
}
|
||||
|
||||
ToolbarHelper::help( 'screen.phocamaps', true );
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
echo '<div id="phocamaps" style="margin:0;padding:0;">';
|
||||
$id = '';
|
||||
$map = new PhocaMapsMap($id);
|
||||
if ($this->type == 'marker') {
|
||||
$map->loadCoordinatesJS();
|
||||
}
|
||||
//$map->loadAPI();
|
||||
echo '<div align="center" style="margin:0;padding:0">';
|
||||
echo '<div id="phocaMap'.$id.'" style="width: 100%;height: 85vh;"></div></div>';
|
||||
|
||||
echo $map->startJScData();
|
||||
|
||||
//echo $map->addAjaxAPI('maps', '3.x', '{"other_params":"sensor=false"}');
|
||||
echo $map->addAjaxAPI('maps', '3.x', '');
|
||||
echo $map->addAjaxAPI('search', '1');
|
||||
|
||||
echo $map->createMap('phocaMap', 'mapPhocaMap', 'phocaLatLng', 'phocaOptions','tstPhocaMap', 'tstIntPhocaMap', 'phocaGeoCoder', TRUE);
|
||||
echo $map->cancelEventFunction();
|
||||
echo $map->checkMapFunction();
|
||||
|
||||
echo $map->startMapFunction();
|
||||
|
||||
echo $map->setLatLng( $this->latitude, $this->longitude );
|
||||
echo $map->startMapOptions();
|
||||
echo $map->setMapOption('zoom', $this->zoom).','."\n";
|
||||
echo $map->setCenterOpt().','."\n";
|
||||
echo $map->setTypeControlOpt().','."\n";
|
||||
echo $map->setNavigationControlOpt().','."\n";
|
||||
echo $map->setMapOption('scaleControl', 1, TRUE ).','."\n";
|
||||
echo $map->setMapOption('scrollwheel', 1, TRUE).','."\n";
|
||||
echo $map->setMapOption('disableDoubleClickZoom', 0).','."\n";
|
||||
// echo $map->setMapOption('googleBar', $this->map->googlebar).','."\n";// Not ready yet
|
||||
// echo $map->setMapOption('continuousZoom', $this->map->continuouszoom).','."\n";// Not ready yet
|
||||
echo $map->setMapTypeOpt()."\n";
|
||||
echo $map->endMapOptions();
|
||||
echo $map->setMap();
|
||||
|
||||
// echo $map->exportZoom($this->zoom, 'window.top.document.forms.adminForm.elements.zoom');
|
||||
// echo $map->exportMarker('Global', $this->type, $this->latitude, $this->longitude, 'window.top.document.forms.adminForm.elements.latitude', 'window.top.document.forms.adminForm.elements.longitude');
|
||||
if ($this->type != 'marker') {
|
||||
echo $map->exportZoom($this->zoom, '', 'phocaSelectMap_jform_zoom');
|
||||
}
|
||||
|
||||
if ($this->type == 'marker') {
|
||||
echo $map->exportMarker('Global', $this->type, $this->latitude, $this->longitude, '', '', 'phocaSelectMap_jform_latitude', 'phocaSelectMap_jform_longitude','phocaSelectMap_jform_gpslatitude', 'phocaSelectMap_jform_gpslongitude');
|
||||
} else {
|
||||
echo $map->exportMarker('Global', $this->type, $this->latitude, $this->longitude, '', '', 'phocaSelectMap_jform_latitude', 'phocaSelectMap_jform_longitude');
|
||||
}
|
||||
|
||||
//if($map->scrollwheelzoom != 0){
|
||||
echo $map->setListener();
|
||||
//}
|
||||
echo $map->setGeoCoder();
|
||||
echo $map->endMapFunction();
|
||||
|
||||
if ($this->type == 'marker') {
|
||||
echo $map->addAddressToMapFunction('Global', 'phocaAddressEl', $this->type, '', '', 'phocaSelectMap_jform_latitude', 'phocaSelectMap_jform_longitude','phocaSelectMap_jform_gpslatitude', 'phocaSelectMap_jform_gpslongitude');// no '.id.' - it is set in class
|
||||
} else {
|
||||
echo $map->addAddressToMapFunction('Global', 'phocaAddressEl', $this->type, '', '', 'phocaSelectMap_jform_latitude', 'phocaSelectMap_jform_longitude');// no '.id.' - it is set in class
|
||||
}
|
||||
|
||||
echo $map->setInitializeFunctionSpecificMap();
|
||||
echo $map->setInitializeFunction();
|
||||
|
||||
echo $map->endJScData();
|
||||
echo $map->loadAPI();// must be loaded as last
|
||||
|
||||
echo '<div class="p-add-address">'
|
||||
. '<form class="form-inline" action="#" onsubmit="addAddressToMap'.$id.'(); return false;">'
|
||||
. '<span>'.Text::_('COM_PHOCAMAPS_SET_COORDINATES_BY_ADDRESS').' : </span>'
|
||||
. ' <input type="text" name="phocaAddressNameEl'.$id.'" id="phocaAddressEl'.$id.'" value="" class="" style="display:inline;" size="30" />'
|
||||
. ' <input type="submit" class="btn" name="find" value="'. Text::_('COM_PHOCAMAPS_SET').'" />'
|
||||
. '</form>'
|
||||
. '</div>';
|
||||
echo '</div>';
|
||||
?>
|
||||
@ -0,0 +1,164 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
$id = uniqid();
|
||||
$map = new PhocaMapsMapOsm($id);
|
||||
$map->loadAPI();
|
||||
if ($this->type == 'marker') {
|
||||
$map->loadCoordinatesJS();
|
||||
}
|
||||
|
||||
|
||||
$map->createMap($this->latitude, $this->longitude, $this->zoom);
|
||||
$map->setMapType();
|
||||
$map->setMarker($id, '', '', $this->latitude, $this->longitude);
|
||||
|
||||
// Export, Move, Input, renderSearch are dependent
|
||||
$map->moveMarker();
|
||||
if ($this->type == 'marker') {
|
||||
$map->inputMarker('jform_latitude_id', 'jform_longitude_id', '', 1);
|
||||
} else {
|
||||
$map->inputMarker('jform_latitude_id', 'jform_longitude_id', 'jform_zoom_id');
|
||||
}
|
||||
$map->exportMarker($id);
|
||||
$map->renderSearch($id);
|
||||
|
||||
$map->renderFullScreenControl();
|
||||
$map->renderCurrentPosition($id);
|
||||
|
||||
$map->renderMap();
|
||||
|
||||
echo '<div id="phocamaps" style="margin:0;padding:0;">';
|
||||
echo '<div align="center" style="margin:0;padding:0">';
|
||||
echo '<div id="phocaMap'.$id.'" style="margin:0;padding:0;width:100%;height:97vh"></div></div>';
|
||||
/*
|
||||
$marker = array();
|
||||
$marker[0] = new stdClass();
|
||||
$marker[0]->latitude = 40;
|
||||
$marker[0]->longitude = 12;
|
||||
$marker[0]->title = 'Marker';
|
||||
$marker[0]->description = 'Description';
|
||||
|
||||
|
||||
$o = '';
|
||||
$id = uniqid();
|
||||
|
||||
$data_attributes = 'data-unique="' . $id . '"' .
|
||||
' data-lon="' . $this->longitude . '"' .
|
||||
' data-lat="' . $this->latitude . '"' .
|
||||
' data-zoom="' . $this->zoom . '"' .
|
||||
//' data-scale="' . $this->map->scalecontrol . '"' .
|
||||
' data-scale="1"' .
|
||||
' data-show_fullscreencontrol="1" ' .
|
||||
' data-fullscreencontrol_viewfullscreen="' . Text::_('PLG_AGGPXTRACK_VIEW_FULLSCREEN') . '"' .
|
||||
' data-fullscreencontrol_exitfullscreen="' . Text::_('PLG_AGGPXTRACK_EXIT_FULLSCREEN') . '"' .
|
||||
' data-fullscreencontrol_position="topright"' .
|
||||
' data-currentposition_position="topright"' .
|
||||
//' data-show_omnivore="' . $this->t['load_kml'] . '"' .
|
||||
//' data-omnivore_file="' . Uri::base() . "phocamapskml/" . $this->map->kmlfile . '"' .
|
||||
' data-show_omnivore=""' .
|
||||
' data-omnivore_file=""' .
|
||||
' data-omnivore_icon="home"' .
|
||||
' data-omnivore_markercolor="blue"' .
|
||||
' data-omnivore_iconcolor="#FFFFFF"' .
|
||||
' data-omnivore_spin="false"' .
|
||||
' data-omnivore_extraclasses=""' .
|
||||
// ' data-specialpins="' . htmlspecialchars(json_encode($this->marker), ENT_QUOTES, 'UTF-8') . '"' .
|
||||
' data-specialpins="' . htmlspecialchars(json_encode($marker), ENT_QUOTES, 'UTF-8') . '"' .
|
||||
' data-maptype="osmorg"';
|
||||
|
||||
|
||||
|
||||
$o .= '<div id="phocamaps-box-leaflet"><div class="pmbox"><div><div><div>';
|
||||
|
||||
$o .= '<div id="map' . $id . '" class="phMap" style="width:100%;height: 400px;border: 1px solid red"></div>';
|
||||
|
||||
$o .= '</div></div></div></div></div>';
|
||||
|
||||
$o .= '<input type="text" id="coordinates" value="" />';
|
||||
echo $o;
|
||||
/*$id = '';
|
||||
$map = new PhocaMapsMap($id);
|
||||
if ($this->type == 'marker') {
|
||||
$map->loadCoordinatesJS();
|
||||
}
|
||||
//$map->loadAPI();
|
||||
echo '<div align="center" style="margin:0;padding:0">';
|
||||
echo '<div id="phocaMap'.$id.'" style="margin:0;padding:0;width:750px;height:480px"></div></div>';
|
||||
|
||||
echo $map->startJScData();
|
||||
|
||||
//echo $map->addAjaxAPI('maps', '3.x', '{"other_params":"sensor=false"}');
|
||||
echo $map->addAjaxAPI('maps', '3.x', '');
|
||||
echo $map->addAjaxAPI('search', '1');
|
||||
|
||||
echo $map->createMap('phocaMap', 'mapPhocaMap', 'phocaLatLng', 'phocaOptions','tstPhocaMap', 'tstIntPhocaMap', 'phocaGeoCoder', TRUE);
|
||||
echo $map->cancelEventFunction();
|
||||
echo $map->checkMapFunction();
|
||||
|
||||
echo $map->startMapFunction();
|
||||
|
||||
echo $map->setLatLng( $this->latitude, $this->longitude );
|
||||
echo $map->startMapOptions();
|
||||
echo $map->setMapOption('zoom', $this->zoom).','."\n";
|
||||
echo $map->setCenterOpt().','."\n";
|
||||
echo $map->setTypeControlOpt().','."\n";
|
||||
echo $map->setNavigationControlOpt().','."\n";
|
||||
echo $map->setMapOption('scaleControl', 1, TRUE ).','."\n";
|
||||
echo $map->setMapOption('scrollwheel', 1, TRUE).','."\n";
|
||||
echo $map->setMapOption('disableDoubleClickZoom', 0).','."\n";
|
||||
// echo $map->setMapOption('googleBar', $this->map->googlebar).','."\n";// Not ready yet
|
||||
// echo $map->setMapOption('continuousZoom', $this->map->continuouszoom).','."\n";// Not ready yet
|
||||
echo $map->setMapTypeOpt()."\n";
|
||||
echo $map->endMapOptions();
|
||||
echo $map->setMap();
|
||||
|
||||
// echo $map->exportZoom($this->zoom, 'window.top.document.forms.adminForm.elements.zoom');
|
||||
// echo $map->exportMarker('Global', $this->type, $this->latitude, $this->longitude, 'window.top.document.forms.adminForm.elements.latitude', 'window.top.document.forms.adminForm.elements.longitude');
|
||||
if ($this->type != 'marker') {
|
||||
echo $map->exportZoom($this->zoom, '', 'phocaSelectMap_jform_zoom');
|
||||
}
|
||||
|
||||
if ($this->type == 'marker') {
|
||||
echo $map->exportMarker('Global', $this->type, $this->latitude, $this->longitude, '', '', 'phocaSelectMap_jform_latitude', 'phocaSelectMap_jform_longitude','phocaSelectMap_jform_gpslatitude', 'phocaSelectMap_jform_gpslongitude');
|
||||
} else {
|
||||
echo $map->exportMarker('Global', $this->type, $this->latitude, $this->longitude, '', '', 'phocaSelectMap_jform_latitude', 'phocaSelectMap_jform_longitude');
|
||||
}
|
||||
|
||||
//if($map->scrollwheelzoom != 0){
|
||||
echo $map->setListener();
|
||||
//}
|
||||
echo $map->setGeoCoder();
|
||||
echo $map->endMapFunction();
|
||||
|
||||
if ($this->type == 'marker') {
|
||||
echo $map->addAddressToMapFunction('Global', 'phocaAddressEl', $this->type, '', '', 'phocaSelectMap_jform_latitude', 'phocaSelectMap_jform_longitude','phocaSelectMap_jform_gpslatitude', 'phocaSelectMap_jform_gpslongitude');// no '.id.' - it is set in class
|
||||
} else {
|
||||
echo $map->addAddressToMapFunction('Global', 'phocaAddressEl', $this->type, '', '', 'phocaSelectMap_jform_latitude', 'phocaSelectMap_jform_longitude');// no '.id.' - it is set in class
|
||||
}
|
||||
|
||||
echo $map->setInitializeFunctionSpecificMap();
|
||||
echo $map->setInitializeFunction();
|
||||
|
||||
echo $map->endJScData();
|
||||
echo $map->loadAPI();// must be loaded as last
|
||||
|
||||
echo '<div class="p-add-address">'
|
||||
. '<form class="form-inline" action="#" onsubmit="addAddressToMap'.$id.'(); return false;">'
|
||||
. '<span>'.Text::_('COM_PHOCAMAPS_SET_COORDINATES_BY_ADDRESS').' : </span>'
|
||||
. ' <input type="text" name="phocaAddressNameEl'.$id.'" id="phocaAddressEl'.$id.'" value="" class="" style="display:inline;" size="30" />'
|
||||
. ' <input type="submit" class="btn" name="find" value="'. Text::_('COM_PHOCAMAPS_SET').'" />'
|
||||
. '</form>'
|
||||
. '</div>';*/
|
||||
|
||||
|
||||
echo '</div>';
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die();
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
jimport( 'joomla.application.component.view');
|
||||
|
||||
class PhocaMapsCpViewPhocaMapsGMap extends HtmlView
|
||||
{
|
||||
protected $latitude;
|
||||
protected $longitude;
|
||||
protected $zoom;
|
||||
protected $type;
|
||||
protected $t;
|
||||
protected $r;
|
||||
protected $p;
|
||||
|
||||
public function display($tpl = null) {
|
||||
|
||||
$paramsC = ComponentHelper::getParams('com_phocamaps') ;
|
||||
$app = Factory::getApplication();
|
||||
|
||||
$this->t = PhocaMapsUtils::setVars();
|
||||
$this->r = new PhocaMapsRenderAdminview();
|
||||
|
||||
$this->latitude = $app->input->get( 'lat', '50', 'get', 'string' );
|
||||
$this->longitude = $app->input->get( 'lng', '-30', 'get', 'string' );
|
||||
$this->zoom = $app->input->get( 'zoom', '2', 'get', 'string' );
|
||||
$this->type = $app->input->get( 'type', 'map', 'get', 'string' );
|
||||
|
||||
$this->p['enable_ssl'] = $paramsC->get('load_api_ssl', 0);
|
||||
$this->p['map_type'] = $paramsC->get( 'map_type', 2 );
|
||||
|
||||
$document = Factory::getDocument();
|
||||
$document->addCustomTag( "<style type=\"text/css\"> \n"
|
||||
." html,body, .contentpane{overflow:hidden;background:#ffffff;} \n"
|
||||
." </style> \n");
|
||||
|
||||
|
||||
|
||||
|
||||
if ($this->p['map_type'] == 2) {
|
||||
parent::display('osm');
|
||||
} else {
|
||||
parent::display($tpl);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
|
||||
defined('JPATH_BASE') or die;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
$r = $this->r;
|
||||
|
||||
Factory::getDocument()->addScriptDeclaration(
|
||||
|
||||
'Joomla.submitbutton = function(task) {
|
||||
if (task == "'. $this->t['task'].'.cancel" || document.formvalidator.isValid(document.getElementById("adminForm"))) {
|
||||
Joomla.submitform(task, document.getElementById("adminForm"));
|
||||
} else {
|
||||
Joomla.renderMessages({"error": ["'. Text::_('JGLOBAL_VALIDATION_FORM_FAILED', true).'"]});
|
||||
}
|
||||
}'
|
||||
|
||||
);
|
||||
|
||||
echo $r->startForm($this->t['o'], $this->t['task'], $this->item->id, 'adminForm', 'adminForm');
|
||||
// First Column
|
||||
echo '<div class="span12 form-horizontal">';
|
||||
$tabs = array (
|
||||
'general' => Text::_($this->t['l'].'_GENERAL_OPTIONS'),
|
||||
'publishing' => Text::_($this->t['l'].'_PUBLISHING_OPTIONS')
|
||||
);
|
||||
echo $r->navigation($tabs);
|
||||
|
||||
$formArray = array ('title', 'alias');
|
||||
echo $r->groupHeader($this->form, $formArray, '');
|
||||
|
||||
echo $r->startTabs();
|
||||
|
||||
echo $r->startTab('general', $tabs['general'], 'active');
|
||||
|
||||
|
||||
if ($this->item->url != '') {
|
||||
echo '<div class="ph-admin-additional-box">';
|
||||
echo '<img src="'.$this->item->url.'" alt="" />';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
|
||||
$formArray = array ('url', 'object', 'objectshape', 'lang','ordering');
|
||||
echo $r->group($this->form, $formArray);
|
||||
$formArray = array('description');
|
||||
echo $r->group($this->form, $formArray, 1);
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->startTab('publishing', $tabs['publishing']);
|
||||
foreach($this->form->getFieldset('publish') as $field) {
|
||||
echo '<div class="control-group">';
|
||||
if (!$field->hidden) {
|
||||
echo '<div class="control-label">'.$field->label.'</div>';
|
||||
}
|
||||
echo '<div class="controls">';
|
||||
echo $field->input;
|
||||
echo '</div></div>';
|
||||
}
|
||||
echo $r->endTab();
|
||||
|
||||
echo '</div>';//end tab content
|
||||
echo '</div>';//end span10
|
||||
|
||||
echo $r->formInputs();
|
||||
echo $r->endForm();
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die();
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
|
||||
class phocaMapsCpViewPhocaMapsIcon extends HtmlView
|
||||
{
|
||||
protected $state;
|
||||
protected $item;
|
||||
protected $form;
|
||||
protected $t;
|
||||
protected $r;
|
||||
|
||||
public function display($tpl = null) {
|
||||
|
||||
$this->t = PhocaMapsUtils::setVars('icon');
|
||||
$this->r = new PhocaMapsRenderAdminview();
|
||||
$this->state = $this->get('State');
|
||||
$this->form = $this->get('Form');
|
||||
$this->item = $this->get('Item');
|
||||
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocamapsicons.php';
|
||||
Factory::getApplication()->input->set('hidemainmenu', true);
|
||||
|
||||
$user = Factory::getUser();
|
||||
$isNew = ($this->item->id == 0);
|
||||
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
|
||||
$canDo = PhocamapsIconsHelper::getActions($this->t, $this->state->get('filter.icon_id'));
|
||||
|
||||
$text = $isNew ? Text::_( 'COM_PHOCAMAPS_NEW' ) : Text::_('COM_PHOCAMAPS_EDIT');
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAMAPS_ICON_EXT' ).': <small><small>[ ' . $text.' ]</small></small>' , 'pin');
|
||||
|
||||
// If not checked out, can save the item.
|
||||
if (!$checkedOut && $canDo->get('core.edit')){
|
||||
ToolbarHelper::apply('phocamapsicon.apply', 'JTOOLBAR_APPLY');
|
||||
ToolbarHelper::save('phocamapsicon.save', 'JTOOLBAR_SAVE');
|
||||
ToolbarHelper::addNew('phocamapsicon.save2new', 'JTOOLBAR_SAVE_AND_NEW');
|
||||
}
|
||||
|
||||
if (empty($this->item->id)) {
|
||||
ToolbarHelper::cancel('phocamapsicon.cancel', 'JTOOLBAR_CANCEL');
|
||||
}
|
||||
else {
|
||||
ToolbarHelper::cancel('phocamapsicon.cancel', 'JTOOLBAR_CLOSE');
|
||||
}
|
||||
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocamaps', true );
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,153 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
$r = $this->r;
|
||||
$user = Factory::getUser();
|
||||
$userId = $user->get('id');
|
||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||
$canOrder = $user->authorise('core.edit.state', $this->t['o']);
|
||||
$saveOrder = $listOrder == 'a.ordering';
|
||||
$saveOrderingUrl = '';
|
||||
if ($saveOrder && !empty($this->items)) {
|
||||
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
|
||||
}
|
||||
$sortFields = $this->getSortFields();
|
||||
|
||||
echo $r->jsJorderTable($listOrder);
|
||||
|
||||
//echo '<div class="clearfix"></div>';
|
||||
|
||||
echo $r->startForm($this->t['o'], $this->t['tasks'], 'adminForm');
|
||||
//echo $r->startFilter();
|
||||
//echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED', $this->state->get('filter.published'));
|
||||
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE', $this->state->get('filter.language'));
|
||||
//echo $r->selectFilterCategory(PhocaMapsSelectMap::options($this->t['o']), 'COM_PHOCAMAPS_SELECT_MAP', $this->state->get('filter.map_id'));
|
||||
//echo $r->endFilter();
|
||||
|
||||
echo $r->startMainContainer();
|
||||
/*
|
||||
echo $r->startFilterBar();
|
||||
echo $r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL', $this->t['l'].'_FILTER_SEARCH_DESC',
|
||||
$this->escape($this->state->get('filter.search')));
|
||||
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT', 'JSEARCH_FILTER_CLEAR');
|
||||
echo $r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC', $this->pagination->getLimitBox());
|
||||
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC', 'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING', $listDirn);
|
||||
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields, $listOrder);
|
||||
|
||||
|
||||
echo $r->startFilterBar(2);
|
||||
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED', $this->state->get('filter.published'));
|
||||
echo $r->endFilterBar();
|
||||
|
||||
echo $r->endFilterBar();*/
|
||||
|
||||
echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
|
||||
|
||||
echo $r->startTable('categoryList');
|
||||
|
||||
echo $r->startTblHeader();
|
||||
|
||||
echo $r->firstColumnHeader($listDirn, $listOrder);
|
||||
echo $r->secondColumnHeader($listDirn, $listOrder);
|
||||
/*
|
||||
echo $r->thOrdering('JGRID__HEADING_ORDERING', $listDirn, $listOrder);
|
||||
echo $r->thCheck('JGLOBAL_CHECK_ALL');*/
|
||||
echo '<th class="">'.Text::_('COM_PHOCAMAPS_ICON').'</th>'."\n";
|
||||
echo '<th class="ph-title-short">'.HTMLHelper::_('searchtools.sort', $this->t['l'].'_TITLE', 'a.title', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-published">'.HTMLHelper::_('searchtools.sort', $this->t['l'].'_PUBLISHED', 'a.published', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-url">'.HTMLHelper::_('searchtools.sort', $this->t['l'].'_URL', 'a.url', $listDirn, $listOrder ).'</th>'."\n";
|
||||
//echo '<th class="ph-language">'.HtmlHelper::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-id">'.HTMLHelper::_('searchtools.sort', $this->t['l'].'_ID', 'a.id', $listDirn, $listOrder ).'</th>'."\n";
|
||||
|
||||
echo $r->endTblHeader();
|
||||
|
||||
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
|
||||
|
||||
$originalOrders = array();
|
||||
$parentsStr = "";
|
||||
$j = 0;
|
||||
|
||||
if (is_array($this->items)) {
|
||||
foreach ($this->items as $i => $item) {
|
||||
// if ($i >= (int)$this->pagination->limitstart && $j < (int)$this->pagination->limit) {
|
||||
$j++;
|
||||
|
||||
$urlEdit = 'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
|
||||
$orderkey = array_search($item->id, $this->ordering[0]);
|
||||
$ordering = ($listOrder == 'a.ordering');
|
||||
$canCreate = $user->authorise('core.create', $this->t['o']);
|
||||
$canEdit = $user->authorise('core.edit', $this->t['o']);
|
||||
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out==$user->get('id') || $item->checked_out==0;
|
||||
$canChange = $user->authorise('core.edit.state', $this->t['o']) && $canCheckin;
|
||||
$linkEdit = Route::_( $urlEdit.(int) $item->id );
|
||||
|
||||
|
||||
/*$iD = $i % 2;
|
||||
echo "\n\n";
|
||||
//echo '<tr class="row'.$iD.'" sortable-group-id="0" item-id="'.$item->id.'" parents="0" level="0">'. "\n";
|
||||
echo '<tr class="row'.$iD.'" sortable-group-id="0" >'. "\n";
|
||||
echo $r->tdOrder($canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
echo $r->td(HtmlHelper::_('grid.id', $i, $item->id), "small ");*/
|
||||
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid : 0);
|
||||
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
$imgU = '';
|
||||
if ($item->url != '') {
|
||||
$imgU = '<img src="'.$item->url.'" alt="" />';
|
||||
}
|
||||
echo $r->td($imgU, "small ");
|
||||
|
||||
$checkO = '';
|
||||
if ($item->checked_out) {
|
||||
$checkO .= HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, $this->t['tasks'].'.', $canCheckin);
|
||||
}
|
||||
if ($canCreate || $canEdit) {
|
||||
$checkO .= '<a href="'. Route::_($linkEdit).'">'. $this->escape($item->title).'</a>';
|
||||
} else {
|
||||
$checkO .= $this->escape($item->title);
|
||||
}
|
||||
$checkO .= ' <span class="smallsub">(<span>'.Text::_($this->t['l'].'_FIELD_ALIAS_LABEL').':</span>'. $this->escape($item->alias).')</span>';
|
||||
echo $r->td($checkO, "small");
|
||||
echo $r->td(HTMLHelper::_('jgrid.published', $item->published, $i, $this->t['tasks'].'.', $canChange), "small");
|
||||
|
||||
|
||||
$url = '';
|
||||
if ($item->url != '') {
|
||||
$url .= '<span>'.$item->url.'</span>';
|
||||
}
|
||||
if ($item->urls != '') {
|
||||
$url .= '<br /><span>'.$item->urls.'</span>';
|
||||
}
|
||||
echo $r->td($url, "small");
|
||||
|
||||
//echo $r->tdLanguage($item->language, $item->language_title, $this->escape($item->language_title));
|
||||
echo $r->td($item->id, "small");
|
||||
|
||||
echo '</tr>'. "\n";
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
echo '</tbody>'. "\n";
|
||||
|
||||
echo $r->tblFoot($this->pagination->getListFooter(), 8);
|
||||
echo $r->endTable();
|
||||
|
||||
|
||||
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
|
||||
echo $r->endMainContainer();
|
||||
echo $r->endForm();
|
||||
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die();
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
|
||||
class PhocaMapsCpViewPhocaMapsIcons extends HtmlView
|
||||
{
|
||||
protected $items;
|
||||
protected $pagination;
|
||||
protected $state;
|
||||
protected $t;
|
||||
protected $r;
|
||||
public $filterForm;
|
||||
public $activeFilters;
|
||||
|
||||
function display($tpl = null) {
|
||||
|
||||
$this->t = PhocaMapsUtils::setVars('icon');
|
||||
$this->r = new PhocaMapsRenderAdminviews();
|
||||
$this->items = $this->get('Items');
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
$this->filterForm = $this->get('FilterForm');
|
||||
$this->activeFilters = $this->get('ActiveFilters');
|
||||
|
||||
|
||||
|
||||
foreach ($this->items as &$item) {
|
||||
$this->ordering[0][] = $item->id;
|
||||
}
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors'))) {
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
|
||||
}
|
||||
|
||||
function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocamapsicons.php';
|
||||
|
||||
$state = $this->get('State');
|
||||
$canDo = PhocaMapsIconsHelper::getActions($this->t, $state->get('filter.icon_id'));
|
||||
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAMAPS_ICONS_EXT' ), 'pin' );
|
||||
|
||||
if ($canDo->get('core.create')) {
|
||||
ToolbarHelper::addNew('phocamapsicon.add','JTOOLBAR_NEW');
|
||||
}
|
||||
|
||||
if ($canDo->get('core.edit')) {
|
||||
ToolbarHelper::editList('phocamapsicon.edit','JTOOLBAR_EDIT');
|
||||
}
|
||||
if ($canDo->get('core.edit.state')) {
|
||||
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::custom('phocamapsicons.publish', 'publish.png', 'publish_f2.png','JTOOLBAR_PUBLISH', true);
|
||||
ToolbarHelper::custom('phocamapsicons.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
|
||||
}
|
||||
|
||||
if ($canDo->get('core.delete')) {
|
||||
ToolbarHelper::deleteList( 'COM_PHOCAMAPS_WARNING_DELETE_ITEMS' , 'phocamapsicons.delete', 'COM_PHOCAMAPS_DELETE');
|
||||
}
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocamaps', true );
|
||||
}
|
||||
|
||||
protected function getSortFields() {
|
||||
return array(
|
||||
'a.ordering' => Text::_('JGRID_HEADING_ORDERING'),
|
||||
'a.title' => Text::_($this->t['l'] . '_TITLE'),
|
||||
'a.published' => Text::_($this->t['l'] . '_PUBLISHED'),
|
||||
//'language' => JText::_('JGRID_HEADING_LANGUAGE'),
|
||||
'a.id' => Text::_('JGRID_HEADING_ID'),
|
||||
'a.url' => Text::_($this->t['l'] . '_URL')
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,183 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
$r = $this->r;
|
||||
echo $r->startCp();
|
||||
|
||||
echo '<div class="ph-box-info">';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
echo '<div style="float:right;margin:10px;">' . HTMLHelper::_('image', $this->t['i'] . 'logo-phoca.png', 'Phoca.cz' ) .'</div>'
|
||||
. '<div class="ph-cpanel-logo">'.HTMLHelper::_('image', $this->t['i'] . 'logo-'.str_replace('phoca', 'phoca-', $this->t['c']).'.png', 'Phoca.cz') . '</div>'
|
||||
.'<h3>'.Text::_($this->t['component_head']).' - '. Text::_($this->t['l'].'_INFORMATION').'</h3>'
|
||||
.'<div style="clear:both;"></div>';
|
||||
|
||||
echo '<h3>'. Text::_($this->t['l'].'_HELP').'</h3>';
|
||||
|
||||
echo '<div>';
|
||||
if (!empty($this->t['component_links'])) {
|
||||
foreach ($this->t['component_links'] as $k => $v) {
|
||||
echo '<div><a href="'.$v[1].'" target="_blank">'.$v[0].'</a></div>';
|
||||
}
|
||||
}
|
||||
echo '</div>';
|
||||
|
||||
echo '<h3>'. Text::_($this->t['l'] . '_VERSION').'</h3>'
|
||||
.'<p>'. $this->t['version'] .'</p>';
|
||||
|
||||
echo '<h3>'. Text::_($this->t['l'] . '_COPYRIGHT').'</h3>'
|
||||
.'<p>© 2007 - '. date("Y"). ' Jan Pavelka</p>'
|
||||
.'<p><a href="https://www.phoca.cz/" target="_blank">www.phoca.cz</a></p>';
|
||||
|
||||
echo '<h3>'. Text::_($this->t['l'] . '_LICENSE').'</h3>'
|
||||
.'<p><a href="http://www.gnu.org/licenses/gpl-2.0.html" target="_blank">GPLv2</a></p>';
|
||||
|
||||
echo '<h3>'. Text::_($this->t['l'] . '_TRANSLATION').': '. Text::_($this->t['l'] . '_TRANSLATION_LANGUAGE_TAG').'</h3>'
|
||||
.'<p>© 2007 - '. date("Y"). ' '. Text::_($this->t['l'] . '_TRANSLATER'). '</p>'
|
||||
.'<p>'.Text::_($this->t['l'] . '_TRANSLATION_SUPPORT_URL').'</p>';
|
||||
|
||||
?><p>Maps are created by OpenStreetmap<br />or by Google Maps™<br />
|
||||
<p>Google™ is a trademark of <a href="http://www.google.com" target="_blank">Google Inc.</a><br />Google Maps™ is a trademark of <a href="http://www.google.com" target="_blank">Google Inc.</a></p><?php
|
||||
|
||||
echo '<input type="hidden" name="task" value="" />'
|
||||
.'<input type="hidden" name="option" value="'.$this->t['o'].'" />'
|
||||
.'<input type="hidden" name="controller" value="'.$this->t['c'].'info" />';
|
||||
|
||||
echo HTMLHelper::_('image', $this->t['i'] . 'logo.png', 'Phoca.cz');
|
||||
|
||||
|
||||
echo '<p> </p>';
|
||||
|
||||
|
||||
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
|
||||
$wa->addInlineStyle('
|
||||
|
||||
.upBox {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-top:1em;
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
|
||||
.upItemText {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.upItem {
|
||||
padding: 1em;
|
||||
text-align: center;
|
||||
width: calc(50% - 0.4em);
|
||||
margin: 0.2em;
|
||||
border-radius: 0.3em;
|
||||
}
|
||||
|
||||
.upItemD {
|
||||
background: #F5D042;
|
||||
color: #000;
|
||||
border: 2px solid #F5D042;
|
||||
|
||||
}
|
||||
.upItemPh {
|
||||
background: rgba(255,255,255,0.7);
|
||||
color: #000;
|
||||
border: 2px solid #000;
|
||||
}
|
||||
.upItemDoc {
|
||||
background: rgba(255,255,255,0.7);
|
||||
color: #000;
|
||||
border: 2px solid #000;
|
||||
}
|
||||
.upItemJ {
|
||||
background: rgba(255,255,255,0.7);
|
||||
color: #000;
|
||||
border: 2px solid #000;
|
||||
}
|
||||
|
||||
a.upItemLink {
|
||||
padding: 0.5em 1em;
|
||||
border-radius: 9999px;
|
||||
margin: 1em;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
a.upItemLink::before {
|
||||
content: none;
|
||||
}
|
||||
.upItemPh a.upItemLink {
|
||||
background: #000;
|
||||
color: #fff;
|
||||
}
|
||||
.upItemDoc a.upItemLink {
|
||||
background: #000;
|
||||
color: #fff;
|
||||
}
|
||||
.upItemJ a.upItemLink {
|
||||
background: #000;
|
||||
color: #fff;
|
||||
}
|
||||
');
|
||||
|
||||
$upEL = 'https://extensions.joomla.org/extension/phoca-maps/';
|
||||
$upE = 'Phoca Maps';
|
||||
|
||||
$o = '<div class="upBox">';
|
||||
|
||||
$o .= '<div class="upItem upItemD">';
|
||||
$o .= '<div class="upItemText">If you find this project useful, please support it with a donation</div>';
|
||||
$o .= '<form action="https://www.paypal.com/donate" method="post" target="_top">';
|
||||
$o .= '<input type="hidden" name="hosted_button_id" value="ZVPH25SQ2DDBY" />';
|
||||
$o .= '<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" />';
|
||||
$o .= '<img alt="" border="0" src="https://www.paypal.com/en_CZ/i/scr/pixel.gif" width="1" height="1" />';
|
||||
$o .= '</form>';
|
||||
$o .= '</div>';
|
||||
|
||||
$o .= '<div class="upItem upItemJ">';
|
||||
$o .= '<div class="upItemText">If you find this project useful, please post a rating and review on the Joomla! Extension Directory website</div>';
|
||||
$o .= '<a class="upItemLink" target="_blank" href="'. $upEL.'">'. $upE.' (JED website)</a>';
|
||||
$o .= '</form>';
|
||||
$o .= '</div>';
|
||||
|
||||
$o .= '<div class="upItem upItemDoc">';
|
||||
$o .= '<div class="upItemText">If you need help, visit</div>';
|
||||
$o .= '<a class="upItemLink" target="_blank" href="https://www.phoca.cz/documentation">Phoca documentation website</a>';
|
||||
$o .= '<div class="upItemText">or ask directly in</div>';
|
||||
$o .= '<a class="upItemLink" target="_blank" href="https://www.phoca.cz/forum">Phoca forum website</a>';
|
||||
$o .= '</div>';
|
||||
|
||||
$o .= '<div class="upItem upItemPh">';
|
||||
$o .= '<div class="upItemText">There are over a hundred more useful Phoca extensions, discover them on</div>';
|
||||
$o .= '<a class="upItemLink" target="_blank" href="https://www.phoca.cz">Phoca website</a>';
|
||||
$o .= '</div>';
|
||||
|
||||
$o .= '</div>';
|
||||
echo $o;
|
||||
|
||||
echo '<div class="ph-cp-hr"></div>';
|
||||
echo '<div class="btn-group">
|
||||
|
||||
<a class="btn btn-large btn-primary" href="https://www.phoca.cz/version/index.php?'.$this->t['c'].'='. $this->t['version'] .'" target="_blank"><i class="icon-loop icon-white"></i> '. Text::_($this->t['l'].'_CHECK_FOR_UPDATE') .'</a></div>';
|
||||
|
||||
echo '<div style="margin-top:30px;height:39px;background: url(\''.Uri::root(true).'/media/com_'.$this->t['c'].'/images/administrator/line.png\') 100% 0 no-repeat;"> </div>';
|
||||
|
||||
echo '</div>';
|
||||
|
||||
|
||||
echo '</div>';
|
||||
echo $r->endCp();
|
||||
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die();
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
|
||||
class PhocaMapsCpViewPhocaMapsInfo extends HtmlView
|
||||
{
|
||||
protected $t;
|
||||
protected $r;
|
||||
|
||||
public function display($tpl = null) {
|
||||
$this->t = PhocaMapsUtils::setVars('info');
|
||||
$this->r = new PhocaMapsRenderAdminview();
|
||||
$this->t['component_head'] = 'COM_PHOCAMAPS_PHOCA_MAPS';
|
||||
$this->t['component_links'] = $this->r->getLinks(1);
|
||||
$this->t['version'] = PhocaMapsHelper::getPhocaVersion('com_phocamaps');
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function addToolbar() {
|
||||
require_once JPATH_COMPONENT.'/helpers/'.$this->t['c'].'cp.php';
|
||||
$class = $this->t['n'] . 'CpHelper';
|
||||
$canDo = $class::getActions($this->t['c']);
|
||||
|
||||
ToolbarHelper::title( Text::_($this->t['l'].'_PM_INFO' ), 'info.png' );
|
||||
|
||||
// This button is unnecessary but it is displayed because Joomla! design bug
|
||||
$bar = Toolbar::getInstance( 'toolbar' );
|
||||
$dhtml = '<a href="index.php?option=com_phocamaps" class="btn btn-primary btn-small"><i class="icon-home-2" title="'.Text::_('COM_PHOCAMAPS_CONTROL_PANEL').'"></i> '.Text::_('COM_PHOCAMAPS_CONTROL_PANEL').'</a>';
|
||||
$bar->appendButton('Custom', $dhtml);
|
||||
|
||||
if ($canDo->get('core.admin')) {
|
||||
ToolbarHelper::preferences('com_'.$this->t['c']);
|
||||
}
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.'.$this->t['c'], true );
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
|
||||
|
||||
defined( '_JEXEC' ) or die();
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
$r = $this->r;
|
||||
|
||||
Factory::getDocument()->addScriptDeclaration(
|
||||
|
||||
'Joomla.submitbutton = function(task) {
|
||||
if (task == "'. $this->t['task'].'.cancel" || document.formvalidator.isValid(document.getElementById("adminForm"))) {
|
||||
Joomla.submitform(task, document.getElementById("adminForm"));
|
||||
} else {
|
||||
Joomla.renderMessages({"error": ["'. Text::_('JGLOBAL_VALIDATION_FORM_FAILED', true).'"]});
|
||||
}
|
||||
}'
|
||||
|
||||
);
|
||||
|
||||
echo $r->startForm($this->t['o'], $this->t['task'], $this->item->id, 'adminForm', 'adminForm');
|
||||
// First Column
|
||||
echo '<div class="span12 form-horizontal">';
|
||||
$tabs = array (
|
||||
'general' => Text::_($this->t['l'].'_GENERAL_OPTIONS'),
|
||||
'publishing' => Text::_($this->t['l'].'_PUBLISHING_OPTIONS'),
|
||||
'design' => Text::_($this->t['l'].'_DESIGN_SETTINGS'),
|
||||
'advanced' => Text::_($this->t['l'].'_ADVANCED_SETTINGS_GOOGLE_MAPS'),
|
||||
'osm_advanced' => Text::_($this->t['l'].'_ADVANCED_SETTINGS_OPENSTREETMAP')
|
||||
);
|
||||
echo $r->navigation($tabs);
|
||||
|
||||
|
||||
$formArray = array ('title', 'alias');
|
||||
echo $r->groupHeader($this->form, $formArray, '');
|
||||
|
||||
echo $r->startTabs();
|
||||
|
||||
echo $r->startTab('general', $tabs['general'], 'active');
|
||||
$formArray = array ('latitude','longitude', 'zoom', 'width', 'height', 'lang','ordering');
|
||||
echo $r->group($this->form, $formArray);
|
||||
$formArray = array('description');
|
||||
echo $r->group($this->form, $formArray, 1);
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->startTab('publishing', $tabs['publishing']);
|
||||
foreach($this->form->getFieldset('publish') as $field) {
|
||||
echo '<div class="control-group">';
|
||||
if (!$field->hidden) {
|
||||
echo '<div class="control-label">'.$field->label.'</div>';
|
||||
}
|
||||
echo '<div class="controls">';
|
||||
echo $field->input;
|
||||
echo '</div></div>';
|
||||
}
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->startTab('design', $tabs['design']);
|
||||
$formArray = array ('border');
|
||||
echo $r->group($this->form, $formArray);
|
||||
echo $r->endTab();
|
||||
|
||||
|
||||
echo $r->startTab('advanced', $tabs['advanced']);
|
||||
$formArray = array ('typeid', 'typecontrol', 'typecontrolposition', 'doubleclickzoom', 'scrollwheelzoom', 'gesturehandling', 'zoomcontrol', 'scalecontrol', 'autolocation', 'displayroute', 'kmlfile', 'custom_options', 'map_styles');
|
||||
echo $r->group($this->form, $formArray);
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->startTab('osm_advanced', $tabs['osm_advanced']);
|
||||
$formArray = array ('trackfiles_osm', 'trackcolors_osm', 'fitbounds_osm');
|
||||
echo $r->group($this->form, $formArray);
|
||||
echo $r->endTab();
|
||||
|
||||
|
||||
echo '</div>';//end tab content
|
||||
echo '</div>';//end span10
|
||||
|
||||
echo $r->formInputs();
|
||||
echo $r->endForm();
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die();
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
|
||||
class phocaMapsCpViewPhocaMapsMap extends HtmlView
|
||||
{
|
||||
protected $state;
|
||||
protected $item;
|
||||
protected $form;
|
||||
protected $t;
|
||||
protected $r;
|
||||
|
||||
public function display($tpl = null) {
|
||||
|
||||
$this->t = PhocaMapsUtils::setVars('map');
|
||||
$this->r = new PhocaMapsRenderAdminview();
|
||||
$this->state = $this->get('State');
|
||||
$this->form = $this->get('Form');
|
||||
$this->item = $this->get('Item');
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocamapsmaps.php';
|
||||
Factory::getApplication()->input->set('hidemainmenu', true);
|
||||
|
||||
$user = Factory::getUser();
|
||||
$isNew = ($this->item->id == 0);
|
||||
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
|
||||
//$canDo = PhocamapsMapsHelper::getActions($this->state->get('filter.map_id'), $this->item->id);
|
||||
$canDo = PhocamapsMapsHelper::getActions($this->t, $this->state->get('filter.map_id'));
|
||||
//$paramsC = ComponentHelper::getParams('COM_PHOCAMAPS');
|
||||
|
||||
|
||||
|
||||
$text = $isNew ? Text::_( 'COM_PHOCAMAPS_NEW' ) : Text::_('COM_PHOCAMAPS_EDIT');
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAMAPS_MAP' ).': <small><small>[ ' . $text.' ]</small></small>' , 'ph-earth');
|
||||
|
||||
// If not checked out, can save the item.
|
||||
if (!$checkedOut && $canDo->get('core.edit')){
|
||||
ToolbarHelper::apply('phocamapsmap.apply', 'JTOOLBAR_APPLY');
|
||||
ToolbarHelper::save('phocamapsmap.save', 'JTOOLBAR_SAVE');
|
||||
ToolbarHelper::addNew('phocamapsmap.save2new', 'JTOOLBAR_SAVE_AND_NEW');
|
||||
}
|
||||
|
||||
if (empty($this->item->id)) {
|
||||
ToolbarHelper::cancel('phocamapsmap.cancel', 'JTOOLBAR_CANCEL');
|
||||
}
|
||||
else {
|
||||
ToolbarHelper::cancel('phocamapsmap.cancel', 'JTOOLBAR_CLOSE');
|
||||
}
|
||||
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocamaps', true );
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,142 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
$r = $this->r;
|
||||
$user = Factory::getUser();
|
||||
$userId = $user->get('id');
|
||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||
$canOrder = $user->authorise('core.edit.state', $this->t['o']);
|
||||
$saveOrder = $listOrder == 'a.ordering';
|
||||
$saveOrderingUrl = '';
|
||||
if ($saveOrder && !empty($this->items)) {
|
||||
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
|
||||
}
|
||||
$sortFields = $this->getSortFields();
|
||||
|
||||
echo $r->jsJorderTable($listOrder);
|
||||
|
||||
//echo '<div class="clearfix"></div>';
|
||||
|
||||
echo $r->startForm($this->t['o'], $this->t['tasks'], 'adminForm');
|
||||
//echo $r->startFilter();
|
||||
//echo $r->endFilter();
|
||||
|
||||
echo $r->startMainContainer();
|
||||
|
||||
if ($this->t['maps_api_key'] == '' && $this->t['map_type'] == 1) {
|
||||
echo '<div class="alert alert-error alert-danger">' . Text::_('COM_PHOCAMAPS_ERROR_API_KEY_NOT_SET') .'</div>';
|
||||
}
|
||||
/*
|
||||
echo $r->startFilterBar();
|
||||
echo $r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL', $this->t['l'].'_FILTER_SEARCH_DESC',
|
||||
$this->escape($this->state->get('filter.search')));
|
||||
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT', 'JSEARCH_FILTER_CLEAR');
|
||||
echo $r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC', $this->pagination->getLimitBox());
|
||||
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC', 'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING', $listDirn);
|
||||
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields, $listOrder);
|
||||
|
||||
echo $r->startFilterBar(2);
|
||||
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED', $this->state->get('filter.published'));
|
||||
echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE', $this->state->get('filter.language'));
|
||||
echo $r->endFilterBar();
|
||||
|
||||
echo $r->endFilterBar();*/
|
||||
echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
|
||||
|
||||
echo $r->startTable('categoryList');
|
||||
|
||||
echo $r->startTblHeader();
|
||||
|
||||
echo $r->firstColumnHeader($listDirn, $listOrder);
|
||||
echo $r->secondColumnHeader($listDirn, $listOrder);
|
||||
/*
|
||||
echo $r->thOrdering('JGRID__HEADING_ORDERING', $listDirn, $listOrder);
|
||||
echo $r->thCheck('JGLOBAL_CHECK_ALL');*/
|
||||
echo '<th class="ph-title-short">'.HTMLHelper::_('searchtools.sort', $this->t['l'].'_TITLE', 'a.title', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-published">'.HTMLHelper::_('searchtools.sort', $this->t['l'].'_PUBLISHED', 'a.published', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-plugincode">'.Text::_('COM_PHOCAMAPS_PLUGIN_CODE').'</th>'."\n";
|
||||
echo '<th class="ph-language">'.HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-id">'.HTMLHelper::_('searchtools.sort', $this->t['l'].'_ID', 'a.id', $listDirn, $listOrder ).'</th>'."\n";
|
||||
|
||||
echo $r->endTblHeader();
|
||||
|
||||
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
|
||||
|
||||
$originalOrders = array();
|
||||
$parentsStr = "";
|
||||
$j = 0;
|
||||
|
||||
if (is_array($this->items)) {
|
||||
foreach ($this->items as $i => $item) {
|
||||
// if ($i >= (int)$this->pagination->limitstart && $j < (int)$this->pagination->limit) {
|
||||
$j++;
|
||||
|
||||
$urlEdit = 'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
|
||||
$orderkey = array_search($item->id, $this->ordering[0]);
|
||||
$ordering = ($listOrder == 'a.ordering');
|
||||
$canCreate = $user->authorise('core.create', $this->t['o']);
|
||||
$canEdit = $user->authorise('core.edit', $this->t['o']);
|
||||
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out==$user->get('id') || $item->checked_out==0;
|
||||
$canChange = $user->authorise('core.edit.state', $this->t['o']) && $canCheckin;
|
||||
$linkEdit = Route::_( $urlEdit.(int) $item->id );
|
||||
|
||||
|
||||
/*$iD = $i % 2;
|
||||
echo "\n\n";
|
||||
echo '<tr class="row'.$iD.'" sortable-group-id="0" item-id="'.$item->id.'" parents="0" level="0">'. "\n";
|
||||
|
||||
echo $r->tdOrder($canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
echo $r->td(HtmlHelper::_('searchtools.id', $i, $item->id), "small ");*/
|
||||
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid : 0);
|
||||
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
|
||||
|
||||
$checkO = '';
|
||||
if ($item->checked_out) {
|
||||
$checkO .= HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, $this->t['tasks'].'.', $canCheckin);
|
||||
}
|
||||
if ($canCreate || $canEdit) {
|
||||
$checkO .= '<a href="'. Route::_($linkEdit).'">'. $this->escape($item->title).'</a>';
|
||||
} else {
|
||||
$checkO .= $this->escape($item->title);
|
||||
}
|
||||
$checkO .= ' <span class="smallsub">(<span>'.Text::_($this->t['l'].'_FIELD_ALIAS_LABEL').':</span>'. $this->escape($item->alias).')</span>';
|
||||
echo $r->td($checkO, "small");
|
||||
echo $r->td(HTMLHelper::_('jgrid.published', $item->published, $i, $this->t['tasks'].'.', $canChange), "small");
|
||||
|
||||
|
||||
echo '<td class="ph-plugincode-td">{phocamaps view=map|id='.$item->id.'} <br>{phocamaps view=link|id='.$item->id.'|text=Map}</td>';
|
||||
|
||||
|
||||
echo $r->tdLanguage($item->language, $item->language_title, $this->escape($item->language_title));
|
||||
echo $r->td($item->id, "small");
|
||||
|
||||
echo $r->endTr();
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
echo $r->endTblBody();
|
||||
|
||||
echo $r->tblFoot($this->pagination->getListFooter(), 8);
|
||||
echo $r->endTable();
|
||||
|
||||
echo $this->loadTemplate('batch');
|
||||
|
||||
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
|
||||
echo $r->endMainContainer();
|
||||
echo $r->endForm();
|
||||
?>
|
||||
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
|
||||
//$published = $this->state->get('filter.published');
|
||||
?>
|
||||
|
||||
<div id="collapseModal" role="dialog" tabindex="-1" class="joomla-modal modal fade">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title"><?php echo Text::_('COM_PHOCAMAPS_BATCH_OPTIONS_MAPS');?></h3>
|
||||
<button type="button" class="btn-close novalidate" data-bs-dismiss="modal" aria-label="<?php Text::_('COM_PHOCAMAPS_CLOSE'); ?>">
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="p-3">
|
||||
<?php /*<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<div class="controls"><?php echo LayoutHelper::render('joomla.html.batch.access', []);?></div>
|
||||
</div>
|
||||
</div> */ ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<div class="controls"><?php echo LayoutHelper::render('joomla.html.batch.language', []); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<div class="controls"><?php echo PhocaMapsBatch::item('', 1); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class="btn" type="button" onclick="document.getElementById('batch-category-id').value='';document.getElementById('batch-access').value='';document.getElementById('batch-language-id').value=''" data-bs-dismiss="modal">
|
||||
<?php echo Text::_('JCANCEL'); ?>
|
||||
</button>
|
||||
<button class="btn btn-primary" type="submit" onclick="Joomla.submitbutton('<?php echo $this->t['task'] ?>.batch');" id="batch-submit-button-id" data-submit-task="<?php echo $this->t['task'] ?>.batch">
|
||||
<?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,120 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die();
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
|
||||
class PhocaMapsCpViewPhocaMapsMaps extends HtmlView
|
||||
{
|
||||
protected $items;
|
||||
protected $pagination;
|
||||
protected $state;
|
||||
protected $t;
|
||||
protected $r;
|
||||
public $filterForm;
|
||||
public $activeFilters;
|
||||
|
||||
function display($tpl = null) {
|
||||
|
||||
$this->t = PhocaMapsUtils::setVars('map');
|
||||
$this->r = new PhocaMapsRenderAdminViews();
|
||||
|
||||
$this->items = $this->get('Items');
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
$this->filterForm = $this->get('FilterForm');
|
||||
$this->activeFilters = $this->get('ActiveFilters');
|
||||
|
||||
$paramsC = ComponentHelper::getParams('com_phocamaps');
|
||||
$this->t['maps_api_key'] = $paramsC->get( 'maps_api_key', '' );
|
||||
$this->t['map_type'] = $paramsC->get( 'map_type', 2 );
|
||||
//$this->t['load_api_ssl'] = $paramsC->get( 'load_api_ssl', 1 );
|
||||
|
||||
// Preprocess the list of items to find ordering divisions.
|
||||
foreach ($this->items as &$item) {
|
||||
$this->ordering[0][] = $item->id;
|
||||
}
|
||||
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors'))) {
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocamapsmaps.php';
|
||||
|
||||
$state = $this->get('State');
|
||||
$canDo = PhocaMapsMapsHelper::getActions($this->t, $state->get('filter.map_id'));
|
||||
$user = Factory::getUser();
|
||||
$bar = Toolbar::getInstance('toolbar');
|
||||
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAMAPS_MAPS' ), 'ph-earth' );
|
||||
|
||||
if ($canDo->get('core.create')) {
|
||||
ToolbarHelper::addNew('phocamapsmap.add','JTOOLBAR_NEW');
|
||||
}
|
||||
|
||||
if ($canDo->get('core.edit')) {
|
||||
ToolbarHelper::editList('phocamapsmap.edit','JTOOLBAR_EDIT');
|
||||
}
|
||||
if ($canDo->get('core.edit.state')) {
|
||||
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::custom('phocamapsmaps.publish', 'publish.png', 'publish_f2.png','JTOOLBAR_PUBLISH', true);
|
||||
ToolbarHelper::custom('phocamapsmaps.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
|
||||
}
|
||||
|
||||
if ($canDo->get('core.delete')) {
|
||||
ToolbarHelper::deleteList( 'COM_PHOCAMAPS_WARNING_DELETE_ITEMS' , 'phocamapsmaps.delete', 'COM_PHOCAMAPS_DELETE');
|
||||
}
|
||||
|
||||
// Add a batch button
|
||||
if ($user->authorise('core.edit'))
|
||||
{
|
||||
/*HTMLHelper::_('bootstrap.renderModal', 'collapseModal');
|
||||
$title = Text::_('JTOOLBAR_BATCH');
|
||||
$dhtml = "<button data-toggle=\"modal\" data-target=\"#collapseModal\" class=\"btn btn-small\">
|
||||
<i class=\"icon-checkbox-partial\" title=\"$title\"></i>
|
||||
$title</button>";
|
||||
$bar->appendButton('Custom', $dhtml, 'batch');
|
||||
*/
|
||||
$bar->popupButton('batch')
|
||||
->text('JTOOLBAR_BATCH')
|
||||
->selector('collapseModal')
|
||||
->listCheck(true);
|
||||
}
|
||||
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocamaps', true );
|
||||
}
|
||||
|
||||
protected function getSortFields() {
|
||||
return array(
|
||||
'a.ordering' => Text::_('JGRID_HEADING_ORDERING'),
|
||||
'a.title' => Text::_($this->t['l'] . '_TITLE'),
|
||||
'a.published' => Text::_($this->t['l'] . '_PUBLISHED'),
|
||||
'language' => Text::_('JGRID_HEADING_LANGUAGE'),
|
||||
'a.id' => Text::_('JGRID_HEADING_ID')
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,85 @@
|
||||
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
|
||||
|
||||
defined('JPATH_PLATFORM') or die;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
$r = $this->r;
|
||||
|
||||
|
||||
Factory::getDocument()->addScriptDeclaration(
|
||||
|
||||
'Joomla.submitbutton = function(task) {
|
||||
if (task != \''. $this->t['task'].'.cancel\' && document.getElementById(\'jform_catid\').value == \'\') {
|
||||
alert(\''.Text::_('JGLOBAL_VALIDATION_FORM_FAILED', true) . ' - '. Text::_('COM_PHOCAMAPS_ERROR_MAP_NOT_SELECTED', true).'\');
|
||||
} else if (task == "'. $this->t['task'].'.cancel" || document.formvalidator.isValid(document.getElementById("adminForm"))) {
|
||||
Joomla.submitform(task, document.getElementById("adminForm"));
|
||||
} else {
|
||||
Joomla.renderMessages({"error": ["'. Text::_('JGLOBAL_VALIDATION_FORM_FAILED', true).'"]});
|
||||
}
|
||||
}'
|
||||
|
||||
);
|
||||
|
||||
echo $r->startForm($this->t['o'], $this->t['task'], $this->item->id, 'adminForm', 'adminForm');
|
||||
// First Column
|
||||
echo '<div class="span12 form-horizontal">';
|
||||
$tabs = array (
|
||||
'general' => Text::_($this->t['l'].'_GENERAL_OPTIONS'),
|
||||
'publishing' => Text::_($this->t['l'].'_PUBLISHING_OPTIONS'),
|
||||
'design' => Text::_($this->t['l'].'_DESIGN_SETTINGS_GOOGLE_MAPS'),
|
||||
'osm_design' => Text::_($this->t['l'].'_DESIGN_SETTINGS_OPENSTREETMAP')
|
||||
);
|
||||
echo $r->navigation($tabs);
|
||||
|
||||
$formArray = array ('title', 'alias');
|
||||
echo $r->groupHeader($this->form, $formArray, '');
|
||||
|
||||
echo $r->startTabs();
|
||||
|
||||
echo $r->startTab('general', $tabs['general'], 'active');
|
||||
$formArray = array ('latitude','longitude', 'gpslatitude', 'gpslongitude', 'catid', 'ordering', 'markerwindow', 'contentwidth', 'contentheight', 'displaygps');
|
||||
echo $r->group($this->form, $formArray);
|
||||
$formArray = array('description');
|
||||
echo $r->group($this->form, $formArray, 1);
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->startTab('publishing', $tabs['publishing']);
|
||||
foreach($this->form->getFieldset('publish') as $field) {
|
||||
echo '<div class="control-group">';
|
||||
if (!$field->hidden) {
|
||||
echo '<div class="control-label">'.$field->label.'</div>';
|
||||
}
|
||||
echo '<div class="controls">';
|
||||
echo $field->input;
|
||||
echo '</div></div>';
|
||||
}
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->startTab('design', $tabs['design']);
|
||||
$formArray = array ('icon', 'iconext');
|
||||
echo $r->group($this->form, $formArray);
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->startTab('osm_design', $tabs['osm_design']);
|
||||
$formArray = array ('osm_icon', 'osm_marker_color', 'osm_icon_color', 'osm_icon_prefix', 'osm_icon_spin', 'osm_icon_class');
|
||||
echo $r->group($this->form, $formArray);
|
||||
echo $r->endTab();
|
||||
|
||||
|
||||
|
||||
echo '</div>';//end tab content
|
||||
echo '</div>';//end span10
|
||||
|
||||
echo $r->formInputs();
|
||||
echo $r->endForm();
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die();
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
|
||||
class phocaMapsCpViewPhocaMapsMarker extends HtmlView
|
||||
{
|
||||
protected $state;
|
||||
protected $item;
|
||||
protected $form;
|
||||
protected $t;
|
||||
protected $r;
|
||||
|
||||
public function display($tpl = null) {
|
||||
|
||||
$this->t = PhocaMapsUtils::setVars('marker');
|
||||
$this->r = new PhocaMapsRenderAdminview();
|
||||
$this->state = $this->get('State');
|
||||
$this->form = $this->get('Form');
|
||||
$this->item = $this->get('Item');
|
||||
|
||||
$document= Factory::getDocument();
|
||||
$document->addScript(Uri::root(true).'/'. $this->t['ja'] .'coordinates.js');
|
||||
|
||||
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocamapsmarkers.php';
|
||||
Factory::getApplication()->input->set('hidemainmenu', true);
|
||||
|
||||
$user = Factory::getUser();
|
||||
$isNew = ($this->item->id == 0);
|
||||
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
|
||||
$canDo = PhocamapsMarkersHelper::getActions($this->t, $this->state->get('filter.marker_id'));
|
||||
//$paramsC = ComponentHelper::getParams('COM_PHOCAMAPS');
|
||||
|
||||
|
||||
|
||||
$text = $isNew ? Text::_( 'COM_PHOCAMAPS_NEW' ) : Text::_('COM_PHOCAMAPS_EDIT');
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAMAPS_MARKER' ).': <small><small>[ ' . $text.' ]</small></small>' , 'location');
|
||||
|
||||
// If not checked out, can save the item.
|
||||
if (!$checkedOut && $canDo->get('core.edit')){
|
||||
ToolbarHelper::apply('phocamapsmarker.apply', 'JTOOLBAR_APPLY');
|
||||
ToolbarHelper::save('phocamapsmarker.save', 'JTOOLBAR_SAVE');
|
||||
ToolbarHelper::addNew('phocamapsmarker.save2new', 'JTOOLBAR_SAVE_AND_NEW');
|
||||
}
|
||||
|
||||
if (empty($this->item->id)) {
|
||||
ToolbarHelper::cancel('phocamapsmarker.cancel', 'JTOOLBAR_CANCEL');
|
||||
}
|
||||
else {
|
||||
ToolbarHelper::cancel('phocamapsmarker.cancel', 'JTOOLBAR_CLOSE');
|
||||
}
|
||||
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocamaps', true );
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,140 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
$r = $this->r;
|
||||
$user = Factory::getUser();
|
||||
$userId = $user->get('id');
|
||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||
$canOrder = $user->authorise('core.edit.state', $this->t['o']);
|
||||
$saveOrder = $listOrder == 'a.ordering';
|
||||
$saveOrderingUrl = '';
|
||||
if ($saveOrder && !empty($this->items)) {
|
||||
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
|
||||
}
|
||||
$sortFields = $this->getSortFields();
|
||||
|
||||
echo $r->jsJorderTable($listOrder);
|
||||
|
||||
//echo '<div class="clearfix"></div>';
|
||||
|
||||
echo $r->startForm($this->t['o'], $this->t['tasks'], 'adminForm');
|
||||
//echo $r->startFilter();
|
||||
//echo $r->endFilter();
|
||||
|
||||
echo $r->startMainContainer();
|
||||
|
||||
if ($this->t['maps_api_key'] == '' && $this->t['map_type'] == 1) {
|
||||
echo '<div class="alert alert-error alert-danger">' . Text::_('COM_PHOCAMAPS_MAPS_API_KEY_NOT_SET') .'</div>';
|
||||
}
|
||||
/*
|
||||
echo $r->startFilterBar();
|
||||
echo $r->inputFilterSearch($this->t['l'].'_FILTER_SEARCH_LABEL', $this->t['l'].'_FILTER_SEARCH_DESC',
|
||||
$this->escape($this->state->get('filter.search')));
|
||||
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT', 'JSEARCH_FILTER_CLEAR');
|
||||
echo $r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC', $this->pagination->getLimitBox());
|
||||
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC', 'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING', $listDirn);
|
||||
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields, $listOrder);
|
||||
|
||||
echo $r->startFilterBar(2);
|
||||
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED', $this->state->get('filter.published'));
|
||||
echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE', $this->state->get('filter.language'));
|
||||
echo $r->selectFilterCategory(PhocaMapsSelectMap::options($this->t['o']), 'COM_PHOCAMAPS_SELECT_MAP', $this->state->get('filter.map_id'), 'filter_map_id');
|
||||
echo $r->endFilterBar();
|
||||
|
||||
|
||||
echo $r->endFilterBar();*/
|
||||
echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
|
||||
|
||||
echo $r->startTable('categoryList');
|
||||
|
||||
echo $r->startTblHeader();
|
||||
|
||||
echo $r->firstColumnHeader($listDirn, $listOrder);
|
||||
echo $r->secondColumnHeader($listDirn, $listOrder);
|
||||
/*
|
||||
echo $r->thOrdering('JGRID__HEADING_ORDERING', $listDirn, $listOrder);
|
||||
echo $r->thCheck('JGLOBAL_CHECK_ALL');*/
|
||||
echo '<th class="ph-title-short">'.HTMLHelper::_('searchtools.sort', $this->t['l'].'_TITLE', 'a.title', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-published">'.HTMLHelper::_('searchtools.sort', $this->t['l'].'_PUBLISHED', 'a.published', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-map">'.HTMLHelper::_('searchtools.sort', $this->t['l'].'_MAP', 'a.catid', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-language">'.HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-id">'.HTMLHelper::_('searchtools.sort', $this->t['l'].'_ID', 'a.id', $listDirn, $listOrder ).'</th>'."\n";
|
||||
|
||||
echo $r->endTblHeader();
|
||||
|
||||
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
|
||||
|
||||
$originalOrders = array();
|
||||
$parentsStr = "";
|
||||
$j = 0;
|
||||
|
||||
if (is_array($this->items)) {
|
||||
foreach ($this->items as $i => $item) {
|
||||
// if ($i >= (int)$this->pagination->limitstart && $j < (int)$this->pagination->limit) {
|
||||
$j++;
|
||||
|
||||
$urlEdit = 'index.php?option='.$this->t['o'].'&task='.$this->t['task'].'.edit&id=';
|
||||
$orderkey = array_search($item->id, $this->ordering[$item->catid]);
|
||||
$ordering = ($listOrder == 'a.ordering');
|
||||
$canCreate = $user->authorise('core.create', $this->t['o']);
|
||||
$canEdit = $user->authorise('core.edit', $this->t['o']);
|
||||
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out==$user->get('id') || $item->checked_out==0;
|
||||
$canChange = $user->authorise('core.edit.state', $this->t['o']) && $canCheckin;
|
||||
$linkEdit = Route::_( $urlEdit.(int) $item->id );
|
||||
|
||||
|
||||
/*$iD = $i % 2;
|
||||
echo "\n\n";
|
||||
//echo '<tr class="row'.$iD.'" sortable-group-id="'.$item->catid.'" item-id="'.$item->id.'" parents="'.$item->catid.'" level="0">'. "\n";
|
||||
echo '<tr class="row'.$iD.'" sortable-group-id="'.$item->catid.'" >'. "\n";
|
||||
echo $r->tdOrder($canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
echo $r->td(HtmlHelper::_('grid.id', $i, $item->id), "small ");*/
|
||||
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid : 0);
|
||||
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
$checkO = '';
|
||||
if ($item->checked_out) {
|
||||
$checkO .= HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, $this->t['tasks'].'.', $canCheckin);
|
||||
}
|
||||
if ($canCreate || $canEdit) {
|
||||
$checkO .= '<a href="'. Route::_($linkEdit).'">'. $this->escape($item->title).'</a>';
|
||||
} else {
|
||||
$checkO .= $this->escape($item->title);
|
||||
}
|
||||
$checkO .= ' <span class="smallsub">(<span>'.Text::_($this->t['l'].'_FIELD_ALIAS_LABEL').':</span>'. $this->escape($item->alias).')</span>';
|
||||
echo $r->td($checkO, "small");
|
||||
echo $r->td(HTMLHelper::_('jgrid.published', $item->published, $i, $this->t['tasks'].'.', $canChange), "small");
|
||||
|
||||
echo $r->td($this->escape($item->map_title), "small");
|
||||
|
||||
echo $r->tdLanguage($item->language, $item->language_title, $this->escape($item->language_title));
|
||||
echo $r->td($item->id, "small");
|
||||
|
||||
echo $r->endTr();
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
echo $r->endTblBody();
|
||||
|
||||
echo $r->tblFoot($this->pagination->getListFooter(), 8);
|
||||
echo $r->endTable();
|
||||
|
||||
echo $this->loadTemplate('batch');
|
||||
|
||||
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
|
||||
echo $r->endMainContainer();
|
||||
echo $r->endForm();
|
||||
?>
|
||||
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
|
||||
//$published = $this->state->get('filter.published');
|
||||
?>
|
||||
|
||||
<div id="collapseModal" role="dialog" tabindex="-1" class="joomla-modal modal fade">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title"><?php echo Text::_('COM_PHOCAMAPS_BATCH_OPTIONS_MARKERS');?></h3>
|
||||
<button type="button" class="btn-close novalidate" data-bs-dismiss="modal" aria-label="<?php Text::_('COM_PHOCAMAPS_CLOSE'); ?>">
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="p-3">
|
||||
<?php /*<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<div class="controls"><?php echo LayoutHelper::render('joomla.html.batch.access', []);?></div>
|
||||
</div>
|
||||
</div> */ ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<div class="controls"><?php echo LayoutHelper::render('joomla.html.batch.language', []); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<div class="controls"><?php echo PhocaMapsBatch::item('', 0); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class="btn" type="button" onclick="document.getElementById('batch-category-id').value='';document.getElementById('batch-access').value='';document.getElementById('batch-language-id').value=''" data-bs-dismiss="modal">
|
||||
<?php echo Text::_('JCANCEL'); ?>
|
||||
</button>
|
||||
<button class="btn btn-primary" type="submit" onclick="Joomla.submitbutton('<?php echo $this->t['task'] ?>.batch');" id="batch-submit-button-id" data-submit-task="<?php echo $this->t['task'] ?>.batch">
|
||||
<?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,120 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die();
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
|
||||
class PhocaMapsCpViewPhocaMapsMarkers extends HtmlView
|
||||
{
|
||||
protected $items;
|
||||
protected $pagination;
|
||||
protected $state;
|
||||
protected $t;
|
||||
protected $r;
|
||||
public $filterForm;
|
||||
public $activeFilters;
|
||||
|
||||
function display($tpl = null) {
|
||||
|
||||
$this->t = PhocaMapsUtils::setVars('marker');
|
||||
$this->r = new PhocaMapsRenderAdminviews();
|
||||
$this->items = $this->get('Items');
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
$this->filterForm = $this->get('FilterForm');
|
||||
$this->activeFilters = $this->get('ActiveFilters');
|
||||
|
||||
$paramsC = ComponentHelper::getParams('com_phocamaps');
|
||||
$this->t['maps_api_key'] = $paramsC->get( 'maps_api_key', '' );
|
||||
$this->t['map_type'] = $paramsC->get( 'map_type', 2 );
|
||||
//$this->t['load_api_ssl'] = $paramsC->get( 'load_api_ssl', 1 );
|
||||
|
||||
|
||||
|
||||
foreach ($this->items as &$item) {
|
||||
$this->ordering[$item->catid][] = $item->id;
|
||||
}
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors'))) {
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
|
||||
}
|
||||
|
||||
function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocamapsmarkers.php';
|
||||
|
||||
$state = $this->get('State');
|
||||
$canDo = PhocaMapsMarkersHelper::getActions($this->t, $state->get('filter.marker_id'));
|
||||
$user = Factory::getUser();
|
||||
$bar = Toolbar::getInstance('toolbar');
|
||||
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAMAPS_MARKERS' ), 'location' );
|
||||
|
||||
if ($canDo->get('core.create')) {
|
||||
ToolbarHelper::addNew('phocamapsmarker.add','JTOOLBAR_NEW');
|
||||
}
|
||||
|
||||
if ($canDo->get('core.edit')) {
|
||||
ToolbarHelper::editList('phocamapsmarker.edit','JTOOLBAR_EDIT');
|
||||
}
|
||||
if ($canDo->get('core.edit.state')) {
|
||||
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::custom('phocamapsmarkers.publish', 'publish.png', 'publish_f2.png','JTOOLBAR_PUBLISH', true);
|
||||
ToolbarHelper::custom('phocamapsmarkers.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
|
||||
}
|
||||
|
||||
if ($canDo->get('core.delete')) {
|
||||
ToolbarHelper::deleteList( 'COM_PHOCAMAPS_WARNING_DELETE_ITEMS', 'phocamapsmarkers.delete', 'COM_PHOCAMAPS_DELETE');
|
||||
}
|
||||
|
||||
// Add a batch button
|
||||
if ($user->authorise('core.edit'))
|
||||
{
|
||||
/*HTMLHelper::_('bootstrap.renderModal', 'collapseModal');
|
||||
$title = Text::_('JTOOLBAR_BATCH');
|
||||
$dhtml = "<button data-toggle=\"modal\" data-target=\"#collapseModal\" class=\"btn btn-small\">
|
||||
<i class=\"icon-checkbox-partial\" title=\"$title\"></i>
|
||||
$title</button>";
|
||||
$bar->appendButton('Custom', $dhtml, 'batch');*/
|
||||
$bar->popupButton('batch')
|
||||
->text('JTOOLBAR_BATCH')
|
||||
->selector('collapseModal')
|
||||
->listCheck(true);
|
||||
}
|
||||
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocamaps', true );
|
||||
}
|
||||
|
||||
protected function getSortFields() {
|
||||
return array(
|
||||
'a.ordering' => Text::_('JGRID_HEADING_ORDERING'),
|
||||
'a.title' => Text::_($this->t['l'] . '_TITLE'),
|
||||
'a.published' => Text::_($this->t['l'] . '_PUBLISHED'),
|
||||
'language' => Text::_('JGRID_HEADING_LANGUAGE'),
|
||||
'a.id' => Text::_('JGRID_HEADING_ID'),
|
||||
'a.catid' => Text::_($this->t['l'] . '_MAP')
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user