52
0
Fork 0
plg_content_componentbuilde.../componentbuilderlanguagetab...

64 lines
1.7 KiB
PHP

<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\Registry\Registry;
use Joomla\CMS\Form\Form;
JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php');
/**
* Content - Componentbuilder Language Tabs plugin.
*
* @package ComponentbuilderLanguageTabs
* @since 1.0.0
*/
class PlgContentComponentbuilderLanguageTabs extends CMSPlugin
{
/**
* Affects constructor behavior. If true, language files will be loaded automatically.
*
* @var boolean
* @since 1.0
*/
protected $autoloadLanguage = true;
/**
* Runs on content preparation of form.
*
* @param JForm $form The form
* @param stdClass $data The data
*
* @return boolean
*
* @since 1.0
*/
public function onContentPrepareForm(Form $form, $data)
{
$context = $form->getName();
// When this is componentbuilder admin view
if (strpos($context, 'com_componentbuilder.joomla_component') === 0)
{
// Add the forms path
Form::addFormPath(__DIR__ . '/forms');
// add the admin view params for privacy integration
$form->loadFile('joomla_component');
}
return true;
}
}