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

Remove trailing spaces in the source code #18

Open
wants to merge 1 commit 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions code/Catalogue.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@

/**
* Object designed to allow injection of catalogue global settings into
* templates without having to flood the base controller with methods
*
* templates without having to flood the base controller with methods
*
* @author i-lateral (http://www.i-lateral.com)
* @package catalogue
*/
class Catalogue extends ViewableData
{

/**
* Show price including tax in catalogue and product pages?
*
*
* @var Boolean
* @config
*/
private static $price_includes_tax = true;

/**
* Use this setting to disable the frontend product and category
* pages (useful if you are building only a product management
* system, etc).
*
*
* @var Boolean
* @config
*/
private static $enable_frontend = true;

/**
* Gets a list of all Categories, either top level (default) or
* from a sub level
Expand Down
38 changes: 19 additions & 19 deletions code/admin/CatalogueAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
*/
class CatalogueAdmin extends ModelAdmin
{

/**
* Set the page length for products
*
*
* @config
*/
private static $product_page_length = 20;

/**
* Set the page length for categories
*
*
* @config
*/
private static $category_page_length = 20;

private static $url_segment = 'catalogue';

private static $menu_title = 'Catalogue';
Expand All @@ -45,14 +45,14 @@ public function init()
{
parent::init();
}

public function getExportFields()
{
$fields = array(
"Title" => "Title",
"URLSegment" => "URLSegment"
);

if ($this->modelClass == 'Product') {
$fields["StockID"] = "StockID";
$fields["ClassName"] = "Type";
Expand All @@ -62,16 +62,16 @@ public function getExportFields()
$fields["Categories.first.Title"] = "Category1";
$fields["Content"] = "Content";
}

$this->extend("updateExportFields", $fields);

return $fields;
}

public function getList()
{
$list = parent::getList();

// Filter categories
if ($this->modelClass == 'Category') {
$parentID = $this->request->requestVar('ParentID');
Expand All @@ -81,7 +81,7 @@ public function getList()

$list = $list->filter('ParentID', $parentID);
}

$this->extend('updateList', $list);

return $list;
Expand All @@ -91,18 +91,18 @@ public function getEditForm($id = null, $fields = null)
{
$form = parent::getEditForm($id, $fields);
$params = $this->request->requestVar('q');


// Bulk manager
$manager = new GridFieldBulkManager();
$manager->removeBulkAction("unLink");

$manager->addBulkAction(
'disable',
'Disable',
'CatalogueProductBulkAction'
);

$manager->addBulkAction(
'enable',
'Enable',
Expand All @@ -126,8 +126,8 @@ public function getEditForm($id = null, $fields = null)
$manager,
new CatalogueEnableDisableDetailForm()
);


// Set the page length
$field_config
->getComponentByType('GridFieldPaginator')
Expand All @@ -144,7 +144,7 @@ public function getEditForm($id = null, $fields = null)
$gridField->setList($list);
}
}

// Alterations for Hiarachy on product cataloge
if ($this->modelClass == 'Category') {
$gridField = $form->Fields()->fieldByName('Category');
Expand All @@ -170,7 +170,7 @@ public function getEditForm($id = null, $fields = null)
$manager,
GridFieldOrderableRows::create('Sort')
);

// Set the page length
$field_config
->getComponentByType('GridFieldPaginator')
Expand Down
4 changes: 2 additions & 2 deletions code/controller/CatalogueCategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct($dataRecord = null)
$dataRecord->URLSegment = get_class($this);
$dataRecord->ID = -1;
}

$this->dataRecord = $dataRecord;
$this->failover = $this->dataRecord;
parent::__construct();
Expand Down Expand Up @@ -81,7 +81,7 @@ public function index()

return $this->renderWith($return);
}

/**
* Returns a fixed navigation menu of the given level.
* @return SS_List
Expand Down
16 changes: 8 additions & 8 deletions code/controller/CatalogueController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ public function setDataRecord($dataRecord)
$this->dataRecord = $dataRecord;
return $this;
}

public function init()
{
parent::init();

// Use theme from the site config
if (($config = SiteConfig::current_site_config()) && $config->Theme) {
Config::inst()->update('SSViewer', 'theme', $config->Theme);
}
}

/**
* Return the link to this controller, but force the expanded link to be returned so that form methods and
* similar will function properly.
Expand All @@ -54,12 +54,12 @@ public function Link($action = null)
{
return $this->data()->Link(($action ? $action : true));
}

/**
* Return the title, description, keywords and language metatags.
*
*
* @todo Move <title> tag in separate getter for easier customization and more obvious usage
*
*
* @param boolean|string $includeTitle Show default <title>-tag, set to false for custom templating
* @return string The XHTML metatags
*/
Expand All @@ -83,7 +83,7 @@ public function MetaTags($includeTitle = true)
if ($this->ExtraMeta) {
$tags .= $this->ExtraMeta . "\n";
}

if (Permission::check('CMS_ACCESS_CMSMain') && in_array('CMSPreviewable', class_implements($this)) && !$this instanceof ErrorPage) {
$tags .= "<meta name=\"x-page-id\" content=\"{$this->ID}\" />\n";
$tags .= "<meta name=\"x-cms-edit-link\" content=\"" . $this->CMSEditLink() . "\" />\n";
Expand Down Expand Up @@ -137,7 +137,7 @@ public function results($data, $form, $request)
'Page'
));
}

public function SiteConfig()
{
if (method_exists($this->dataRecord, 'getSiteConfig')) {
Expand Down
36 changes: 18 additions & 18 deletions code/controller/CatalogueProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class CatalogueProductController extends CatalogueController
{

/**
* Template names to be removed from the default template list
*
* Template names to be removed from the default template list
*
* @var array
* @config
*/
Expand Down Expand Up @@ -53,12 +53,12 @@ public function __construct($dataRecord = null)
$dataRecord->URLSegment = get_class($this);
$dataRecord->ID = -1;
}

$this->dataRecord = $dataRecord;
$this->failover = $this->dataRecord;
parent::__construct();
}

protected function get_index_templates()
{
$classes = ClassInfo::ancestry($this->dataRecord->class);
Expand All @@ -73,10 +73,10 @@ protected function get_index_templates()
$return[] = $class;
}
}

return $return;
}

/**
* The productimage action is used to determine the default image that will
* appear related to a product
Expand All @@ -98,7 +98,7 @@ public function getImageForProduct()
if (!$image) {
$image = $images->first();
}

$this->extend("updateImageForProduct", $image);

return $image;
Expand All @@ -110,32 +110,32 @@ public function getImageForProduct()
public function index()
{
$this->customise(array("ProductImage" => $this->getImageForProduct()));

$this->extend("onBeforeIndex");

return $this->renderWith($this->get_index_templates());
}

/**
* Get a list of templates to call and return a default render with
*/
public function iid()
{
$this->customise(array("ProductImage" => $this->getImageForProduct()));

$this->extend("onBeforeIndex");

return $this->renderWith($this->get_index_templates());
}



/**
* Create a form to associate with this product, by default it will
* be empty, but is intended to be easily extendable to allow "add
* item to cart", or "get a quote" functionality.
*
* @return Form
*
* @return Form
*/
public function Form()
{
Expand All @@ -146,9 +146,9 @@ public function Form()
FieldList::create(),
new RequiredFields(array())
);

$this->extend("updateForm", $form);

return $form;
}
}
Loading