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 JFormFieldPhocaSelectYtb extends JFormField
{
public $type = 'PhocaSelectYtb';
protected function getInput()
{
// Initialize variables.
$html = array();
$suffix = '';
$catid = $this->form->getValue('catid');
if ((int)$catid > 0) {
$suffix .= '&catid='.$catid;
} else {
$suffix .= '&catid=0';
}
$link = 'index.php?option=com_phocagallery&view=phocagalleryytb&tmpl=component&field='.$this->id.$suffix;
// Initialize some field attributes.
$class = $this->element['class'] ? ' class="'.(string) $this->element['class'].'"' : '';
$disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
$columns = $this->element['cols'] ? ' cols="'.(int) $this->element['cols'].'"' : '';
$rows = $this->element['rows'] ? ' rows="'.(int) $this->element['rows'].'"' : '';
//$required = ($v = $this->element['required']) ? ' required="required"' : '';
// Initialize JavaScript field attributes.
$onchange = (string) $this->element['onchange'];
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework');
$idA = 'pgselectytb';
// Build the script.
$script = array();
$script[] = ' function phocaSelectYtb_'.$this->id.'(link, title, desc, filename) {';
$script[] = ' document.getElementById("'.$this->id.'").value = link;';
$script[] = ' document.getElementById("jform_title").value = title;';
$script[] = ' document.getElementById("jform_description").value = desc;';
$script[] = ' document.getElementById("jform_filename").value = filename;';
$script[] = ' '.$onchange;
//$script[] = ' SqueezeBox.close();';
$script[] = ' jQuery(\'#'.$idA.'\').modal(\'toggle\');';
$script[] = ' }';
// Add the script to the document head.
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
/*
$html[] = '<div class="fltlft">';
$html[] = '<textarea name="'.$this->name.'" id="'.$this->id.'"' .
$columns.$rows.$class.$disabled.$onchange.'>' .
htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') .
'</textarea>';
$html[] = '</div>';
// Create the user select button.
$html[] = '<div class="button2-left">';
$html[] = ' <div class="blank">';
$html[] = ' <a id="pgselectytb" class="modal_'.$this->id.'" title="'.JText::_('COM_PHOCAGALLERY_FORM_SELECT_YTB').'"' .
' href="'.($this->element['readonly'] ? '' : $link).'"' .
' rel="{handler: \'iframe\', size: {x: 650, y: 375}}">';
$html[] = ' '.JText::_('COM_PHOCAGALLERY_FORM_SELECT_YTB').'</a>';
$html[] = ' </div>';
$html[] = '</div>';*/
$html[] = '<div class="input-append">';
$html[] = '<textarea name="'.$this->name.'" id="'.$this->id.'"' .
$columns.$rows.$class.$disabled.$onchange.'>' .
htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') .
'</textarea>';
//$html[] = '<a id="pgselectytb" class="modal_'.$this->id.' btn" title="'.JText::_('COM_PHOCAGALLERY_FORM_SELECT_YTB').'"'
// .' href="'.($this->element['readonly'] ? '' : $link).'"'
// .' rel="{handler: \'iframe\', size: {x: 650, y: 400}}">'
// . JText::_('COM_PHOCAGALLERY_FORM_SELECT_YTB').'</a>';
//$html[] = '<span class="input-append"><input type="text" ' . $required . ' id="' . $this->id . '" name="' . $this->name . '"'
// . ' value="' . $this->value . '"' . $size . $class . ' />';
$html[] = '<a href="#'.$idA.'" role="button" class="btn " data-toggle="modal" title="' . JText::_('COM_PHOCAGALLERY_FORM_SELECT_YTB') . '">'
. '<span class="icon-list icon-white"></span> '
. JText::_('COM_PHOCAGALLERY_FORM_SELECT_YTB') . '</a></span>';
$html[] = '</div>'. "\n";
$html[] = Joomla\CMS\HTML\HTMLHelper::_(
'bootstrap.renderModal',
$idA,
array(
'url' => $link,
'title' => JText::_('COM_PHOCAGALLERY_FORM_SELECT_YTB'),
'width' => '700px',
'height' => '400px',
'modalWidth' => '80',
'bodyHeight' => '70',
'footer' => '<button type="button" class="btn" data-dismiss="modal" aria-hidden="true">'
. JText::_('COM_PHOCAGALLERY_CLOSE') . '</button>'
)
);
return implode("\n", $html);
}
}