[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @package Joomla.Administrator 5 * @subpackage com_actionlogs 6 * 7 * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> 8 * @license GNU General Public License version 2 or later; see LICENSE.txt 9 */ 10 11 namespace Joomla\Component\Actionlogs\Administrator\Field; 12 13 use Joomla\CMS\Application\ApplicationHelper; 14 use Joomla\CMS\Form\Field\ListField; 15 use Joomla\CMS\HTML\HTMLHelper; 16 use Joomla\CMS\Language\Text; 17 use Joomla\Component\Actionlogs\Administrator\Helper\ActionlogsHelper; 18 19 // phpcs:disable PSR1.Files.SideEffects 20 \defined('_JEXEC') or die; 21 // phpcs:enable PSR1.Files.SideEffects 22 23 /** 24 * Field to load a list of all users that have logged actions 25 * 26 * @since 3.9.0 27 */ 28 class LogtypeField extends ListField 29 { 30 /** 31 * The form field type. 32 * 33 * @var string 34 * @since 3.9.0 35 */ 36 protected $type = 'LogType'; 37 38 /** 39 * Method to get the field options. 40 * 41 * @return array The field option objects. 42 * 43 * @since 3.9.0 44 */ 45 public function getOptions() 46 { 47 $db = $this->getDatabase(); 48 $query = $db->getQuery(true) 49 ->select($db->quoteName('extension')) 50 ->from($db->quoteName('#__action_logs_extensions')); 51 52 $extensions = $db->setQuery($query)->loadColumn(); 53 54 $options = []; 55 56 foreach ($extensions as $extension) { 57 ActionlogsHelper::loadTranslationFiles($extension); 58 $extensionName = Text::_($extension); 59 $options[ApplicationHelper::stringURLSafe($extensionName) . '_' . $extension] = HTMLHelper::_('select.option', $extension, $extensionName); 60 } 61 62 ksort($options); 63 64 return array_merge(parent::getOptions(), array_values($options)); 65 } 66 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |