Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin: Styles appearing according to the available sections of the outline layout #2357

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@version@
5.4.24
4 changes: 2 additions & 2 deletions platforms/common/blueprints/gantry/theme/details.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ form:
version:
type: input.text
label: Version
default: "@version@"
default: "5.4.24"

icon:
type: input.text
Expand All @@ -22,7 +22,7 @@ form:
date:
type: input.text
label: Release Date
default: "@versiondate@"
default: "July 4, 2018"

author.name:
type: input.text
Expand Down
2 changes: 1 addition & 1 deletion platforms/grav/gantry5/blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Gantry 5 Framework
version: '@version@'
version: '5.4.24'
description: Theme framework.
icon: gantry
author:
Expand Down
4 changes: 2 additions & 2 deletions platforms/joomla/com_gantry5/admin/gantry5.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<extension version="3.4" type="component" method="upgrade">
<name>com_gantry5</name>
<version>@version@</version>
<creationDate>@versiondate@</creationDate>
<version>5.4.24</version>
<creationDate>July 4, 2018</creationDate>
<author>RocketTheme, LLC</author>
<authorEmail>support@rockettheme.com</authorEmail>
<authorUrl>http://www.rockettheme.com</authorUrl>
Expand Down
4 changes: 2 additions & 2 deletions platforms/joomla/gantry5_nucleus/gantry5_nucleus.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<extension version="3.4" type="file" method="upgrade">
<name>gantry5_nucleus</name>
<version>@version@</version>
<creationDate>@versiondate@</creationDate>
<version>5.4.24</version>
<creationDate>July 4, 2018</creationDate>
<author>RocketTheme, LLC</author>
<authorEmail>support@rockettheme.com</authorEmail>
<authorUrl>http://www.rockettheme.com</authorUrl>
Expand Down
4 changes: 2 additions & 2 deletions platforms/joomla/lib_gantry5/gantry5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<extension version="3.4" type="library" method="upgrade">
<name>Gantry 5 Framework</name>
<libraryname>gantry5</libraryname>
<version>@version@</version>
<creationDate>@versiondate@</creationDate>
<version>5.4.24</version>
<creationDate>July 4, 2018</creationDate>
<author>RocketTheme, LLC</author>
<authorEmail>support@rockettheme.com</authorEmail>
<authorUrl>http://www.rockettheme.com</authorUrl>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<extension version="3.4" type="module" client="site" method="upgrade">
<name>mod_gantry5_particle</name>
<version>@version@</version>
<creationDate>@versiondate@</creationDate>
<version>5.4.24</version>
<creationDate>July 4, 2018</creationDate>
<author>RocketTheme, LLC</author>
<authorEmail>support@rockettheme.com</authorEmail>
<authorUrl>http://www.rockettheme.com</authorUrl>
Expand Down
18 changes: 9 additions & 9 deletions platforms/joomla/pkg_gantry5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<extension version="3.4" type="package" method="upgrade">
<name>pkg_gantry5</name>
<packagename>gantry5</packagename>
<version>@version@</version>
<creationDate>@versiondate@</creationDate>
<version>5.4.24</version>
<creationDate>July 4, 2018</creationDate>
<author>RocketTheme, LLC</author>
<authorEmail>support@rockettheme.com</authorEmail>
<authorUrl>http://www.rockettheme.com</authorUrl>
Expand All @@ -16,19 +16,19 @@
<blockChildUninstall>true</blockChildUninstall>
<files folder="packages">
<!-- Mandatory system plugin -->
<file type="plugin" group="system" id="gantry5" enabled="1">plg_system_gantry5_v@version@.zip</file>
<file type="plugin" group="system" id="gantry5" enabled="1">plg_system_gantry5_v5.4.24.zip</file>
<!-- Quick icons -->
<file type="plugin" group="quickicon" id="gantry5" enabled="1">plg_quickicon_gantry5_v@version@.zip</file>
<file type="plugin" group="quickicon" id="gantry5" enabled="1">plg_quickicon_gantry5_v5.4.24.zip</file>
<!-- Mandatory system plugin -->
<file type="plugin" group="gantry5" id="preset" >plg_gantry5_preset_v@version@.zip</file>
<file type="plugin" group="gantry5" id="preset" >plg_gantry5_preset_v5.4.24.zip</file>
<!-- Particle module -->
<file type="module" client="site" id="mod_gantry5_particle" enabled="1">mod_gantry5_particle_v@version@.zip</file>
<file type="module" client="site" id="mod_gantry5_particle" enabled="1">mod_gantry5_particle_v5.4.24.zip</file>
<!-- Gantry framework library -->
<file type="library" id="gantry5" enabled="1">lib_gantry5_v@version@.zip</file>
<file type="library" id="gantry5" enabled="1">lib_gantry5_v5.4.24.zip</file>
<!-- Common media files -->
<file type="file" id="gantry5_nucleus" enabled="1">gantry5_nucleus_v@version@.zip</file>
<file type="file" id="gantry5_nucleus" enabled="1">gantry5_nucleus_v5.4.24.zip</file>
<!-- Administration component -->
<file type="component" id="com_gantry5" enabled="1">com_gantry5_v@version@.zip</file>
<file type="component" id="com_gantry5" enabled="1">com_gantry5_v5.4.24.zip</file>
</files>

