Source for file moduleorder.php
Documentation is available at moduleorder.php
* @package Joomla.Libraries
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* Form Field class for the Joomla! CMS.
* @package Joomla.Libraries
protected $type =
'ModuleOrder';
* Method to get the field input markup.
* @return string The field input markup.
// Initialize some field attributes.
$attr .=
!empty($this->class) ?
' class="' .
$this->class .
'"' :
'';
$attr .=
$this->disabled ?
' disabled' :
'';
$attr .=
!empty($this->size) ?
' size="' .
$this->size .
'"' :
'';
// Initialize JavaScript field attributes.
$html[] =
'<script type="text/javascript">';
$ordering =
$this->form->getValue('ordering');
$position =
$this->form->getValue('position');
$clientId =
$this->form->getValue('client_id');
$html[] =
'var originalOrder = "' .
$ordering .
'";';
$html[] =
'var originalPos = "' .
$position .
'";';
$html[] =
'var orders = new Array();';
$query =
$db->getQuery(true)
->select('position, ordering, title')
->where('client_id = ' . (int)
$clientId)
$orders =
$db->loadObjectList();
catch
(RuntimeException $e)
for ($i =
0, $n =
count($orders); $i <
$n; $i++
)
if (!isset
($orders2[$orders[$i]->position]))
$orders2[$orders[$i]->position] =
0;
$orders2[$orders[$i]->position]++
;
$ord =
$orders2[$orders[$i]->position];
$html[] =
'orders[' .
$i .
'] = new Array("' .
$orders[$i]->position .
'","' .
$ord .
'","' .
$title .
'");';
$html[] =
'writeDynaList(\'name="' .
$this->name .
'" id="' .
$this->id .
'"' .
$attr .
'\', orders, originalPos, originalPos, originalOrder);';
Documentation generated on Tue, 19 Nov 2013 15:08:49 +0100 by phpDocumentor 1.4.3