Source for file fieldsearchable.php
Documentation is available at fieldsearchable.php
* @package FrameworkOnFramework
* @copyright Copyright (C) 2010 - 2012 Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
// Protect from unauthorized access
* Generic field header, with text input (search) filter
* @package FrameworkOnFramework
* @return string The HTML
// Initialize some field attributes.
$size =
$this->element['size'] ?
' size="' . (int)
$this->element['size'] .
'"' :
'';
$maxLength =
$this->element['maxlength'] ?
' maxlength="' . (int)
$this->element['maxlength'] .
'"' :
'';
$filterclass =
$this->element['filterclass'] ?
' class="' . (string)
$this->element['filterclass'] .
'"' :
'';
$name =
$this->element['searchfieldname'] ?
$this->element['searchfieldname'] :
$this->name;
$placeholder =
'placeholder="' .
JText::_($placeholder) .
'"';
if ($this->element['searchfieldname'])
$model =
$this->form->getModel();
$searchvalue =
$model->getState((string)
$this->element['searchfieldname']);
$searchvalue =
$this->value;
// Initialize JavaScript field attributes.
$onchange =
' onchange="' . (string)
$this->element['onchange'] .
'"';
$onchange =
' onchange="document.adminForm.submit();"';
return '<input type="text" name="' .
$name .
'" id="' .
$this->id .
'"' .
' value="'
.
htmlspecialchars($searchvalue, ENT_COMPAT, 'UTF-8') .
'"' .
$filterclass .
$size .
$placeholder .
$onchange .
$maxLength .
'/>';
* Get the buttons HTML code
* @return string The HTML
$buttonclass =
$this->element['buttonclass'] ? (string)
$this->element['buttonclass'] :
'btn hasTip hasTooltip';
$show_buttons =
!in_array($buttonsState, array('no', 'false', '0'));
$html .=
'<button class="' .
$buttonclass .
'" onclick="this.form.submit();" title="' .
JText::_('JSEARCH_FILTER') .
'" >' .
"\n";
$html .=
'<i class="icon-search"></i>';
$html .=
'</button>' .
"\n";
$html .=
'<button class="' .
$buttonclass .
'" onclick="document.adminForm.' .
$this->id .
'.value=\'\';this.form.submit();" title="' .
JText::_('JSEARCH_RESET') .
'">' .
"\n";
$html .=
'<i class="icon-remove"></i>';
$html .=
'</button>' .
"\n";
Documentation generated on Tue, 19 Nov 2013 15:02:59 +0100 by phpDocumentor 1.4.3