<languages folder="language">
Expand Down
4 changes: 2 additions & 2 deletions platforms/joomla/plg_gantry5_preset/preset.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<extension version="3.4" type="plugin" group="gantry5" method="upgrade">
<name>plg_gantry5_preset</name>
<version>@version@</version>
<creationDate>@versiondate@</creationDate>
<version>5.4.24</version>
<creationDate>July 4, 2018</creationDate>
<author>RocketTheme, LLC</author>
<authorEmail>support@rockettheme.com</authorEmail>
<authorUrl>http://www.rockettheme.com</authorUrl>
Expand Down
4 changes: 2 additions & 2 deletions platforms/joomla/plg_quickicon_gantry5/gantry5.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<extension version="3.4" type="plugin" group="quickicon" method="upgrade">
<name>plg_quickicon_gantry5</name>
<version>@version@</version>
<creationDate>@versiondate@</creationDate>
<version>5.4.24</version>
<creationDate>July 4, 2018</creationDate>
<author>RocketTheme, LLC</author>
<authorEmail>support@rockettheme.com</authorEmail>
<authorUrl>http://www.rockettheme.com</authorUrl>
Expand Down
4 changes: 2 additions & 2 deletions platforms/joomla/plg_system_gantry5/gantry5.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<extension version="3.4" type="plugin" group="system" method="upgrade">
<name>plg_system_gantry5</name>
<version>@version@</version>
<creationDate>@versiondate@</creationDate>
<version>5.4.24</version>
<creationDate>July 4, 2018</creationDate>
<author>RocketTheme, LLC</author>
<authorEmail>support@rockettheme.com</authorEmail>
<authorUrl>http://www.rockettheme.com</authorUrl>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<extension version="3.4" type="plugin" group="system" method="upgrade">
<name>plg_system_gantry5_debugbar</name>
<version>@version@</version>
<creationDate>@versiondate@</creationDate>
<version>5.4.24</version>
<creationDate>July 4, 2018</creationDate>
<author>RocketTheme, LLC</author>
<authorEmail>support@rockettheme.com</authorEmail>
<authorUrl>http://www.rockettheme.com</authorUrl>
Expand Down
2 changes: 1 addition & 1 deletion platforms/joomla/updates/gantry5_jed.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jedupdate version="1">
<version>@version@</version>
<version>5.4.24</version>

<compatibility>
<version>30</version>
Expand Down
6 changes: 3 additions & 3 deletions platforms/joomla/updates/list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
element="pkg_gantry5"
type="package"
client="site"
version="@version@"
version="5.4.24"
detailsurl="http://updates.gantry.org/5.0/joomla/pkg_gantry5.xml"/>
<extension name="Hydrogen"
description="Hydrogen Template"
element="g5_hydrogen"
type="template"
client="site"
version="@version@"
version="5.4.24"
detailsurl="http://updates.gantry.org/5.0/joomla/tpl_g5_hydrogen.xml"/>
<extension name="Helium"
description="Helium Template"
element="g5_helium"
type="template"
client="site"
version="@version@"
version="5.4.24"
detailsurl="http://updates.gantry.org/5.0/joomla/tpl_g5_helium.xml"/>
</extensionset>
6 changes: 3 additions & 3 deletions platforms/joomla/updates/pkg_gantry5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<description>Gantry Framework</description>
<element>pkg_gantry5</element>
<type>package</type>
<version>@version@</version>
<infourl title="Gantry @version@">http://docs.gantry.org/gantry5</infourl>
<version>5.4.24</version>
<infourl title="Gantry 5.4.24">http://docs.gantry.org/gantry5</infourl>
<downloads>
<downloadurl type="full" format="zip">http://updates.gantry.org/download/@version@/joomla-pkg_gantry5_v@version@.zip</downloadurl>
<downloadurl type="full" format="zip">http://updates.gantry.org/download/5.4.24/joomla-pkg_gantry5_v5.4.24.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
Expand Down
6 changes: 3 additions & 3 deletions platforms/joomla/updates/tpl_g5_helium.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<description>Helium Template</description>
<element>g5_helium</element>
<type>template</type>
<version>@version@</version>
<infourl title="Helium @version@">http://docs.gantry.org/gantry5</infourl>
<version>5.4.24</version>
<infourl title="Helium 5.4.24">http://docs.gantry.org/gantry5</infourl>
<downloads>
<downloadurl type="full" format="zip">http://updates.gantry.org/download/@version@/joomla-tpl_g5_helium_v@version@.zip</downloadurl>
<downloadurl type="full" format="zip">http://updates.gantry.org/download/5.4.24/joomla-tpl_g5_helium_v5.4.24.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
Expand Down
6 changes: 3 additions & 3 deletions platforms/joomla/updates/tpl_g5_hydrogen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<description>Hydrogen Template</description>
<element>g5_hydrogen</element>
<type>template</type>
<version>@version@</version>
<infourl title="Hydrogen @version@">http://docs.gantry.org/gantry5</infourl>
<version>5.4.24</version>
<infourl title="Hydrogen 5.4.24">http://docs.gantry.org/gantry5</infourl>
<downloads>
<downloadurl type="full" format="zip">http://updates.gantry.org/download/@version@/joomla-tpl_g5_hydrogen_v@version@.zip</downloadurl>
<downloadurl type="full" format="zip">http://updates.gantry.org/download/5.4.24/joomla-tpl_g5_hydrogen_v5.4.24.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
Expand Down
4 changes: 2 additions & 2 deletions src/RealLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public static function getClassLoader()
throw new \LogicException(self::$errorMessageGantryLoaded);
}

define('GANTRY5_VERSION', '@version@');
define('GANTRY5_VERSION_DATE', '@versiondate@');
define('GANTRY5_VERSION', '5.4.24');
define('GANTRY5_VERSION_DATE', 'July 4, 2018');

if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function index()
$this->params['data'] = ConfigServiceProvider::load($this->container, $outline, false, false);
}

$this->params['blocks'] = $this->container['styles']->group();
$this->params['blocks'] = $this->container['styles']->group($outline);
$this->params['route'] = "configurations.{$outline}.styles";

return $this->render('@gantry-admin/pages/configurations/styles/styles.html.twig', $this->params);
Expand Down
36 changes: 31 additions & 5 deletions src/classes/Gantry/Admin/Styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,42 @@ public function all()
return $this->blocks;
}

public function group()
public function group($outline = null)
{
$blocks = $this->all();
if (!is_null($outline))
{
$locator = $this->container['locator'];
$outline = $locator->findResource("gantry-layouts://{$outline}.yaml");
$outline = CompiledYamlFile::instance($outline);
$available_sections = $outline->content()['layout'];
$outline_styles = [];
foreach ($available_sections as $k=>$section)
{
$outline_styles[] = str_replace('/','',$k);
}
}

$blocks = $this->all();
$list = [];
foreach ($blocks as $name => $style) {
$type = isset($style['type']) ? $style['type'] : 'block';
$list[$type][$name] = $style;
if (!isset($outline_styles))
{
foreach ($blocks as $name => $style) {

$type = isset($style['type']) ? $style['type'] : 'block';
$list[$type][$name] = $style;
}
}
else
{
foreach ($blocks as $name => $style) {
$type = isset($style['type']) ? $style['type'] : 'block';

if ($type !== 'section' || ($type === 'section' && in_array($name, $outline_styles)))
{
$list[$type][$name] = $style;
}
}
}
return $this->sort($list);
}

Expand Down
4 changes: 2 additions & 2 deletions themes/base/joomla/templateDetails.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<extension version="3.4" type="template" client="site" method="upgrade">
<name>g5_base</name>
<version>@version@</version>
<creationDate>@versiondate@</creationDate>
<version>5.4.24</version>
<creationDate>July 4, 2018</creationDate>
<author>RocketTheme, LLC</author>
<authorEmail>support@rockettheme.com</authorEmail>
<authorUrl>http://www.rockettheme.com</authorUrl>
Expand Down
4 changes: 2 additions & 2 deletions themes/helium-child/wordpress/gantry/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
details:
name: Helium Child
version: @version@
version: 5.4.24
icon: paper-plane
date: @versiondate@
date: July 4, 2018
author:
name: RocketTheme, LLC
email: support@rockettheme.com
Expand Down
2 changes: 1 addition & 1 deletion themes/helium/grav/blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Helium
version: "@version@"
version: "5.4.24"
description: "Default Gantry 5 theme."
icon: gantry
author:
Expand Down
4 changes: 2 additions & 2 deletions themes/helium/grav/gantry/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
details:
name: Helium
version: '@version@'
version: '5.4.24'
icon: paper-plane
date: '@versiondate@'
date: 'July 4, 2018'
author:
name: RocketTheme, LLC
email: support@rockettheme.com
Expand Down
4 changes: 2 additions & 2 deletions themes/helium/joomla/gantry/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
details:
name: Helium
version: '@version@'
version: '5.4.24'
icon: paper-plane
date: '@versiondate@'
date: 'July 4, 2018'
author:
name: RocketTheme, LLC
email: support@rockettheme.com
Expand Down
4 changes: 2 additions & 2 deletions themes/helium/joomla/templateDetails.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<extension version="3.4" type="template" client="site" method="upgrade">
<name>g5_helium</name>
<version>@version@</version>
<creationDate>@versiondate@</creationDate>
<version>5.4.24</version>
<creationDate>July 4, 2018</creationDate>
<author>RocketTheme, LLC</author>
<authorEmail>support@rockettheme.com</authorEmail>
<authorUrl>http://www.rockettheme.com</authorUrl>
Expand Down
4 changes: 2 additions & 2 deletions themes/helium/prime/gantry/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
details:
name: Helium
version: '@version@'
version: '5.4.24'
icon: paper-plane
date: '@versiondate@'
date: 'July 4, 2018'
author:
name: RocketTheme, LLC
email: support@rockettheme.com
Expand Down
4 changes: 2 additions & 2 deletions themes/helium/wordpress/gantry/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
details:
name: Helium
version: '@version@'
version: '5.4.24'
icon: paper-plane
date: '@versiondate@'
date: 'July 4, 2018'
author:
name: RocketTheme, LLC
email: support@rockettheme.com
Expand Down
4 changes: 2 additions & 2 deletions themes/hydrogen-child/wordpress/gantry/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
details:
name: Hydrogen Child
version: "@version@"
version: "5.4.24"
icon: paper-plane
date: @versiondate@
date: July 4, 2018
author:
name: RocketTheme, LLC
email: support@rockettheme.com
Expand Down
2 changes: 1 addition & 1 deletion themes/hydrogen/grav/blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Hydrogen
version: "@version@"
version: "5.4.24"
description: "Default Gantry 5 theme."
icon: gantry
author:
Expand Down