/
home
/
assocoweys
/
avexp
/
administrator
/
components
/
com_latestnewsenhancedpro
/
models
/
fields
/
Upload File
HOME
<?php /** * @copyright Copyright (C) 2011 Simplify Your Web, Inc. All rights reserved. * @license GNU General Public License version 3 or later; see LICENSE.txt */ defined( '_JEXEC' ) or die; use Joomla\CMS\Factory; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Uri\Uri; jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.file'); FormHelper::loadFieldClass('dynamicsingleselect'); class JFormFieldStyleSelect extends JFormFieldDynamicSingleSelect { public $type = 'StyleSelect'; protected function getOptions() { $options = array(); $lang = Factory::getLanguage(); $path = '/components/com_latestnewsenhancedpro/assets/styles/themes'; $optionsArray = \JFolder::folders(JPATH_SITE.$path); foreach ($optionsArray as $option) { if (!\JFile::exists(JPATH_ROOT.$path.'/'.$option.'/'.$option.'.png')) { continue; } $upper_option = strtoupper($option); $lang->load('com_latestnewsenhancedpro_style_overall_'.$option); $translated_option = Text::_('COM_LATESTNEWSENHANCEDPRO_STYLE_OVERALL_'.$upper_option.'_LABEL'); $description = ''; if (empty($translated_option) || substr_count($translated_option, 'LATESTNEWSENHANCEDPRO') > 0) { $translated_option = ucfirst($option); } else { $description = Text::_('COM_LATESTNEWSENHANCEDPRO_STYLE_OVERALL_'.$upper_option.'_DESC'); if (substr_count($description, 'LATESTNEWSENHANCEDPRO') > 0) { $description = ''; } } $image_hover = ''; if (\JFile::exists(JPATH_ROOT.$path.'/'.$option.'/'.$option.'_hover.png')) { $image_hover = Uri::root(true).$path.'/'.$option.'/'.$option.'_hover.png'; } $options[] = array($option, $translated_option, $description, Uri::root(true).$path.'/'.$option.'/'.$option.'.png', $image_hover); } return $options; } public function setup(\SimpleXMLElement $element, $value, $group = null) { $return = parent::setup($element, $value, $group); if ($return) { $this->width = 150; $this->height = 100; } return $return; } } ?>