Source for file plugins.php

Documentation is available at plugins.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_plugins
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * Plugins component helper.
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_plugins
  17.  * @since       1.6
  18.  */
  19. {
  20.     public static $extension 'com_plugins';
  21.  
  22.     /**
  23.      * Configure the Linkbar.
  24.      *
  25.      * @param   string    The name of the active view.
  26.      */
  27.     public static function addSubmenu($vName)
  28.     {
  29.         // No submenu for this component.
  30.     }
  31.  
  32.     /**
  33.      * Gets a list of the actions that can be performed.
  34.      *
  35.      * @return  JObject 
  36.      */
  37.     public static function getActions()
  38.     {
  39.         $user JFactory::getUser();
  40.         $result new JObject;
  41.         $assetName 'com_plugins';
  42.  
  43.         $actions JAccess::getActions($assetName);
  44.  
  45.         foreach ($actions as $action)
  46.         {
  47.             $result->set($action->name$user->authorise($action->name$assetName));
  48.         }
  49.  
  50.         return $result;
  51.     }
  52.  
  53.     /**
  54.      * Returns an array of standard published state filter options.
  55.      *
  56.      * @return  string    The HTML code for the select tag
  57.      */
  58.     public static function publishedOptions()
  59.     {
  60.         // Build the active state filter options.
  61.         $options array();
  62.         $options[JHtml::_('select.option''1''JENABLED');
  63.         $options[JHtml::_('select.option''0''JDISABLED');
  64.  
  65.         return $options;
  66.     }
  67.  
  68.     /**
  69.      * Returns an array of standard published state filter options.
  70.      *
  71.      * @return  string    The HTML code for the select tag
  72.      */
  73.     public static function folderOptions()
  74.     {
  75.         $db JFactory::getDbo();
  76.         $query $db->getQuery(true)
  77.             ->select('DISTINCT(folder) AS value, folder AS text')
  78.             ->from('#__extensions')
  79.             ->where($db->quoteName('type'' = ' $db->quote('plugin'))
  80.             ->order('folder');
  81.  
  82.         $db->setQuery($query);
  83.  
  84.         try
  85.         {
  86.             $options $db->loadObjectList();
  87.         }
  88.         catch (RuntimeException $e)
  89.         {
  90.             JError::raiseWarning(500$e->getMessage());
  91.         }
  92.  
  93.         return $options;
  94.     }
  95.  
  96.     public function parseXMLTemplateFile($templateBaseDir$templateDir)
  97.     {
  98.         $data new JObject;
  99.  
  100.         // Check of the xml file exists
  101.         $filePath JPath::clean($templateBaseDir '/templates/' $templateDir '/templateDetails.xml');
  102.         if (is_file($filePath))
  103.         {
  104.             $xml JInstaller::parseXMLInstallFile($filePath);
  105.  
  106.             if ($xml['type'!= 'template')
  107.             {
  108.                 return false;
  109.             }
  110.  
  111.             foreach ($xml as $key => $value)
  112.             {
  113.                 $data->set($key$value);
  114.             }
  115.         }
  116.  
  117.         return $data;
  118.     }
  119. }

Documentation generated on Tue, 19 Nov 2013 15:10:50 +0100 by phpDocumentor 1.4.3