Skip to content

Commit

Permalink
#2 fix page architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
1stthomas committed May 24, 2021
1 parent 7a84145 commit c747358
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 132 deletions.
5 changes: 0 additions & 5 deletions controllers/single_page/dashboard/ht7.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
class Ht7 extends DashboardPageController
{

public function getCollectionDescription()
{
return t("Ht7 Starting Page");
}

public function view()
{
$c = Page::getCurrentPage();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Concrete\Package\Ht7C5Base\Controller\SinglePage\Dashboard\Ht7\Settings;
namespace Concrete\Package\Ht7C5Base\Controller\SinglePage\Dashboard\Ht7;

use \Concrete\Core\Page\Controller\DashboardPageController;
use \Concrete\Core\Page\Page;
Expand All @@ -10,11 +10,6 @@
class Blocks extends DashboardPageController
{

public function getCollectionDescription()
{
return t("Main settings page for ht7 blocks");
}

public function view()
{
$c = Page::getCurrentPage();
Expand Down
30 changes: 0 additions & 30 deletions controllers/single_page/dashboard/ht7/environment/packages.php

This file was deleted.

25 changes: 0 additions & 25 deletions controllers/single_page/dashboard/ht7/ht7_servers.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@

defined('C5_EXECUTE') or die('Access Denied.');

class Environment extends DashboardPageController
class Servers extends DashboardPageController
{

public function getCollectionDescription()
{
return t("Default Settings Page for Ht7 Tools.");
}

public function view()
{
$c = Page::getCurrentPage();
Expand Down
25 changes: 0 additions & 25 deletions controllers/single_page/dashboard/ht7/settings.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
defined('C5_EXECUTE') or die('Access Denied.');
?>
<div class=" ccm-dashboard-section-menu">
<?php if (count($pages)): ?>
<?php foreach ($pages as $page): ?>
<?php if (count($pages)) { ?>
<?php foreach ($pages as $page) { ?>
<p>
<a
href="<?= $page->getCollectionLink(); ?>"
title="<?= $page->getCollectionDescription(); ?>"
><?= $page->getCollectionName(); ?>
</a>
</p>
<?php endforeach; ?>
<?php else: ?>
<?php } ?>
<?php } elseif ($showEmptyText) { ?>
<p><?= t('No pages found'); ?></p>
<?php endif; ?>
<?php } ?>
</div>
7 changes: 2 additions & 5 deletions install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
<concrete5-cif version="1.0">
<singlepages>
<page name="ht7" path="/dashboard/ht7" filename="/dashboard/ht7.php" pagetype="" description="Ht7 Starting Page" package="ht7_c5_base"></page>
<page name="Environment" path="/dashboard/ht7/environment" filename="/dashboard/ht7/environment.php" pagetype="" description="" package="ht7_c5_base"></page>
<page name="Packages" path="/dashboard/ht7/environment/packages" filename="/dashboard/ht7/environment/packages.php" pagetype="" description="Main ht7 packages page" package="ht7_c5_base"></page>
<page name="Settings" path="/dashboard/ht7/settings" filename="/dashboard/ht7/settings.php" pagetype="" description="Main settings page" package="ht7_c5_base"></page>
<page name="Blocks" path="/dashboard/ht7/settings/blocks" filename="/dashboard/ht7/settings/blocks.php" pagetype="" description="Main settings page for ht7 blocks" package="ht7_c5_base"></page>
<page name="ht7 Servers" path="/dashboard/ht7/ht7-servers" filename="/dashboard/ht7/ht7_servers/ht7_servers.php" pagetype="" description="Main page for ht7 servers" package="ht7_c5_base"></page>
<page name="ht7 Block Settings" path="/dashboard/ht7/blocks" filename="/dashboard/ht7/blocks.php" pagetype="" description="Ht7 block settings" package="ht7_c5_base"></page>
<page name="ht7 Server Settings" path="/dashboard/ht7/servers" filename="/dashboard/ht7/servers.php" pagetype="" description="Ht7 server settings" package="ht7_c5_base"></page>
</singlepages>
</concrete5-cif>
31 changes: 18 additions & 13 deletions single_pages/dashboard/ht7.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,32 @@
?>

<div class="row">
<?php foreach ($pages as $key => $page): ?>
<?php if ($key % 3 == 0): ?>
<?php foreach ($pages as $key => $page) { ?>
<?php if ($key % 3 == 0) { ?>
</div>
<div class="row">
<?php endif; ?>
<?php } ?>
<div class="col-md-4 ccm-dashboard-section-menu">
<h2 title="<?= $page->getCollectionDescription(); ?>"><?= $page->getCollectionName(); ?></h2>
<h2 title="<?= $page->getCollectionDescription(); ?>">
<?php echo $page->getCollectionName(); ?>
</h2>
<?php
$children = $page->getCollectionChildren();
if (count($children) > 0):

if (count($children) > 0) {
?>
<?php foreach ($children as $child): ?>
<?php foreach ($children as $child) { ?>
<p>
<a href="<?= $child->getCollectionLink(); ?>" title="<?= $child->getCollectionDescription(); ?>">
<?= $child->getCollectionName(); ?>
<a
href="<?= $child->getCollectionLink(); ?>"
title="<?= $child->getCollectionDescription(); ?>">
<?php echo $child->getCollectionName(); ?>
</a>
</p>
<?php endforeach; ?>
<?php else: ?>
<p><?= t('No page found'); ?></p>
<?php endif; ?>
<?php } ?>
<?php } else { ?>
<p><?php echo t('No page found'); ?></p>
<?php } ?>
</div>
<?php endforeach; ?>
<?php } ?>
</div>
File renamed without changes.
6 changes: 0 additions & 6 deletions single_pages/dashboard/ht7/environment.php

This file was deleted.

6 changes: 0 additions & 6 deletions single_pages/dashboard/ht7/environment/packages.php

This file was deleted.

File renamed without changes.

0 comments on commit c747358

Please sign in to comment.