Esempio n. 1
0
 function unloadFromPlugin($type, $name)
 {
     $plugins = JPluginHelper::getPlugin("content");
     $plugins = JPluginHelper::$plugins;
     if (isset($plugins) && count($plugins) > 0) {
         foreach ($plugins as $key => $value) {
             if ($value->name == $name && $value->type == $type) {
                 unset($plugins[$key]);
                 JPluginHelper::$plugins = $plugins;
                 break;
             }
         }
     }
 }
Esempio n. 2
0
	/**
	 * Loads the published plugins.
	 *
	 * @return  array  An array of published plugins
	 *
	 * @since   11.1
	 */
	protected static function _load()
	{
		if (self::$plugins !== null)
		{
			return self::$plugins;
		}

		$user = JFactory::getUser();
		$cache = JFactory::getCache('com_plugins', '');

		$levels = implode(',', $user->getAuthorisedViewLevels());

		if (!self::$plugins = $cache->get($levels))
		{
			$db = JFactory::getDbo();
			$query = $db->getQuery(true);

			$query->select('folder AS type, element AS name, params')
				->from('#__extensions')
				->where('enabled >= 1')
				->where('type =' . $db->Quote('plugin'))
				->where('state >= 0')
				->where('access IN (' . $levels . ')')
				->order('ordering');

			self::$plugins = $db->setQuery($query)->loadObjectList();

			$cache->store(self::$plugins, $levels);
		}

		return self::$plugins;
	}