X7ROOT File Manager
Current Path:
/home/notabjze/just4dastreets.com/libraries/src/Form/Field
home
/
notabjze
/
just4dastreets.com
/
libraries
/
src
/
Form
/
Field
/
ðŸ“
..
📄
AccessiblemediaField.php
(4.58 KB)
📄
AccesslevelField.php
(900 B)
📄
AliastagField.php
(1.71 KB)
📄
AuthorField.php
(1.66 KB)
📄
CachehandlerField.php
(1.1 KB)
📄
CalendarField.php
(10.72 KB)
📄
CaptchaField.php
(4.15 KB)
📄
CategoryField.php
(2.9 KB)
📄
CheckboxField.php
(3.51 KB)
📄
CheckboxesField.php
(3.95 KB)
📄
ChromestyleField.php
(5.57 KB)
📄
ColorField.php
(8.14 KB)
📄
ComboField.php
(1.4 KB)
📄
ComponentlayoutField.php
(7.54 KB)
📄
ComponentsField.php
(1.73 KB)
📄
ContenthistoryField.php
(1.72 KB)
📄
ContentlanguageField.php
(908 B)
📄
ContenttypeField.php
(2.3 KB)
📄
DatabaseconnectionField.php
(2.05 KB)
📄
EditorField.php
(7.37 KB)
📄
EmailField.php
(1.45 KB)
📄
FileField.php
(3.41 KB)
📄
FilelistField.php
(5.6 KB)
📄
FolderlistField.php
(5.48 KB)
📄
FrontendlanguageField.php
(1.89 KB)
📄
GroupedlistField.php
(3.89 KB)
📄
HeadertagField.php
(970 B)
📄
HiddenField.php
(1.26 KB)
📄
ImagelistField.php
(926 B)
📄
IntegerField.php
(1.75 KB)
📄
LanguageField.php
(2.12 KB)
📄
LastvisitdaterangeField.php
(1.39 KB)
📄
LimitboxField.php
(2.19 KB)
📄
ListField.php
(5.98 KB)
📄
MediaField.php
(10.56 KB)
📄
MenuField.php
(3.06 KB)
📄
MenuitemField.php
(5.9 KB)
📄
MeterField.php
(4.53 KB)
📄
ModulelayoutField.php
(6.24 KB)
📄
ModuleorderField.php
(3.28 KB)
📄
ModulepositionField.php
(4.42 KB)
📄
ModuletagField.php
(1011 B)
📄
NoteField.php
(2.19 KB)
📄
NumberField.php
(5.08 KB)
📄
OrderingField.php
(4.89 KB)
📄
PasswordField.php
(6.12 KB)
📄
PluginsField.php
(4.4 KB)
📄
PluginstatusField.php
(649 B)
📄
PredefinedlistField.php
(3 KB)
📄
RadioField.php
(1.1 KB)
📄
RadiobasicField.php
(1.29 KB)
📄
RangeField.php
(1.38 KB)
📄
RedirectStatusField.php
(724 B)
📄
RegistrationdaterangeField.php
(1.39 KB)
📄
RulesField.php
(7.3 KB)
📄
SessionhandlerField.php
(1.2 KB)
📄
SpacerField.php
(3.39 KB)
📄
SqlField.php
(7.28 KB)
📄
StatusField.php
(714 B)
📄
SubformField.php
(10.79 KB)
📄
TagField.php
(8.24 KB)
📄
TelephoneField.php
(1.61 KB)
📄
TemplatestyleField.php
(4.84 KB)
📄
TextField.php
(7.17 KB)
📄
TextareaField.php
(4.57 KB)
📄
TimeField.php
(3.8 KB)
📄
TimezoneField.php
(3.83 KB)
📄
TransitionField.php
(4.5 KB)
📄
UrlField.php
(1.78 KB)
📄
UserField.php
(3.87 KB)
📄
UseractiveField.php
(1.08 KB)
📄
UsergrouplistField.php
(2.53 KB)
📄
UserstateField.php
(672 B)
📄
WorkflowComponentSectionsField.php
(1.47 KB)
📄
WorkflowconditionField.php
(3.23 KB)
📄
WorkflowstageField.php
(4.08 KB)
Editing: ComponentlayoutField.php
<?php /** * Joomla! Content Management System * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Form\Field; \defined('JPATH_PLATFORM') or die; use Joomla\CMS\Application\ApplicationHelper; use Joomla\CMS\Factory; use Joomla\CMS\Filesystem\Folder; use Joomla\CMS\Filesystem\Path; use Joomla\CMS\Form\Form; use Joomla\CMS\Form\FormField; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\Database\ParameterType; /** * Form Field to display a list of the layouts for a component view from * the extension or template overrides. * * @since 1.6 */ class ComponentlayoutField extends FormField { /** * The form field type. * * @var string * @since 1.6 */ protected $type = 'ComponentLayout'; /** * Method to get the field input for a component layout field. * * @return string The field input. * * @since 1.6 */ protected function getInput() { // Get the client id. $clientId = $this->element['client_id']; if ($clientId === null && $this->form instanceof Form) { $clientId = $this->form->getValue('client_id'); } $clientId = (int) $clientId; $client = ApplicationHelper::getClientInfo($clientId); // Get the extension. $extension = (string) $this->element['extension']; if (empty($extension) && ($this->form instanceof Form)) { $extension = $this->form->getValue('extension'); } $extension = preg_replace('#\W#', '', $extension); $template = (string) $this->element['template']; $template = preg_replace('#\W#', '', $template); $template_style_id = 0; if ($this->form instanceof Form) { $template_style_id = $this->form->getValue('template_style_id'); $template_style_id = (int) preg_replace('#\W#', '', $template_style_id); } $view = (string) $this->element['view']; $view = preg_replace('#\W#', '', $view); // If a template, extension and view are present build the options. if ($extension && $view && $client) { // Load language file $lang = Factory::getLanguage(); $lang->load($extension . '.sys', JPATH_ADMINISTRATOR) || $lang->load($extension . '.sys', JPATH_ADMINISTRATOR . '/components/' . $extension); // Get the database object and a new query object. $db = Factory::getDbo(); $query = $db->getQuery(true); // Build the query. $query->select( [ $db->quoteName('e.element'), $db->quoteName('e.name'), ] ) ->from($db->quoteName('#__extensions', 'e')) ->where( [ $db->quoteName('e.client_id') . ' = :clientId', $db->quoteName('e.type') . ' = ' . $db->quote('template'), $db->quoteName('e.enabled') . ' = 1', ] ) ->bind(':clientId', $clientId, ParameterType::INTEGER); if ($template) { $query->where($db->quoteName('e.element') . ' = :template') ->bind(':template', $template); } if ($template_style_id) { $query->join('LEFT', $db->quoteName('#__template_styles', 's'), $db->quoteName('s.template') . ' = ' . $db->quoteName('e.element')) ->where($db->quoteName('s.id') . ' = :style') ->bind(':style', $template_style_id, ParameterType::INTEGER); } // Set the query and load the templates. $db->setQuery($query); $templates = $db->loadObjectList('element'); // Build the search paths for component layouts. $component_path = Path::clean($client->path . '/components/' . $extension . '/tmpl/' . $view); // Check if the new layouts folder exists, else use the old one if (!is_dir($component_path)) { $component_path = Path::clean($client->path . '/components/' . $extension . '/views/' . $view . '/tmpl'); } // Prepare array of component layouts $component_layouts = array(); // Prepare the grouped list $groups = array(); // Add a Use Global option if useglobal="true" in XML file if ((string) $this->element['useglobal'] === 'true') { $groups[Text::_('JOPTION_FROM_STANDARD')]['items'][] = HTMLHelper::_('select.option', '', Text::_('JGLOBAL_USE_GLOBAL')); } // Add the layout options from the component path. if (is_dir($component_path) && ($component_layouts = Folder::files($component_path, '^[^_]*\.xml$', false, true))) { // Create the group for the component $groups['_'] = array(); $groups['_']['id'] = $this->id . '__'; $groups['_']['text'] = Text::sprintf('JOPTION_FROM_COMPONENT'); $groups['_']['items'] = array(); foreach ($component_layouts as $i => $file) { // Attempt to load the XML file. if (!$xml = simplexml_load_file($file)) { unset($component_layouts[$i]); continue; } // Get the help data from the XML file if present. if (!$menu = $xml->xpath('layout[1]')) { unset($component_layouts[$i]); continue; } $menu = $menu[0]; // Add an option to the component group $value = basename($file, '.xml'); $component_layouts[$i] = $value; $text = isset($menu['option']) ? Text::_($menu['option']) : (isset($menu['title']) ? Text::_($menu['title']) : $value); $groups['_']['items'][] = HTMLHelper::_('select.option', '_:' . $value, $text); } } // Loop on all templates if ($templates) { foreach ($templates as $template) { // Load language file $lang->load('tpl_' . $template->element . '.sys', $client->path) || $lang->load('tpl_' . $template->element . '.sys', $client->path . '/templates/' . $template->element); $template_path = Path::clean( $client->path . '/templates/' . $template->element . '/html/' . $extension . '/' . $view ); // Add the layout options from the template path. if (is_dir($template_path) && ($files = Folder::files($template_path, '^[^_]*\.php$', false, true))) { foreach ($files as $i => $file) { // Remove layout files that exist in the component folder if (\in_array(basename($file, '.php'), $component_layouts)) { unset($files[$i]); } } if (\count($files)) { // Create the group for the template $groups[$template->name] = array(); $groups[$template->name]['id'] = $this->id . '_' . $template->element; $groups[$template->name]['text'] = Text::sprintf('JOPTION_FROM_TEMPLATE', $template->name); $groups[$template->name]['items'] = array(); foreach ($files as $file) { // Add an option to the template group $value = basename($file, '.php'); $text = $lang ->hasKey( $key = strtoupper( 'TPL_' . $template->name . '_' . $extension . '_' . $view . '_LAYOUT_' . $value ) ) ? Text::_($key) : $value; $groups[$template->name]['items'][] = HTMLHelper::_('select.option', $template->element . ':' . $value, $text); } } } } } // Compute attributes for the grouped list $attr = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : ''; $attr .= $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : ''; // Prepare HTML code $html = array(); // Compute the current selected values $selected = array($this->value); // Add a grouped list $html[] = HTMLHelper::_( 'select.groupedlist', $groups, $this->name, array('id' => $this->id, 'group.id' => 'id', 'list.attr' => $attr, 'list.select' => $selected) ); return implode($html); } else { return ''; } } }
Upload File
Create Folder