Source for file prefix.php
Documentation is available at prefix.php
* @package Joomla.Installation
* @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 Framework.
* @package Joomla.Installation
protected $type =
'Prefix';
* Method to get the field input markup.
* @return string The field input markup.
// Initialize some field attributes.
$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"' :
'';
// Make sure somebody doesn't put in a too large prefix size value:
// If a prefix is already set, use it instead
if (empty($session['db_prefix']))
// Create the random prefix:
$chars =
range('a', 'z');
// We want the fist character to be a random letter:
// Next we combine the numbers and characters to get the other characters:
for ($i =
0, $j =
$size -
1; $i <
$j; ++
$i)
// Add in the underscore:
$prefix =
$session['db_prefix'];
// Initialize JavaScript field attributes.
$onchange =
$this->element['onchange'] ?
' onchange="' . (string)
$this->element['onchange'] .
'"' :
'';
return '<input type="text" name="' .
$this->name .
'" id="' .
$this->id .
'"' .
$class .
$disabled .
$readonly .
$onchange .
$maxLength .
'/>';
Documentation generated on Tue, 19 Nov 2013 15:11:12 +0100 by phpDocumentor 1.4.3