52
0
plg_content_componentbuilde.../componentbuilderlanguagetabs.php

60 lines
1.5 KiB
PHP
Raw Normal View History

2021-10-14 14:30:56 +00:00
<?php
2021-12-16 13:15:06 +00:00
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
2022-08-20 16:38:51 +00:00
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
2021-12-16 13:15:06 +00:00
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
2021-10-14 14:30:56 +00:00
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Form\Form;
/**
* Content - Componentbuilder Language Tabs plugin.
*
* @package ComponentbuilderLanguageTabs
2024-03-11 16:34:39 +00:00
* @since 2.0.0
2021-10-14 14:30:56 +00:00
*/
class PlgContentComponentbuilderLanguageTabs extends CMSPlugin
{
/**
2024-03-11 16:34:39 +00:00
* Affects constructor behaviour. If true, language files will be loaded automatically.
2021-10-14 14:30:56 +00:00
*
* @var boolean
* @since 1.0
*/
protected $autoloadLanguage = true;
/**
* Runs on content preparation of form.
*
2024-03-11 16:34:39 +00:00
* @param Form $form The form
* @param \stdClass $data The data
2021-10-14 14:30:56 +00:00
*
* @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;
}
}