Added the new placeholder area for global & component level placeholders. Just like customcode you can now with the placeholders generate dynamic behaviour with placeholders all over the JCB custom areas.

This commit is contained in:
2019-02-16 00:03:21 +02:00
parent d46459301c
commit 25c14b45de
84 changed files with 7147 additions and 42 deletions

View File

@ -1179,6 +1179,20 @@ abstract class ComponentbuilderHelper
return false;
}
/**
* validate that a placeholder is unique
**/
public static function validateUniquePlaceholder($string)
{
$string = self::safeString($string);
// this list may grow as we find more cases that break the compiler (just open an issue on github)
if (in_array($string, array('component', 'view', 'views')))
{
return false;
}
return true;
}
/**
* The array of dynamic content
*
@ -4476,6 +4490,10 @@ abstract class ComponentbuilderHelper
{
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_CUSTOM_CODES'), 'index.php?option=com_componentbuilder&view=custom_codes', $submenu === 'custom_codes');
}
if ($user->authorise('placeholder.access', 'com_componentbuilder') && $user->authorise('placeholder.submenu', 'com_componentbuilder'))
{
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_PLACEHOLDERS'), 'index.php?option=com_componentbuilder&view=placeholders', $submenu === 'placeholders');
}
if ($user->authorise('library.access', 'com_componentbuilder') && $user->authorise('library.submenu', 'com_componentbuilder'))
{
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_LIBRARIES'), 'index.php?option=com_componentbuilder&view=libraries', $submenu === 'libraries');