- md5
- 069055182c4874cce6de2977c24e775b
- sha1
- d202ba6a149bad80695eb29ba9de3a0f6322f783
- sha256
- f57d481e990a39932f7189a79f523169e8b2e1b2fb1b28813b01407d65fe4318
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
<?php
/**
* @version $Id: moduleposition.php 20196 2011-01-09 02:40:25Z ian $
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_BASE') or die;
jimport('joomla.form.formfield');
JFormHelper::loadFieldClass('text');
/**
* Supports a modal article picker.
*
* @package Joomla.Administrator
* @subpackage com_content
* @since 1.6
*/
class JFormFieldModulePosition extends JFormFieldText
{
/**
* The form field type.
*
* @var string
* @since 1.6
*/
protected $type = 'ModulePosition';
/**
* Method to get the field input markup.
*
* @return string The field input markup.
* @since 1.6
*/
protected function getInput()
{
// Get the client id.
$clientId = $this->element['client_id'];
if (!isset($clientId))
{
$clientName = $this->element['client'];
if (isset($clientName))
{
$client = JApplicationHelper::getClientInfo($clientName, true);
$clientId = $client->id;
}
}
if (!isset($clientId) && $this->form instanceof JForm) {
$clientId = $this->form->getValue('client_id');
}
$clientId = (int) $clientId;
// Load the modal behavior script.
JHtml::_('behavior.modal', 'a.modal');
// Build the script.
$script = array();
$script[] = ' function jSelectPosition_'.$this->id.'(name) {';
$script[] = ' document.id("'.$this->id.'").value = name;';
$script[] = ' SqueezeBox.close();';
$script[] = ' }';
// Add the script to the document head.
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
// Setup variables for display.
$html = array();
$link = 'index.php?option=com_modules&view=positions&layout=modal&tmpl=component&function=jSelectPosition_'.$this->id.'&client_id='.$clientId;
// The current user display field.
$html[] = '<div class="fltlft">';
$html[] = parent::getInput();
$html[] = '</div>';
// The user select button.
$html[] = '<div class="button2-left">';
$html[] = ' <div class="blank">';
$html[] = ' <a class="modal" title="'.JText::_('COM_MODULES_CHANGE_POSITION_TITLE').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 800, y: 450}}">'.JText::_('COM_MODULES_CHANGE_POSITION_BUTTON').'</a>';
$html[] = ' </div>';
$html[] = '</div>';
return implode("\n", $html);
}
}
The same content is in 2 releases, Joomla 1.6.0 to 1.6.1. See them all, or every version of this file.