Файловый менеджер - Редактировать - /home/wuectly/www/03cbe/text.php.tar
Назад
home/wuectly/www/libraries/regularlabs/fields/text.php 0000604 00000003677 15245607114 0017254 0 ustar 00 <?php /** * @package Regular Labs Library * @version 21.4.10972 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2021 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ defined('_JEXEC') or die; use Joomla\CMS\Language\Text as JText; use RegularLabs\Library\StringHelper as RL_String; if ( ! is_file(JPATH_LIBRARIES . '/regularlabs/autoload.php')) { return; } require_once JPATH_LIBRARIES . '/regularlabs/autoload.php'; JFormHelper::loadFieldClass('text'); class JFormFieldRL_Text extends JFormFieldText { public $type = 'Text'; public function setup(SimpleXMLElement $element, $value, $group = null) { $this->element = $element; $element['label'] = $this->prepareText($element['label']); $element['description'] = $this->prepareText($element['description']); $element['hint'] = $this->prepareText($element['hint']); $element['translateDescription'] = false; return parent::setup($element, $value, $group); } private function prepareText($string = '') { $string = trim($string); if ($string == '') { return ''; } // variables $var1 = JText::_($this->get('var1')); $var2 = JText::_($this->get('var2')); $var3 = JText::_($this->get('var3')); $var4 = JText::_($this->get('var4')); $var5 = JText::_($this->get('var5')); $string = JText::sprintf(JText::_($string), $var1, $var2, $var3, $var4, $var5); $string = trim(RL_String::html_entity_decoder($string)); $string = str_replace('"', '"', $string); $string = str_replace('span style="font-family:monospace;"', 'span class="rl_code"', $string); return $string; } private function get($val, $default = '') { if ( ! isset($this->params[$val]) || (string) $this->params[$val] == '') { return $default; } return (string) $this->params[$val]; } } home/wuectly/www/plugins/fields/text/text.php 0000604 00000000670 15245611477 0015437 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Fields.Text * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JLoader::import('components.com_fields.libraries.fieldsplugin', JPATH_ADMINISTRATOR); /** * Fields Text Plugin * * @since 3.7.0 */ class PlgFieldsText extends FieldsPlugin { } home/wuectly/www/plugins/fields/text/tmpl/text.php 0000604 00000000622 15245613321 0016376 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Fields.Text * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $value = $field->value; if ($value == '') { return; } if (is_array($value)) { $value = implode(', ', $value); } echo htmlentities($value); home/wuectly/www/libraries/regularlabs/helpers/text.php 0000604 00000011417 15245617064 0017444 0 ustar 00 <?php /** * @package Regular Labs Library * @version 21.4.10972 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2021 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ /* @DEPRECATED */ defined('_JEXEC') or die; use RegularLabs\Library\Alias as RL_Alias; use RegularLabs\Library\ArrayHelper as RL_Array; use RegularLabs\Library\Date as RL_Date; use RegularLabs\Library\Form as RL_Form; use RegularLabs\Library\Html as RL_Html; use RegularLabs\Library\HtmlTag as RL_HtmlTag; use RegularLabs\Library\PluginTag as RL_PluginTag; use RegularLabs\Library\RegEx as RL_RegEx; use RegularLabs\Library\StringHelper as RL_String; use RegularLabs\Library\Title as RL_Title; use RegularLabs\Library\Uri as RL_Uri; if (is_file(JPATH_LIBRARIES . '/regularlabs/autoload.php')) { require_once JPATH_LIBRARIES . '/regularlabs/autoload.php'; } class RLText { /* Date functions */ public static function fixDate(&$date) { $date = RL_Date::fix($date); } public static function fixDateOffset(&$date) { RL_Date::applyTimezone($date); } public static function dateToDateFormat($dateFormat) { return RL_Date::strftimeToDateFormat($dateFormat); } public static function dateToStrftimeFormat($dateFormat) { return RL_Date::dateToStrftimeFormat($dateFormat); } /* String functions */ public static function html_entity_decoder($string, $quote_style = ENT_QUOTES, $charset = 'UTF-8') { return RL_String::html_entity_decoder($string, $quote_style, $charset); } public static function stringContains($haystacks, $needles) { return RL_String::contains($haystacks, $needles); } public static function is_alphanumeric($string) { return RL_String::is_alphanumeric($string); } public static function splitString($string, $delimiters = [], $max_length = 10000, $maximize_parts = true) { return RL_String::split($string, $delimiters, $max_length, $maximize_parts); } public static function strReplaceOnce($search, $replace, $string) { return RL_String::replaceOnce($search, $replace, $string); } /* Array functions */ public static function toArray($data, $separator = '') { return RL_Array::toArray($data, $separator); } public static function createArray($data, $separator = ',') { return RL_Array::toArray($data, $separator, true); } /* RegEx functions */ public static function regexReplace($pattern, $replacement, $string) { return RL_RegEx::replace($pattern, $replacement, $string); } public static function pregQuote($string = '', $delimiter = '#') { return RL_RegEx::quote($string, $delimiter); } public static function pregQuoteArray($array = [], $delimiter = '#') { return RL_RegEx::quoteArray($array, $delimiter); } /* Title functions */ public static function cleanTitle($string, $strip_tags = false, $strip_spaces = true) { return RL_Title::clean($string, $strip_tags, $strip_spaces); } public static function createUrlMatches($titles = []) { return RL_Title::getUrlMatches($titles); } /* Alias functions */ public static function createAlias($string) { return RL_Alias::get($string); } /* Uri functions */ public static function getURI($hash = '') { return RL_Uri::get($hash); } /* Plugin Tag functions */ public static function getTagRegex($tags, $include_no_attributes = true, $include_ending = true, $required_attributes = []) { return RL_PluginTag::getRegexTags($tags, $include_no_attributes, $include_ending, $required_attributes); } /* HTML functions */ public static function getBody($html) { return RL_Html::getBody($html); } public static function getContentContainingSearches($string, $start_searches = [], $end_searches = [], $start_offset = 1000, $end_offset = null) { return RL_Html::getContentContainingSearches($string, $start_searches, $end_searches, $start_offset, $end_offset); } public static function convertWysiwygToPlainText($string) { return RL_Html::convertWysiwygToPlainText($string); } public static function combinePTags(&$string) { RL_Html::combinePTags($string); } /* HTML Tag functions */ public static function combineTags($tag1, $tag2) { return RL_HtmlTag::combine($tag1, $tag2); } public static function getAttribute($key, $string) { return RL_HtmlTag::getAttributeValue($key, $string); } public static function getAttributes($string) { return RL_HtmlTag::getAttributes($string); } public static function combineAttributes($string1, $string2) { return RL_HtmlTag::combineAttributes($string1, $string2); } /* Form functions */ public static function prepareSelectItem($string, $published = 1, $type = '', $remove_first = 0) { return RL_Form::prepareSelectItem($string, $published, $type, $remove_first); } } home/wuectly/www/components/com_jce/editor/plugins/style/tmpl/text.php 0000604 00000010647 15245626653 0022402 0 ustar 00 <?php /** * @package JCE * @subpackage Editor * * @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE.txt */ \defined('_JEXEC') or die; use Joomla\CMS\Language\Text; ?> <div class="uk-form-row uk-grid uk-grid-small"> <label for="text_font" class="uk-form-label uk-width-2-10"><?php echo Text::_('WF_STYLES_TEXT_FONT'); ?></label> <div class="uk-form-controls uk-width-8-10"><input type="text" id="text_font" class="uk-datalist" list="text_font_datalist" /><datalist id="text_font_datalist"></datalist></div> </div> <div class="uk-form-row uk-grid uk-grid-small"> <label for="text_size" class="uk-form-label uk-width-2-10"><?php echo Text::_('WF_STYLES_TEXT_SIZE'); ?></label> <div class="uk-form-controls uk-width-2-10"> <input type="text" id="text_size" class="uk-datalist" list="text_size_datalist" /><datalist id="text_size_datalist"></datalist> </div> <div class="uk-form-controls uk-width-2-10"> <select id="text_size_measurement"></select> </div> <div class="uk-width-4-10"> <label for="text_weight" class="uk-form-label uk-width-3-10"><?php echo Text::_('WF_STYLES_TEXT_WEIGHT'); ?></label> <div class="uk-form-controls uk-width-7-10"><select id="text_weight"></select></div> </div> </div> <div class="uk-form-row uk-grid uk-grid-small"> <label class="uk-form-label uk-width-2-10" for="text_style"><?php echo Text::_('WF_STYLES_TEXT_STYLE'); ?></label> <div class="uk-form-controls uk-width-4-10"> <input type="text" id="text_style" class="uk-datalist" list="text_style_datalist" /><datalist id="text_style_datalist"></datalist> </div> <div class="uk-width-4-10"> <label class="uk-form-label uk-width-3-10" for="text_variant"><?php echo Text::_('WF_STYLES_TEXT_VARIANT'); ?></label> <div class="uk-form-controls uk-width-7-10"> <select id="text_variant"></select> </div> </div> </div> <div class="uk-form-row uk-grid uk-grid-small"> <label class="uk-form-label uk-width-2-10" for="text_lineheight"><?php echo Text::_('WF_STYLES_TEXT_LINEHEIGHT'); ?></label> <div class="uk-form-row uk-width-2-10"> <input type="text" id="text_lineheight" class="uk-datalist" list="text_lineheight_datalist" /><datalist id="text_lineheight_datalist"></datalist> </div> <div class="uk-form-controls uk-width-2-10"> <select id="text_lineheight_measurement" ></select> </div> <div class="uk-width-4-10"> <label class="uk-form-label uk-width-3-10" for="text_case"><?php echo Text::_('WF_STYLES_TEXT_CASE'); ?></label> <div class="uk-form-controls uk-width-7-10"> <select id="text_case" ></select> </div> </div> </div> <div class="uk-form-row uk-grid uk-grid-small"> <label class="uk-form-label uk-width-2-10" for="text_color"><?php echo Text::_('WF_STYLES_TEXT_COLOR'); ?></label> <div class="uk-form-controls uk-width-2-10"> <input id="text_color" class="color" type="text" value="" /> </div> </div> <div class="uk-form-row uk-grid uk-grid-small"> <label class="uk-form-label uk-width-2-10"><?php echo Text::_('WF_STYLES_TEXT_DECORATION'); ?></label> <div class="uk-form-controls uk-width-8-10"> <input id="text_underline" type="checkbox" /> <label for="text_underline" class="uk-margin-right"><?php echo Text::_('WF_STYLES_TEXT_UNDERLINE'); ?></label> <input id="text_overline" type="checkbox" /> <label for="text_overline" class="uk-margin-right"><?php echo Text::_('WF_STYLES_TEXT_OVERLINE'); ?></label> <input id="text_linethrough" type="checkbox" /> <label for="text_linethrough" class="uk-margin-right"><?php echo Text::_('WF_STYLES_TEXT_STRIKETROUGH'); ?></label> <input id="text_blink" type="checkbox" /> <label for="text_blink" class="uk-margin-right"><?php echo Text::_('WF_STYLES_TEXT_BLINK'); ?></label> <input id="text_none" type="checkbox" onclick="StyleDialog.updateTextDecorations();" /> <label for="text_none"><?php echo Text::_('WF_STYLES_TEXT_NONE'); ?></label> </div> </div> home/wuectly/www/libraries/joomla/form/fields/text.php 0000604 00000015240 15245627617 0017174 0 ustar 00 <?php /** * @package Joomla.Platform * @subpackage Form * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Form Field class for the Joomla Platform. * Supports a one line text field. * * @link http://www.w3.org/TR/html-markup/input.text.html#input.text * @since 1.7.0 */ class JFormFieldText extends JFormField { /** * The form field type. * * @var string * @since 1.7.0 */ protected $type = 'Text'; /** * The allowable maxlength of the field. * * @var integer * @since 3.2 */ protected $maxLength; /** * The mode of input associated with the field. * * @var mixed * @since 3.2 */ protected $inputmode; /** * The name of the form field direction (ltr or rtl). * * @var string * @since 3.2 */ protected $dirname; /** * Name of the layout being used to render the field * * @var string * @since 3.7 */ protected $layout = 'joomla.form.field.text'; /** * Method to get certain otherwise inaccessible properties from the form field object. * * @param string $name The property name for which to get the value. * * @return mixed The property value or null. * * @since 3.2 */ public function __get($name) { switch ($name) { case 'maxLength': case 'dirname': case 'inputmode': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to set the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'maxLength': $this->maxLength = (int) $value; break; case 'dirname': $value = (string) $value; $this->dirname = ($value == $name || $value == 'true' || $value == '1'); break; case 'inputmode': $this->inputmode = (string) $value; break; default: parent::__set($name, $value); } } /** * Method to attach a JForm object to the field. * * @param SimpleXMLElement $element The SimpleXMLElement object representing the `<field>` tag for the form field object. * @param mixed $value The form field value to validate. * @param string $group The field name group control value. This acts as an array container for the field. * For example if the field has name="foo" and the group value is set to "bar" then the * full field name would end up being "bar[foo]". * * @return boolean True on success. * * @see JFormField::setup() * @since 3.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $result = parent::setup($element, $value, $group); if ($result == true) { $inputmode = (string) $this->element['inputmode']; $dirname = (string) $this->element['dirname']; $this->inputmode = ''; $inputmode = preg_replace('/\s+/', ' ', trim($inputmode)); $inputmode = explode(' ', $inputmode); if (!empty($inputmode)) { $defaultInputmode = in_array('default', $inputmode) ? JText::_('JLIB_FORM_INPUTMODE') . ' ' : ''; foreach (array_keys($inputmode, 'default') as $key) { unset($inputmode[$key]); } $this->inputmode = $defaultInputmode . implode(' ', $inputmode); } // Set the dirname. $dirname = ((string) $dirname == 'dirname' || $dirname == 'true' || $dirname == '1'); $this->dirname = $dirname ? $this->getName($this->fieldname . '_dir') : false; $this->maxLength = (int) $this->element['maxlength']; } return $result; } /** * Method to get the field input markup. * * @return string The field input markup. * * @since 1.7.0 */ protected function getInput() { if ($this->element['useglobal']) { $component = JFactory::getApplication()->input->getCmd('option'); // Get correct component for menu items if ($component == 'com_menus') { $link = $this->form->getData()->get('link'); $uri = new JUri($link); $component = $uri->getVar('option', 'com_menus'); } $params = JComponentHelper::getParams($component); $value = $params->get($this->fieldname); // Try with global configuration if (is_null($value)) { $value = JFactory::getConfig()->get($this->fieldname); } // Try with menu configuration if (is_null($value) && JFactory::getApplication()->input->getCmd('option') == 'com_menus') { $value = JComponentHelper::getParams('com_menus')->get($this->fieldname); } if (!is_null($value)) { $value = (string) $value; $this->hint = JText::sprintf('JGLOBAL_USE_GLOBAL_VALUE', $value); } } return $this->getRenderer($this->layout)->render($this->getLayoutData()); } /** * Method to get the field options. * * @return array The field option objects. * * @since 3.4 */ protected function getOptions() { $options = array(); foreach ($this->element->children() as $option) { // Only add <option /> elements. if ($option->getName() != 'option') { continue; } // Create a new option object based on the <option /> element. $options[] = JHtml::_( 'select.option', (string) $option['value'], JText::alt(trim((string) $option), preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)), 'value', 'text' ); } return $options; } /** * Method to get the field suggestions. * * @return array The field option objects. * * @since 3.2 * @deprecated 4.0 Use getOptions instead */ protected function getSuggestions() { return $this->getOptions(); } /** * Method to get the data to be passed to the layout for rendering. * * @return array * * @since 3.7 */ protected function getLayoutData() { $data = parent::getLayoutData(); // Initialize some field attributes. $maxLength = !empty($this->maxLength) ? ' maxlength="' . $this->maxLength . '"' : ''; $inputmode = !empty($this->inputmode) ? ' inputmode="' . $this->inputmode . '"' : ''; $dirname = !empty($this->dirname) ? ' dirname="' . $this->dirname . '"' : ''; /* Get the field options for the datalist. Note: getSuggestions() is deprecated and will be changed to getOptions() with 4.0. */ $options = (array) $this->getSuggestions(); $extraData = array( 'maxLength' => $maxLength, 'pattern' => $this->pattern, 'inputmode' => $inputmode, 'dirname' => $dirname, 'options' => $options, ); return array_merge($data, $extraData); } } home/wuectly/www/layouts/joomla/form/field/text.php 0000604 00000007357 15245627647 0016552 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage Layout * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; extract($displayData); /** * Layout variables * ----------------- * @var string $autocomplete Autocomplete attribute for the field. * @var boolean $autofocus Is autofocus enabled? * @var string $class Classes for the input. * @var string $description Description of the field. * @var boolean $disabled Is this field disabled? * @var string $group Group the field belongs to. <fields> section in form XML. * @var boolean $hidden Is this field hidden in the form? * @var string $hint Placeholder for the field. * @var string $id DOM id of the field. * @var string $label Label of the field. * @var string $labelclass Classes to apply to the label. * @var boolean $multiple Does this field support multiple values? * @var string $name Name of the input field. * @var string $onchange Onchange attribute for the field. * @var string $onclick Onclick attribute for the field. * @var string $pattern Pattern (Reg Ex) of value of the form field. * @var boolean $readonly Is this field read only? * @var boolean $repeat Allows extensions to duplicate elements. * @var boolean $required Is this field required? * @var integer $size Size attribute of the input. * @var boolean $spellcheck Spellcheck state for the form field. * @var string $validate Validation rules to apply. * @var string $value Value attribute of the field. * @var array $checkedOptions Options that will be set as checked. * @var boolean $hasValue Has this field a value assigned? * @var array $options Options available for this field. * @var array $inputType Options available for this field. * @var string $accept File types that are accepted. */ // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9')); $list = ''; if ($options) { $list = 'list="' . $id . '_datalist"'; } $autocomplete = !$autocomplete ? ' autocomplete="off"' : ' autocomplete="' . $autocomplete . '"'; $autocomplete = $autocomplete === ' autocomplete="on"' ? '' : $autocomplete; $attributes = array( !empty($class) ? 'class="' . $class . '"' : '', !empty($size) ? 'size="' . $size . '"' : '', $disabled ? 'disabled' : '', $readonly ? 'readonly' : '', $list, strlen($hint) ? 'placeholder="' . htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"' : '', $onchange ? ' onchange="' . $onchange . '"' : '', !empty($maxLength) ? $maxLength : '', $required ? 'required aria-required="true"' : '', $autocomplete, $autofocus ? ' autofocus' : '', $spellcheck ? '' : 'spellcheck="false"', !empty($inputmode) ? $inputmode : '', !empty($pattern) ? 'pattern="' . $pattern . '"' : '', ); ?> <input type="text" name="<?php echo $name; ?>" id="<?php echo $id; ?>" <?php echo $dirname; ?> value="<?php echo htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); ?>" <?php echo implode(' ', $attributes); ?> /> <?php if ($options) : ?> <datalist id="<?php echo $id; ?>_datalist"> <?php foreach ($options as $option) : ?> <?php if (!$option->value) : ?> <?php continue; ?> <?php endif; ?> <option value="<?php echo $option->value; ?>"><?php echo $option->text; ?></option> <?php endforeach; ?> </datalist> <?php endif; ?> home/wuectly/www/components/com_jce/editor/libraries/classes/text.php 0000604 00000001105 15245651073 0022175 0 ustar 00 <?php /** * @package JCE * @subpackage Editor * * @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved. * @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE.txt */ \defined('_JEXEC') or die; use Joomla\CMS\Language\Text; abstract class WFText { public static function _($string, $default = '') { return Text::_($string); } public static function sprintf($string) { return Text::sprintf($string); } } home/wuectly/www/libraries/f0f/model/field/text.php 0000604 00000006210 15245657455 0016340 0 ustar 00 <?php /** * @package FrameworkOnFramework * @subpackage model * @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access defined('F0F_INCLUDED') or die; /** * FrameworkOnFramework model behavior class * * @package FrameworkOnFramework * @since 2.1 */ class F0FModelFieldText extends F0FModelField { /** * Constructor * * @param F0FDatabaseDriver $db The database object * @param object $field The field informations as taken from the db */ public function __construct($db, $field, $table_alias = false) { parent::__construct($db, $field, $table_alias); $this->null_value = ''; } /** * Returns the default search method for this field. * * @return string */ public function getDefaultSearchMethod() { return 'partial'; } /** * Perform a partial match (search in string) * * @param mixed $value The value to compare to * * @return string The SQL where clause for this search */ public function partial($value) { if ($this->isEmpty($value)) { return ''; } return '(' . $this->getFieldName() . ' LIKE ' . $this->_db->quote('%' . $value . '%') . ')'; } /** * Perform an exact match (match string) * * @param mixed $value The value to compare to * * @return string The SQL where clause for this search */ public function exact($value) { if ($this->isEmpty($value)) { return ''; } return '(' . $this->getFieldName() . ' LIKE ' . $this->_db->quote($value) . ')'; } /** * Dummy method; this search makes no sense for text fields * * @param mixed $from Ignored * @param mixed $to Ignored * @param boolean $include Ignored * * @return string Empty string */ public function between($from, $to, $include = true) { return ''; } /** * Dummy method; this search makes no sense for text fields * * @param mixed $from Ignored * @param mixed $to Ignored * @param boolean $include Ignored * * @return string Empty string */ public function outside($from, $to, $include = false) { return ''; } /** * Dummy method; this search makes no sense for text fields * * @param mixed $value Ignored * @param mixed $interval Ignored * @param boolean $include Ignored * * @return string Empty string */ public function interval($value, $interval, $include = true) { return ''; } /** * Dummy method; this search makes no sense for text fields * * @param mixed $from Ignored * @param mixed $to Ignored * @param boolean $include Ignored * * @return string Empty string */ public function range($from, $to, $include = false) { return ''; } /** * Dummy method; this search makes no sense for text fields * * @param mixed $from Ignored * @param mixed $to Ignored * @param boolean $include Ignored * * @return string Empty string */ public function modulo($from, $to, $include = false) { return ''; } } home/wuectly/www/libraries/fof/model/field/text.php 0000604 00000006210 15245662616 0016432 0 ustar 00 <?php /** * @package FrameworkOnFramework * @subpackage model * @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access defined('FOF_INCLUDED') or die; /** * FrameworkOnFramework model behavior class * * @package FrameworkOnFramework * @since 2.1 */ class FOFModelFieldText extends FOFModelField { /** * Constructor * * @param FOFDatabaseDriver $db The database object * @param object $field The field informations as taken from the db */ public function __construct($db, $field, $table_alias = false) { parent::__construct($db, $field, $table_alias); $this->null_value = ''; } /** * Returns the default search method for this field. * * @return string */ public function getDefaultSearchMethod() { return 'partial'; } /** * Perform a partial match (search in string) * * @param mixed $value The value to compare to * * @return string The SQL where clause for this search */ public function partial($value) { if ($this->isEmpty($value)) { return ''; } return '(' . $this->getFieldName() . ' LIKE ' . $this->_db->quote('%' . $value . '%') . ')'; } /** * Perform an exact match (match string) * * @param mixed $value The value to compare to * * @return string The SQL where clause for this search */ public function exact($value) { if ($this->isEmpty($value)) { return ''; } return '(' . $this->getFieldName() . ' LIKE ' . $this->_db->quote($value) . ')'; } /** * Dummy method; this search makes no sense for text fields * * @param mixed $from Ignored * @param mixed $to Ignored * @param boolean $include Ignored * * @return string Empty string */ public function between($from, $to, $include = true) { return ''; } /** * Dummy method; this search makes no sense for text fields * * @param mixed $from Ignored * @param mixed $to Ignored * @param boolean $include Ignored * * @return string Empty string */ public function outside($from, $to, $include = false) { return ''; } /** * Dummy method; this search makes no sense for text fields * * @param mixed $value Ignored * @param mixed $interval Ignored * @param boolean $include Ignored * * @return string Empty string */ public function interval($value, $interval, $include = true) { return ''; } /** * Dummy method; this search makes no sense for text fields * * @param mixed $from Ignored * @param mixed $to Ignored * @param boolean $include Ignored * * @return string Empty string */ public function range($from, $to, $include = false) { return ''; } /** * Dummy method; this search makes no sense for text fields * * @param mixed $from Ignored * @param mixed $to Ignored * @param boolean $include Ignored * * @return string Empty string */ public function modulo($from, $to, $include = false) { return ''; } } home/wuectly/www/libraries/f0f/form/field/text.php 0000604 00000012303 15245700401 0016157 0 ustar 00 <?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access defined('F0F_INCLUDED') or die; JFormHelper::loadFieldClass('text'); /** * Form Field class for the F0F framework * Supports a one line text field. * * @package FrameworkOnFramework * @since 2.0 */ class F0FFormFieldText extends JFormFieldText implements F0FFormField { protected $static; protected $repeatable; /** @var F0FTable The item being rendered in a repeatable form field */ public $item; /** @var int A monotonically increasing number, denoting the row number in a repeatable view */ public $rowid; /** * Method to get certain otherwise inaccessible properties from the form field object. * * @param string $name The property name for which to the the value. * * @return mixed The property value or null. * * @since 2.0 */ public function __get($name) { switch ($name) { case 'static': if (empty($this->static)) { $this->static = $this->getStatic(); } return $this->static; break; case 'repeatable': if (empty($this->repeatable)) { $this->repeatable = $this->getRepeatable(); } return $this->repeatable; break; default: return parent::__get($name); } } /** * Get the rendering of this field type for static display, e.g. in a single * item view (typically a "read" task). * * @since 2.0 * * @return string The field HTML */ public function getStatic() { $class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : ''; $empty_replacement = ''; if ($this->element['empty_replacement']) { $empty_replacement = (string) $this->element['empty_replacement']; } if (!empty($empty_replacement) && empty($this->value)) { $this->value = JText::_($empty_replacement); } return '<span id="' . $this->id . '" ' . $class . '>' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '</span>'; } /** * Get the rendering of this field type for a repeatable (grid) display, * e.g. in a view listing many item (typically a "browse" task) * * @since 2.0 * * @return string The field HTML */ public function getRepeatable() { // Initialise $class = $this->id; $format_string = ''; $format_if_not_empty = false; $parse_value = false; $show_link = false; $link_url = ''; $empty_replacement = ''; // Get field parameters if ($this->element['class']) { $class = (string) $this->element['class']; } if ($this->element['format']) { $format_string = (string) $this->element['format']; } if ($this->element['show_link'] == 'true') { $show_link = true; } if ($this->element['format_if_not_empty'] == 'true') { $format_if_not_empty = true; } if ($this->element['parse_value'] == 'true') { $parse_value = true; } if ($this->element['url']) { $link_url = $this->element['url']; } else { $show_link = false; } if ($show_link && ($this->item instanceof F0FTable)) { $link_url = $this->parseFieldTags($link_url); } else { $show_link = false; } if ($this->element['empty_replacement']) { $empty_replacement = (string) $this->element['empty_replacement']; } // Get the (optionally formatted) value $value = $this->value; if (!empty($empty_replacement) && empty($this->value)) { $value = JText::_($empty_replacement); } if ($parse_value) { $value = $this->parseFieldTags($value); } if (!empty($format_string) && (!$format_if_not_empty || ($format_if_not_empty && !empty($this->value)))) { $format_string = $this->parseFieldTags($format_string); $value = sprintf($format_string, $value); } else { $value = htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); } // Create the HTML $html = '<span class="' . $class . '">'; if ($show_link) { $html .= '<a href="' . $link_url . '">'; } $html .= $value; if ($show_link) { $html .= '</a>'; } $html .= '</span>'; return $html; } /** * Replace string with tags that reference fields * * @param string $text Text to process * * @return string Text with tags replace */ protected function parseFieldTags($text) { $ret = $text; // Replace [ITEM:ID] in the URL with the item's key value (usually: // the auto-incrementing numeric ID) $keyfield = $this->item->getKeyName(); $replace = $this->item->$keyfield; $ret = str_replace('[ITEM:ID]', $replace, $ret); // Replace the [ITEMID] in the URL with the current Itemid parameter $ret = str_replace('[ITEMID]', JFactory::getApplication()->input->getInt('Itemid', 0), $ret); // Replace other field variables in the URL $fields = $this->item->getTableFields(); foreach ($fields as $fielddata) { $fieldname = $fielddata->Field; if (empty($fieldname)) { $fieldname = $fielddata->column_name; } $search = '[ITEM:' . strtoupper($fieldname) . ']'; $replace = $this->item->$fieldname; $ret = str_replace($search, $replace, $ret); } return $ret; } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка