primo commit

This commit is contained in:
2024-12-17 17:34:10 +01:00
commit e650f8df99
16435 changed files with 2451012 additions and 0 deletions

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,57 @@
<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later;
*/
defined('JPATH_BASE') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormField;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
jimport('joomla.html.html');
jimport('joomla.form.formfield');
class JFormFieldPhocaHead extends FormField
{
protected $type = 'PhocaHead';
protected function getLabel() { return '';}
protected function getInput() {
$app = Factory::getApplication();
$wa = $app->getDocument()->getWebAssetManager();
$option = 'com_phocamaps';
$wa->registerAndUseStyle($option . '.options', 'media/' .$option . '/css/administrator/phocamapsoptions.css', array('version' => 'auto'));
$wa->registerAndUseStyle($option . '.theme', 'media/' .$option . '/css/administrator/theme-dark.css', array('version' => 'auto'), [], ['template.active']);
//echo '<div style="clear:both;"></div>';
$phocaImage = ( (string)$this->element['phocaimage'] ? $this->element['phocaimage'] : '' );
$image = '';
if ($phocaImage != ''){
$image = HTMLHelper::_('image', 'media/com_phocagallery/images/administrator/'. $phocaImage, '' );
}
if ($this->element['default']) {
if ($image != '') {
return '<div class="ph-options-head">'
.'<div>'. $image.' <strong>'. Text::_($this->element['default']) . '</strong></div>'
.'</div>';
} else {
return '<div class="ph-options-head">'
.'<strong>'. Text::_($this->element['default']) . '</strong>'
.'</div>';
}
} else {
return parent::getLabel();
}
//echo '<div style="clear:both;"></div>';
}
}
?>

View File

@ -0,0 +1,47 @@
<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later;
*/
defined('_JEXEC') or die();
use Joomla\CMS\Form\FormField;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
class JFormFieldPhocaMapsMap extends FormField
{
protected $type = 'PhocaMapsMap';
protected function getInput() {
$db = Factory::getDBO();
$query = 'SELECT a.title AS text, a.id AS value'
. ' FROM #__phocamaps_map AS a'
. ' WHERE a.published = 1'
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$items = $db->loadObjectList();
$attr = '';
$attr .= $this->required ? ' required aria-required="true"' : '';
$attr .= $this->element['onchange'] ? ' onchange="'.(string) $this->element['onchange'].'"' : '';
$attr .= $this->element['class'] ? ' class="'.(string) $this->element['class'].'"' : 'class="form-select"';
array_unshift($items, HTMLHelper::_('select.option', '', '- '.Text::_('COM_PHOCAMAPS_SELECT_MAP').' -', 'value', 'text'));
return HTMLHelper::_('select.genericlist', $items, $this->name, trim($attr), 'value', 'text', $this->value, $this->id );
}
}
?>

View File

@ -0,0 +1,90 @@
<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later;
*/
defined('JPATH_BASE') or die;
use Joomla\CMS\Form\FormField;
use Joomla\CMS\HTML\HTMLHelper;
jimport('joomla.html.html');
jimport('joomla.form.formfield');
class JFormFieldPhocaMapsOrdering extends FormField
{
protected $type = 'PhocaMapsOrdering';
protected function getInput() {
// Initialize variables.
$html = array();
$attr = '';
// Get some field values from the form.
$id = (int) $this->form->getValue('id');
if ($this->element['table']) {
switch (strtolower($this->element['table'])) {
case "marker":
$whereLabel = 'catid';
$whereValue = (int) $this->form->getValue('catid');
$table = '#__phocamaps_marker';
break;
default:
case "map":
$whereLabel = '';
$whereValue = '';
$table = '#__phocamaps_map';
break;
case "icon":
$whereLabel = '';
$whereValue = '';
$table = '#__phocamaps_icon';
break;
}
} else {
$whereLabel = '';
$whereValue = '';
$table = '#__phocamaps_map';
}
// Initialize some field attributes.
$attr .= $this->element['class'] ? ' class="'.(string) $this->element['class'].'"' : '';
$attr .= ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
$attr .= $this->element['size'] ? ' size="'.(int) $this->element['size'].'"' : '';
// Initialize JavaScript field attributes.
$attr .= $this->element['onchange'] ? ' onchange="'.(string) $this->element['onchange'].'"' : '';
// Build the query for the ordering list.
$query = 'SELECT ordering AS value, title AS text' .
' FROM ' . $table;
if ($whereLabel != '' && $whereValue != '') {
$query .= ' WHERE '.$whereLabel.' = ' . (int) $whereValue;
}
$query .= ' ORDER BY ordering';
// Create a read-only list (no name) with a hidden input to store the value.
if ((string) $this->element['readonly'] == 'true') {
$html[] = HTMLHelper::_('list.ordering', '', $query, trim($attr), $this->value, $id ? 0 : 1);
$html[] = '<input type="hidden" name="'.$this->name.'" value="'.$this->value.'"/>';
}
// Create a regular list.
else {
$html[] = HTMLHelper::_('list.ordering', $this->name, $query, trim($attr), $this->value, $id ? 0 : 1);
}
return implode($html);
}
}

