Spade
Mini Shell
| Directory:~$ /home/lmsyaran/public_html/joomla4/ |
| [Home] [System Details] [Kill Me] |
home/lmsyaran/public_html/libraries/fof/form/field/text.php000064400000012303151156144000020071
0ustar00<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('text');
/**
* Form Field class for the FOF framework
* Supports a one line text field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldText extends JFormFieldText implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable 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 FOFTable))
{
$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;
}
}
home/lmsyaran/public_html/libraries/fof/model/field/text.php000064400000006210151157166160020242
0ustar00<?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/lmsyaran/public_html/libraries/joomla/form/fields/text.php000064400000015255151157412360021004
0ustar00<?php
/**
* @package Joomla.Platform
* @subpackage Form
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @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/lmsyaran/public_html/j3/plugins/fields/text/text.php000064400000000705151160050400017542
0ustar00<?php
/**
* @package Joomla.Plugin
* @subpackage Fields.Text
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @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/lmsyaran/public_html/j3/libraries/joomla/form/fields/text.php000064400000015255151160074220021311
0ustar00<?php
/**
* @package Joomla.Platform
* @subpackage Form
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @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/lmsyaran/public_html/j3/libraries/regularlabs/helpers/text.php000064400000011417151160407330021562
0ustar00<?php
/**
* @package Regular Labs Library
* @version 21.2.19653
*
* @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/lmsyaran/public_html/j3/htaccess.back/fof/model/field/text.php000064400000006210151161013000021251
0ustar00<?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/lmsyaran/public_html/j3/htaccess.back/fof/form/field/text.php000064400000012303151161424140021127
0ustar00<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('text');
/**
* Form Field class for the FOF framework
* Supports a one line text field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldText extends JFormFieldText implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable 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 FOFTable))
{
$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;
}
}
home/lmsyaran/public_html/libraries/regularlabs/helpers/text.php000064400000011417151161625500021250
0ustar00<?php
/**
* @package Regular Labs Library
* @version 21.2.19653
*
* @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/lmsyaran/public_html/j3/htaccess.back/joomla/form/fields/text.php000064400000015255151162054710022035
0ustar00<?php
/**
* @package Joomla.Platform
* @subpackage Form
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @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/lmsyaran/public_html/j3/plugins/fields/text/tmpl/text.php000064400000000637151164302550020534
0ustar00<?php
/**
* @package Joomla.Plugin
* @subpackage Fields.Text
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @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);