CoreFiles by mySites.guru
templates.php53 lines, 1,098 bytes, from Joomla_4.0.2-Stable-Full_Package.zip
Raw History Compare with 4.0.1
md5
1a1c83f416a631312deaf149eac2daae
sha1
094ffa92d0f727608d7dfe9b2f9a942bd3ab1c74
sha256
f4c1849ba5ee2040c1d1ec34f0947f929761ef570e0d0f366646bb3375925cc7
<?php
/**
 * @package     Joomla.Templates
 * @subpackage  Webservices.Templates
 *
 * @copyright   (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Router\ApiRouter;

/**
 * Web Services adapter for com_templates.
 *
 * @since  4.0.0
 */
class PlgWebservicesTemplates extends CMSPlugin
{
	/**
	 * Load the language file on instantiation.
	 *
	 * @var    boolean
	 * @since  4.0.0
	 */
	protected $autoloadLanguage = true;

	/**
	 * Registers com_templates's API's routes in the application
	 *
	 * @param   ApiRouter  &$router  The API Routing object
	 *
	 * @return  void
	 *
	 * @since   4.0.0
	 */
	public function onBeforeApiRoute(&$router)
	{
		$router->createCRUDRoutes(
			'v1/templates/styles/site',
			'styles',
			['component' => 'com_templates', 'client_id' => 0]
		);

		$router->createCRUDRoutes(
			'v1/templates/styles/administrator',
			'styles',
			['component' => 'com_templates', 'client_id' => 1]
		);
	}
}

The same content is in 51 releases, Joomla 4.0.0-beta6 to 4.2.0-beta2. See them all, or every version of this file.