View File

@ -0,0 +1,186 @@
<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later;
*/
defined('JPATH_BASE') or die;
use Joomla\CMS\Form\FormField;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\HTML\HTMLHelper;
jimport('joomla.html.html');
jimport('joomla.form.formfield');
class JFormFieldPhocaMapsRadio extends FormField
{
protected $type = 'PhocaMapsRadio';
protected function getInput()
{
// Initialize variables.
$html = array();
// Initialize some field attributes.
$class = $this->element['class'] ? ' class="radio '.(string) $this->element['class'].'"' : ' class="radio"';
// Start the radio field output.
$html[] = '<fieldset id="'.$this->id.'"'.$class.'>';
$design = ( (string)$this->element['typedesign'] ? $this->element['typedesign'] : 0 );
if ($design == 1) {
$options = $this->getOptionsDesign1();
}
if ($design == 2) {
$options = $this->getOptionsDesign2();
}
//$output .= '<input class="text_area" type="radio" name="'.$this->name.'" id="'.$this->id.'_id" value="'.(string) $option['value'].'" '.$checked.' />';
// Build the radio field output.
foreach ($options as $i => $option) {
// Initialize some option attributes.
$checked = ((string) $option->value == (string) $this->value) ? ' checked="checked"' : '';
$class = !empty($option->class) ? ' class="'.$option->class.'"' : '';
$disabled = !empty($option->disable) ? ' disabled="disabled"' : '';
// Initialize some JavaScript option attributes.
$onclick = !empty($option->onclick) ? ' onclick="'.$option->onclick.'"' : '';
$html[] = '<div class="form-check"><input class="form-check-input" type="radio" id="'.$this->id.$i.'" name="'.$this->name.'"' .
' value="'.htmlspecialchars($option->value, ENT_COMPAT, 'UTF-8').'"'
.$checked.$class.$onclick.$disabled.'/>';
$html[] = '<label class="form-check-label" for="'.$this->id.$i.'">'. Text::_($option->text). ' '.$option->img.'</label>';
$html[] = '</div>';
/*if ($design == 1) {
$html[] = '<label for="'.$this->id.$i.'"'.$class.' style="width:auto">'. Text::_($option->text). '</label>'
. '<div style="position:relative;float:left;width:30px;margin-left:5px">'.$option->img.'</div><div style="clear:both"></div>';
}
if ($design == 2) {
if($option->imgnr % 3 == 0) {
$cssPart = '';
$htmlPart = '<div style="clear:both"></div>';
} else {
$cssPart ='margin-right:10px;';
$htmlPart = '<div style="clear:both"></div>';
}
$html[] = '<label for="'.$this->id.$i.'" '.$class.' style="width:auto">'. Text::_($option->text). '</label>'
. '<div style="position:relative;float:left;margin:0px;padding:0px;margin-left:5em;margin-top: -2em;'.$cssPart.'">'.$option->img.'</div></div>'. $htmlPart;
}*/
}
// End the radio field output.
$html[] = '</fieldset>';
return implode($html);
}
protected function getOptionsDesign1()
{
$options = array();
foreach ($this->element->children() as $option) {
$tmp = new CMSObject();
if ($option->getName() != 'option') {
continue;
}
$tmp->value = (string) $option['value'];
$tmp->text = trim((string) $option);
switch((int)$option['value']) {
case 1: $optName = 'grey'; break;
case 2: $optName = 'grey'; break;//$optName = 'greywb';the same but other padding
case 3: $optName = 'greyrc'; break;
case 4: $optName = 'black'; break;
default:
case 0: $optName = 'none'; break;
}
if ((int)$option['value'] == 0) {
$tmp->img = '';
} else {
$tmp->img = HTMLHelper::_('image', 'components/com_phocamaps/assets/images/box-'.$optName.'-tl.png', '', array('style' => 'margin:0;padding:0'));
}
//$tmp->class = (string) $option['class'];
//$tmp->onclick = (string) $option['onclick'];
$options[] = $tmp;
}
reset($options);
return $options;
}
protected function getOptionsDesign2()
{
$options = array();
$i = 1;
foreach ($this->element->children() as $option) {
$tmp = new CMSObject();
if ($option->getName() != 'option') {
continue;
}
$tmp->value = (string) $option['value'];
$tmp->text = trim((string) $option);
switch((int)$option['value']) {
case 1: $optName = 'igrey'; break;
case 2: $optName = 'iyellow'; break;
case 3: $optName = 'ihome'; break;
case 4: $optName = 'igreen'; break;
case 5: $optName = 'istar'; break;
case 6: $optName = 'iinfoh'; break;
case 7: $optName = 'iinfoi'; break;
case 8: $optName = 'iinfop'; break;
case 9: $optName = 'iinfoph'; break;
case 10:$optName = 'iinfoz'; break;
default:
case 0: $optName = 'default'; break;
}
if ((int)$option['value'] == 0) {
$tmp->img = '';
$tmp->imgnr = 0;
} else {
$tmp->img = HTMLHelper::_('image', 'media/com_phocamaps/images/'.$optName.'/image.png', '', array('style' => 'margin:0;padding:0'));
$tmp->imgnr = $i;
$i++;
}
//$tmp->class = (string) $option['class'];
//$tmp->onclick = (string) $option['onclick'];
$options[] = $tmp;
}
reset($options);
return $options;
}
}

View File

@ -0,0 +1,40 @@
<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later;
*/
defined('JPATH_BASE') or die;
use Joomla\CMS\Form\FormField;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
jimport('joomla.form.formfield');
class JFormFieldPhocaSelectIcon extends FormField
{
public $type = 'PhocaSelectIcon';
protected function getInput() {
$db = Factory::getDBO();
$query = 'SELECT a.title AS text, a.id AS value'
. ' FROM #__phocamaps_icon AS a'
. ' WHERE a.published = 1'
. ' ORDER BY a.ordering';
$db->setQuery( $query );
$items = $db->loadObjectList();
array_unshift($items, HTMLHelper::_('select.option', '', '- '.Text::_('COM_PHOCAMAPS_SELECT_ICON').' -', 'value', 'text'));
return HTMLHelper::_('select.genericlist', $items, $this->name, 'class="form-select"', 'value', 'text', $this->value, $this->id );
}
}
?>

View File

@ -0,0 +1,134 @@
<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later;
*/
defined('JPATH_BASE') or die;
use Joomla\CMS\Form\FormField;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
jimport('joomla.form.formfield');
class JFormFieldPhocaSelectMap extends FormField
{
public $type = 'PhocaSelectMap';
protected function getInput()
{
// Initialize variables.
$html = array();
// Initialize some field attributes.
$size = $this->element['size'] ? ' size="'.(int) $this->element['size'].'"' : '';
$maxLength = $this->element['maxlength'] ? ' maxlength="'.(int) $this->element['maxlength'].'"' : '';
$class = $this->element['class'] ? ' class="'.(string) $this->element['class'].'"' : '';
$readonly = ((string) $this->element['readonly'] == 'true') ? ' readonly="readonly"' : '';
$disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
$maptype = ( (string)$this->element['maptype'] ? $this->element['maptype'] : '' );
if ($this->id == 'jform_latitude') {
// One link for latitude, longitude, zoom
$lat = $this->form->getValue('latitude');
$lng = $this->form->getValue('longitude');
$zoom = $this->form->getValue('zoom');
$suffix = '';
if ($lat != '') { $suffix .= '&amp;lat='.$lat;}
if ($lng != '') { $suffix .= '&amp;lng='.$lng;}
if ($zoom != '' && (int)$zoom > 0) { $suffix .= '&amp;zoom='.$zoom;}
if ($maptype != '') { $suffix .= '&amp;type='.$maptype;}
$link = 'index.php?option=com_phocamaps&amp;view=phocamapsgmap&amp;tmpl=component&amp;field='.$this->id. $suffix;
// Load the modal behavior script.
//HTMLHelper::_('behavior.modal', 'a.modal_'.$this->id);
}
HTMLHelper::_('jquery.framework');
// Initialize JavaScript field attributes.
$onchange = (string) $this->element['onchange'];
$onchangeOutput = ' onChange="'.(string) $this->element['onchange'].'"';
$idA = 'pgselectmap';
// Build the script.
$script = array();
$script[] = ' function phocaSelectMap_'.$this->id.'(title) {';
$script[] = ' document.getElementById("'.$this->id.'_id").value = title;';
$script[] = ' '.$onchange;
// BE AWARE don't close the window here, we are waiting for close button, not immediately closing
//$script[] = ' jQuery(\'#'.$idA.'\').modal(\'toggle\');';
//$script[] = ' SqueezeBox.close();';
$script[] = ' }';
// Hide Info box on start
if ($this->id == 'jform_latitude') {
$script[] = ' jQuery(document).ready(function() {';
$script[] = ' jQuery(\'#'.$idA.'\').on(\'shown.bs.modal\', function () {';
$script[] = ' jQuery(\'#phmPopupInfo\').html(\'\');';
$script[] = ' })';
$script[] = ' })';
}
// Add the script to the document head.
Factory::getDocument()->addScriptDeclaration(implode("\n", $script));
if ($this->id == 'jform_latitude') {
/*$html[] = '<div class="input-append">';
$html[] = '<input type="text" id="'.$this->id.'_id" name="'.$this->name.'" value="'. $this->value.'"' .
' '.$class.$size.$disabled.$readonly.$onchangeOutput.$maxLength.' />';
$html[] = '<a class="modal_'.$this->id.' btn" title="'.Text::_('COM_PHOCAMAPS_FORM_SELECT_COORDINATES').'"'
.' href="'.($this->element['readonly'] ? '' : $link).'"'
.' rel="{handler: \'iframe\', size: {x: 780, y: 580}}">'
. Text::_('COM_PHOCAMAPS_FORM_SELECT_COORDINATES').'</a>';
$html[] = '</div>'. "\n";*/
$html[] = '<div class="input-append input-group">';
$html[] = '<span class="input-append input-group"><input type="text" id="' . $this->id . '_id" name="' . $this->name . '"'
. ' value="' . $this->value . '" '.$class.$size.$disabled.$readonly.$onchangeOutput.$maxLength.' />';
$html[] = '<a href="'.$link.'" role="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#'.$idA.'" title="' . Text::_('COM_PHOCAMAPS_FORM_SELECT_COORDINATES') . '">'
. '<span class="icon-list icon-white"></span> '
. Text::_('COM_PHOCAMAPS_FORM_SELECT_COORDINATES') . '</a></span>';
$html[] = '</div>'. "\n";
$html[] = HTMLHelper::_(
'bootstrap.renderModal',
$idA,
array(
'url' => $link,
'title' => Text::_('COM_PHOCAMAPS_FORM_SELECT_COORDINATES'),
'width' => '',
'height' => '',
'modalWidth' => '80',
'bodyHeight' => '80',
'footer' => '<div id="phmPopupInfo" class="ph-info-modal"></div><button type="button" class="btn" data-bs-dismiss="modal" aria-hidden="true">'
. Text::_('COM_PHOCAMAPS_CLOSE') . '</button>'
)
);
} else {
$html[] = '<div class="fltlft">';
$html[] = ' <input type="text" id="'.$this->id.'_id" name="'.$this->name.'" value="'. $this->value.'"' .
' '.$class.$size.$disabled.$readonly.$onchangeOutput.$maxLength.' />';
$html[] = '</div>'. "\n";
}
return implode("\n", $html);
}
}

