Server : LiteSpeed System : Linux server 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 User : alsaif ( 1057) PHP Version : 7.4.33 Disable Function : show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/alsaif/public_html/administrator/components/com_phocagallery/models/fields/ |
<?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;
jimport('joomla.form.formfield');
class JFormFieldPhocaSelectMap extends JFormField
{
public $type = 'PhocaSelectMap';
protected function getInput()
{
// Initialize variables.
$html = array();
// Initialize some field attributes.
$attr = $this->element['class'] ? ' class="'.(string) $this->element['class'].'"' : '';
$attr .= $this->element['size'] ? ' size="'.(int) $this->element['size'].'"' : '';
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 .= '&lat='.$lat;}
if ($lng != '') { $suffix .= '&lng='.$lng;}
if ($zoom != '') { $suffix .= '&zoom='.$zoom;}
$link = 'index.php?option=com_phocagallery&view=phocagalleryg&tmpl=component&field='.$this->id. $suffix;
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework');
}
$idA = 'pgselectmap';
// Initialize JavaScript field attributes.
$onchange = (string) $this->element['onchange'];
/* // Build the script.
$script = array();
$script[] = ' function phocaSelectMap_'.$this->id.'(title) {';
$script[] = ' document.getElementById("'.$this->id.'_id").value = title;';
$script[] = ' '.$onchange;
//$script[] = ' SqueezeBox.close();';
$script[] = ' }';*/
// Build the script.
$script = array();
$script[] = ' function phocaSelectMap_'.$this->id.'(title) {';
$script[] = ' document.getElementById("'.$this->id.'").value = title;';
$script[] = ' '.$onchange;
//$script[] = ' SqueezeBox.close();';
//$script[] = ' jQuery(\'#'.$idA.'\').modal(\'toggle\');';
$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.
JFactory::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.'"' . ' '.$attr.' />';
$html[] = '<a class="modal_'.$this->id.' btn" title="'.JText::_('COM_PHOCAGALLERY_FORM_SELECT_COORDINATES').'"'
.' href="'.($this->element['readonly'] ? '' : $link).'"'
.' rel="{handler: \'iframe\', size: {x: 560, y: 470}}">'
. JText::_('COM_PHOCAGALLERY_FORM_SELECT_COORDINATES').'</a>';
$html[] = '</div>'. "\n";*/
$html[] = '<div class="input-append">';
$html[] = '<span class="input-append"><input type="text" id="' . $this->id . '" name="' . $this->name . '"'
. ' value="' . $this->value . '"' . $attr . ' />';
$html[] = '<a href="#'.$idA.'" role="button" class="btn " data-toggle="modal" title="' . JText::_('COM_PHOCAGALLERY_FORM_SELECT_COORDINATES') . '">'
. '<span class="icon-list icon-white"></span> '
. JText::_('COM_PHOCAGALLERY_FORM_SELECT_COORDINATES') . '</a></span>';
$html[] = '</div>'. "\n";
$html[] = Joomla\CMS\HTML\HTMLHelper::_(
'bootstrap.renderModal',
$idA,
array(
'url' => $link,
'title' => JText::_('COM_PHOCAGALLERY_FORM_SELECT_COORDINATES'),
'width' => '560px',
'height' => '470px',
'modalWidth' => '50',
'bodyHeight' => '70',
'footer' => '<div id="phmPopupInfo" class="ph-info-modal"></div><button type="button" class="btn" data-dismiss="modal" aria-hidden="true">'
. JText::_('COM_PHOCAGALLERY_CLOSE') . '</button>'
)
);
} else {
$html[] = '<input type="text" id="'.$this->id.'" name="'.$this->name.'" value="'. $this->value.'"' . ' '.$attr.' />';
}
return implode("\n", $html);
}
}