CoreFiles by mySites.guru
templates.php53 lines, 1,111 bytes, from Joomla_4.0.0-beta1-Beta-Full_Package.zip
Raw History Compare with 3.9.0-beta4
md5
e2223be37ee4d0fb7387638dc9c03ebd
sha1
656b2ecb17e657b7ce9e6c701b17f03b06a50841
sha256
febbf3055bd0d618367644b3f46a5b04fc76db508c3d090fb02dafa8bf37160f
<?php
/**
 * @package     Joomla.Templates
 * @subpackage  Webservices.Templates
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
 * @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 5 releases, Joomla 4.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.