View File

@ -0,0 +1,57 @@
<?php
/*
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @component Phoca Component
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later;
*/
defined('JPATH_BASE') or die;
use Joomla\CMS\Form\FormField;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
jimport('joomla.form.formfield');
class JFormFieldPhocaTextWarning extends FormField
{
protected $type = 'PhocaTextWarning';
protected function getInput() {
// Initialize some field attributes.
$warning = ( (string)$this->element['warningtext'] ? $this->element['warningtext'] : '' );
$size = $this->element['size'] ? ' size="'.(int) $this->element['size'].'"' : '';
$class = $this->element['class'] ? ' class="'.(string) $this->element['class'].'"' : '';
$maxLength = $this->element['maxlength'] ? ' maxlength="'.(int) $this->element['maxlength'].'"' : '';
$readonly = ((string) $this->element['readonly'] == 'true') ? ' readonly="readonly"' : '';
$disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
// Initialize JavaScript field attributes.
$onchange = $this->element['onchange'] ? ' onchange="'.(string) $this->element['onchange'].'"' : '';
$value = htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8');
$html ='<input type="text" name="'.$this->name.'" id="'.$this->id.'" value="'.$value.'"'
.$class.$size.$disabled.$readonly.$onchange.$maxLength.'/>';
if ($warning != '') {
//$html .= '<div style="margin-left:10px;">'.HtmlHelper::_('image', 'administrator/components/com_phocamaps/assets/images/icon-16-warning.png', '' ) . '</div><div>' . JText::_($warning).'</div>';
$html .='<div style="position:relative;float:left;width:auto;margin-left:10px">'.HTMLHelper::_('image', 'administrator/components/com_phocamaps/assets/images/icon-16-warning.png', '',array('style' => 'margin:0;padding:0;margin-right:5px;') ).' '.Text::_($warning).'</div><div style="clear:both"></div>';
}
return $html;
}
protected function getLabel() {
echo '<div class="clearfix"></div>';
return parent::getLabel();
echo '<div class="clearfix"></div>';
}
}
?>