File manager - Edit - /home/jardides/www/Jardi-design/sitetest/components/com_hotspots/helpers/settings.php
Back
<?php /** * @package Hotspots * @author DanielDimitrov <daniel@compojoom.com> * @date 15.07.13 * * @copyright Copyright (C) 2008 - 2013 compojoom.com . All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('_JEXEC') or die('Restricted access'); /** * Class HotspotsHelper * * @since 3.0 */ class HotspotsHelperSettings { private static $instance; /** * Gets a setting and if not existing sets it * * @param string $title - the setting name * @param string $default - default value * * @return mixed <type> */ public static function get($title = '', $default = '') { if (!isset(self::$instance)) { self::$instance = self::_loadSettings(); } return self::$instance->get($title, $default); } /** * Loads the component settings and merges it with the menu settings * * @return JObject - loads a singleton object with all settings */ private static function _loadSettings() { $params = JComponentHelper::getParams('com_hotspots'); // Grab the settings from the menu and merge them in the object $app = JFactory::getApplication(); $menu = $app->getMenu(); if (is_object($menu)) { if ($item = $menu->getActive()) { $menuParams = $menu->getParams($item->id); foreach ($menuParams->toArray() as $key => $value) { if ($key == 'show_page_heading') { $key = 'show_page_title'; } // If there is no value in the menu for styled map, just skip it if ($key == 'styled_maps') { if (trim($value) == '') { continue; } } $params->set($key, $value); } } } return $params; } /** * Gets allowed actions * * @param int $messageId - message id * @param string $unit - the unit * @param string $assetName - asset name * * @return JObject */ public static function getActions($messageId = 0, $unit = 'component', $assetName = 'com_hotspots') { jimport('joomla.access.access'); $user = JFactory::getUser(); $result = new JObject; if (empty($messageId)) { $asset = $assetName; } else { $asset = $assetName . '.' . $unit . '.' . (int) $messageId; } $actions = JAccess::getActions($assetName, $unit); foreach ($actions as $action) { $result->set($action->name, $user->authorise($action->name, $asset)); } return $result; } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings