Permalink
Browse files

Coding Conventions , more code cleanup .

  • Loading branch information...
1 parent 6cb4412 commit 90fdc0c32a5d5ca66cd5279b3ae6e366a39b53d1 @vikas-srivastava committed Dec 27, 2012
@@ -196,7 +196,7 @@ public function getExtensionData() {
*
* @return array
*/
- function show() {
+ public function show() {
if($ExtensionData = $this->getExtensionData($this->type)) {
$Data = array(
@@ -214,7 +214,7 @@ function show() {
return $this->customise($Data)->renderWith(array($this->type.'_show', 'Page'));
}
else{
- return $this->httpError(404, "Sorry that $this->type could not be found");
+ return $this->httpError(404, "Sorry $this->type could not be found");
}
}
}
@@ -92,7 +92,7 @@ public function cloneJson() {
*
* @return boolean
*/
- function saveJson() {
+ public function saveJson() {
$ExtensionData = new ExtensionData();
$ExtensionData->SubmittedByID = Member::currentUserID();
$result = $this->dataFields($ExtensionData);
@@ -104,7 +104,7 @@ function saveJson() {
*
* @return boolean
*/
- function updateJson() {
+ public function updateJson() {
$ExtensionData = ExtensionData::get()->filter(array("Title" => $this->latestReleasePackage->getPrettyName()))->First();
@@ -123,7 +123,7 @@ function updateJson() {
* @param object $ExtensionData
* @return boolean
*/
- function dataFields($ExtensionData) {
+ public function dataFields($ExtensionData) {
$saveDataFields = array();
try{
$ExtensionData->Url = $this->url;
@@ -11,8 +11,12 @@ class ExtensionHolder extends Page {
}
class ExtensionHolder_Controller extends Page_Controller {
- public $addContent, $afterEditContent,$latestReleasePackage;
- public $extensionName, $mailData, $extensionType;
+ public $addContent;
+ public $afterEditContent;
+ public $latestReleasePackage;
+ public $extensionName;
+ public $mailData;
+ public $extensionType;
/**
* Setting up the form.
@@ -162,10 +166,10 @@ private function sendMailtoAdmin() {
*
* @return boolean $form
*/
- public function ExtensionSearch() {
+ public function extensionSearch() {
$context = singleton('ExtensionData')->getCustomSearchContext();
$fields = $context->getSearchFields();
- $form = new Form($this, "ExtensionSearch",
+ $form = new Form($this, "extensionSearch",
$fields,
new FieldList(
new FormAction('doSearch' , "Search $this->extensionType" )
@@ -57,7 +57,7 @@ public function init() {
*
* @return Array .
*/
- function ModuleSubmissionForm() {
+ public function ModuleSubmissionForm() {
$formSectionData = new DataObject();
$formSectionData->Form = $this->AddForm($this->extensionType);
$formSectionData->Content = $this->dataRecord->AddContent;
@@ -69,7 +69,7 @@ function ModuleSubmissionForm() {
*
* @return Array .
*/
- function moduleList() {
+ public function ModuleList() {
$modules = ExtensionData::get()->filter(array('Type' => 'Module', 'Accepted' => '1'))->sort('Name');
return $modules;
}
@@ -79,7 +79,7 @@ function moduleList() {
*
* @return Array .
*/
- function moduleSearch(){
- return $this->ExtensionSearch();
+ public function ModuleSearch(){
+ return $this->extensionSearch();
}
}
@@ -59,7 +59,7 @@ public function init() {
*
* @return Array .
*/
- function ThemeSubmissionForm() {
+ public function ThemeSubmissionForm() {
$formSectionData = new DataObject();
$formSectionData->Form = $this->AddForm($this->extensionType);
$formSectionData->Content = $this->dataRecord->AddContent;
@@ -71,7 +71,7 @@ function ThemeSubmissionForm() {
*
* @return Array .
*/
- function themeList() {
+ public function ThemeList() {
$themes = ExtensionData::get()->filter(array('Type' => 'Theme','Accepted' => '1'))->sort('Name');
return $themes;
}
@@ -81,7 +81,7 @@ function themeList() {
*
* @return Array .
*/
- function themeSearch(){
- return $this->ExtensionSearch();
+ public function ThemeSearch(){
+ return $this->extensionSearch();
}
}
@@ -31,7 +31,7 @@ class WidgetHolder extends ExtensionHolder {
);
- function getCMSFields() {
+ public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Main", new HTMLEditorField("AddContent", "Content for 'add' page"));
return $fields;
@@ -59,7 +59,7 @@ public function init() {
*
* @return Array .
*/
- function WidgetSubmissionForm() {
+ public function WidgetSubmissionForm() {
$formSectionData = new DataObject();
$formSectionData->Form = $this->AddForm($this->extensionType);
$formSectionData->Content = $this->dataRecord->AddContent;
@@ -71,7 +71,7 @@ function WidgetSubmissionForm() {
*
* @return Array .
*/
- function widgetList() {
+ public function WidgetList() {
$modules = ExtensionData::get()->filter(array('Type' => 'Widget','Accepted' => '1'))->sort('Name');
return $modules;
}
@@ -81,7 +81,7 @@ function widgetList() {
*
* @return Array .
*/
- function widgetSearch(){
- return $this->ExtensionSearch();
+ public function WidgetSearch(){
+ return $this->extensionSearch();
}
}
@@ -4,9 +4,9 @@
</article>
<div style= "float:Left; width:70%;">
- <% if moduleSearch %>
+ <% if ModuleSearch %>
<h1>Search Module</h1>
- $moduleSearch
+ $ModuleSearch
<% end_if %>
</div>
@@ -5,8 +5,11 @@
<div style= "float:Left; width:70%;">
+ <% if ThemeSearch %>
<h1>Search Theme</h1>
<% include ExtensionSearchForm %>
+ $ThemeSearch
+ <% end_if %>
</div>
@@ -4,9 +4,9 @@
</article>
<div style= "float:Left; width:70%;">
- <% if widgetSearch %>
+ <% if WidgetSearch %>
<h1>Search Widget</h1>
- $widgetSearch
+ $WidgetSearch
<% end_if %>
</div>
@@ -18,7 +18,7 @@
<div>
<h3>Available Widgets</h3>
<%if WidgetList %>
- <% loop widgetList %>
+ <% loop WidgetList %>
<li><a href="widget/show/$ID">$Name</a></li>
<% end_loop %>
<% end_if %>

0 comments on commit 90fdc0c

Please sign in to comment.