-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Communities Page and added CatalogPage extension to page types as well as lumberjack TODO Get Lumberjack working on MunicipalityPage
- Loading branch information
Richard Rudy
committed
Aug 30, 2015
1 parent
3f601f1
commit 2c654b0
Showing
7 changed files
with
216 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,5 @@ | |
.Spotlight-V100 | ||
.Trashes | ||
ehthumbs.db | ||
Thumbs.db | ||
Thumbs.db | ||
code/.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<?php | ||
|
||
class CommunitiesHolder extends Page { | ||
|
||
/** | ||
* Static vars | ||
* ----------------------------------*/ | ||
|
||
private static $allowed_children = array( | ||
'MunicipalityPage' | ||
); | ||
|
||
/** | ||
* Object vars | ||
* ----------------------------------*/ | ||
|
||
|
||
|
||
/** | ||
* Static methods | ||
* ----------------------------------*/ | ||
|
||
|
||
|
||
/** | ||
* Data model | ||
* ----------------------------------*/ | ||
|
||
private static $db = array ( | ||
|
||
); | ||
|
||
/** | ||
* Common methods | ||
* ----------------------------------*/ | ||
|
||
public function getCMSFields() { | ||
$fields = parent::getCMSFIelds(); | ||
|
||
//Create a list of Towns | ||
$sqlQuery = new SQLQuery(); | ||
$sqlQuery->setFrom('Listing'); | ||
$sqlQuery->setWhere('CityID = 0'); | ||
$sqlQuery->selectField('Town'); | ||
$sqlQuery->setDistinct(true); | ||
$result = $sqlQuery->execute(); | ||
|
||
$townList = '<ul>'; | ||
|
||
foreach($result as $row){ | ||
$townList = $townList.'<li>'.$row['Town'].'</li>'; | ||
} | ||
|
||
$townList = $townList.'</ul>'; | ||
|
||
$townDisplay = LiteralField::create('TownList', $townList); | ||
|
||
$fields->addFieldsToTab('Root.ChildPages', array( | ||
HeaderField::create('TownHeader', 'Other Towns Used', 2), | ||
$townDisplay | ||
)); | ||
|
||
//Reorder Main Tab | ||
$mainTab = $fields->fieldByName('Root.Main'); | ||
$fields->removeByName('Main'); | ||
|
||
$fields->findOrMakeTab('Root.Main', $mainTab); | ||
|
||
return $fields; | ||
} | ||
|
||
public function getLumberjackTitle() { | ||
return "Cities"; | ||
} | ||
|
||
/** | ||
* Accessor methods | ||
* ----------------------------------*/ | ||
|
||
|
||
|
||
/** | ||
* Controller actions | ||
* ----------------------------------*/ | ||
|
||
|
||
|
||
/** | ||
* Template accessors | ||
* ----------------------------------*/ | ||
|
||
|
||
|
||
/** | ||
* Object methods | ||
* ----------------------------------*/ | ||
|
||
|
||
|
||
|
||
} | ||
|
||
|
||
class CommunitiesHolder_Controller extends Page_Controller { | ||
|
||
private static $allowed_actions = array ( | ||
); | ||
|
||
public function init() { | ||
parent::init(); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters