Skip to content

Commit

Permalink
[com_banners]Code style Fixes #10602
Browse files Browse the repository at this point in the history
  • Loading branch information
wojsmol authored and roland-d committed May 26, 2016
1 parent 036db0e commit 43936b1
Show file tree
Hide file tree
Showing 21 changed files with 636 additions and 348 deletions.
76 changes: 65 additions & 11 deletions administrator/components/com_banners/access.xml
@@ -1,18 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<access component="com_banners">
<section name="component">
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
<action name="core.options" title="JACTION_OPTIONS" description="JACTION_OPTIONS_COMPONENT_DESC" />
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" />
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" />
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC" />
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_COMPONENT_DESC" />
<action
name="core.admin"
description="JACTION_ADMIN_COMPONENT_DESC"
title="JACTION_ADMIN"
/>

<action
name="core.options"
description="JACTION_OPTIONS_COMPONENT_DESC"
title="JACTION_OPTIONS"
/>

<action
name="core.manage"
description="JACTION_MANAGE_COMPONENT_DESC"
title="JACTION_MANAGE"
/>

<action
name="core.create"
description="JACTION_CREATE_COMPONENT_DESC"
title="JACTION_CREATE"
/>

<action
name="core.delete"
description="JACTION_DELETE_COMPONENT_DESC"
title="JACTION_DELETE"
/>

<action
name="core.edit"
description="JACTION_EDIT_COMPONENT_DESC"
title="JACTION_EDIT"
/>

<action
name="core.edit.state"
description="JACTION_EDITSTATE_COMPONENT_DESC"
title="JACTION_EDITSTATE"
/>

</section>
<section name="category">
<action name="core.create" title="JACTION_CREATE" description="COM_CATEGORIES_ACCESS_CREATE_DESC" />
<action name="core.delete" title="JACTION_DELETE" description="COM_CATEGORIES_ACCESS_DELETE_DESC" />
<action name="core.edit" title="JACTION_EDIT" description="COM_CATEGORIES_ACCESS_EDIT_DESC" />
<action name="core.edit.state" title="JACTION_EDITSTATE" description="COM_CATEGORIES_ACCESS_EDITSTATE_DESC" />
<action
name="core.create"
description="COM_CATEGORIES_ACCESS_CREATE_DESC"
title="JACTION_CREATE"
/>

<action
name="core.delete"
description="COM_CATEGORIES_ACCESS_DELETE_DESC"
title="JACTION_DELETE"
/>

<action
name="core.edit"
description="COM_CATEGORIES_ACCESS_EDIT_DESC"
title="JACTION_EDIT"
/>

<action
name="core.edit.state"
description="COM_CATEGORIES_ACCESS_EDITSTATE_DESC"
title="JACTION_EDITSTATE"
/>
</section>
</access>
40 changes: 32 additions & 8 deletions administrator/components/com_banners/banners.xml
Expand Up @@ -35,14 +35,38 @@
Note that all & must be escaped to &amp; for the file to be valid
XML and be parsed by the installer
-->
<menu link="option=com_banners" view="banners" img="class:banners"
alt="Banners/Banners">com_banners_banners</menu>
<menu link="option=com_categories&amp;extension=com_banners"
view="categories" img="class:banners-cat" alt="Banners/Categories">com_banners_categories</menu>
<menu link="option=com_banners&amp;view=clients" view="clients"
img="class:banners-clients" alt="Banners/Clients">com_banners_clients</menu>
<menu link="option=com_banners&amp;view=tracks" view="tracks"
img="class:banners-tracks" alt="Banners/Tracks">com_banners_tracks</menu>
<menu
link="option=com_banners"
view="banners"
img="class:banners"
alt="Banners/Banners"
>
com_banners_banners
</menu>
<menu
link="option=com_categories&amp;extension=com_banners"
view="categories"
img="class:banners-cat"
alt="Banners/Categories"
>
com_banners_categories
</menu>
<menu
link="option=com_banners&amp;view=clients"
view="clients"
img="class:banners-clients"
alt="Banners/Clients"
>
com_banners_clients
</menu>
<menu
link="option=com_banners&amp;view=tracks"
view="tracks"
img="class:banners-tracks"
alt="Banners/Tracks"
>
com_banners_tracks
</menu>
</submenu>
<files folder="admin">
<filename>access.xml</filename>
Expand Down
69 changes: 34 additions & 35 deletions administrator/components/com_banners/config.xml
@@ -1,48 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<config>
<fieldset name="component"
<fieldset
name="component"
label="COM_BANNERS_FIELDSET_CONFIG_CLIENT_OPTIONS_LABEL"
description="COM_BANNERS_FIELDSET_CONFIG_CLIENT_OPTIONS_DESC">
description="COM_BANNERS_FIELDSET_CONFIG_CLIENT_OPTIONS_DESC"
>

<field
id="purchase_type"
name="purchase_type"
type="list"
label="COM_BANNERS_FIELD_PURCHASETYPE_LABEL"
description="COM_BANNERS_FIELD_PURCHASETYPE_DESC"
id="purchase_type"
default="0"
>
<option
value="1">COM_BANNERS_FIELD_VALUE_UNLIMITED</option>
<option
value="2">COM_BANNERS_FIELD_VALUE_YEARLY</option>
<option
value="3">COM_BANNERS_FIELD_VALUE_MONTHLY</option>
<option
value="4">COM_BANNERS_FIELD_VALUE_WEEKLY</option>
<option
value="5">COM_BANNERS_FIELD_VALUE_DAILY</option>
<option value="1">COM_BANNERS_FIELD_VALUE_UNLIMITED</option>
<option value="2">COM_BANNERS_FIELD_VALUE_YEARLY</option>
<option value="3">COM_BANNERS_FIELD_VALUE_MONTHLY</option>
<option value="4">COM_BANNERS_FIELD_VALUE_WEEKLY</option>
<option value="5">COM_BANNERS_FIELD_VALUE_DAILY</option>
</field>

<field
name="track_impressions"
type="radio"
label="COM_BANNERS_FIELD_TRACKIMPRESSION_LABEL"
description="COM_BANNERS_FIELD_TRACKIMPRESSION_DESC"
class="btn-group btn-group-yesno"
default="0"
label="COM_BANNERS_FIELD_TRACKIMPRESSION_LABEL"
description="COM_BANNERS_FIELD_TRACKIMPRESSION_DESC">
<option
value="1">JYES</option>
<option
value="0">JNO</option>
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>

<field
name="track_clicks"
type="radio"
label="COM_BANNERS_FIELD_TRACKCLICK_LABEL"
description="COM_BANNERS_FIELD_TRACKCLICK_DESC"
class="btn-group btn-group-yesno"
default="0"
label="COM_BANNERS_FIELD_TRACKCLICK_LABEL"
description="COM_BANNERS_FIELD_TRACKCLICK_DESC">
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
Expand All @@ -51,33 +49,33 @@
name="metakey_prefix"
type="text"
label="COM_BANNERS_FIELD_METAKEYWORDPREFIX_LABEL"
description="COM_BANNERS_FIELD_METAKEYWORDPREFIX_DESC" />

description="COM_BANNERS_FIELD_METAKEYWORDPREFIX_DESC"
/>
</fieldset>
<fieldset name="banners"
<fieldset
name="banners"
label="COM_BANNERS_FIELDSET_CONFIG_BANNER_OPTIONS_LABEL"
description="COM_BANNERS_FIELDSET_CONFIG_BANNER_OPTIONS_DESC">

description="COM_BANNERS_FIELDSET_CONFIG_BANNER_OPTIONS_DESC"
>

<field
name="save_history"
type="radio"
class="btn-group btn-group-yesno"
default="0"
label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"
description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"
class="btn-group btn-group-yesno"
default="0"
>
<option
value="1">JYES</option>
<option
value="0">JNO</option>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>

<field
name="history_limit"
type="text"
filter="integer"
label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"
description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"
filter="integer"
default="5"
showon="save_history:1"
/>
Expand All @@ -96,6 +94,7 @@
filter="rules"
validate="rules"
component="com_banners"
section="component" />
section="component"
/>
</fieldset>
</config>
12 changes: 6 additions & 6 deletions administrator/components/com_banners/models/banner.php
Expand Up @@ -358,7 +358,7 @@ protected function loadFormData()
// Prime some default values.
if ($this->getState('banner.id') == 0)
{
$filters = (array) $app->getUserState('com_banners.banners.filter');
$filters = (array) $app->getUserState('com_banners.banners.filter');
$filterCatId = isset($filters['category_id']) ? $filters['category_id'] : null;

$data->set('catid', $app->input->getInt('catid', $filterCatId));
Expand Down Expand Up @@ -500,11 +500,11 @@ public function save($data)
// Save New Category
if ($catid == 0)
{
$table = array();
$table['title'] = $data['catid'];
$table = array();
$table['title'] = $data['catid'];
$table['parent_id'] = 1;
$table['extension'] = 'com_banners';
$table['language'] = $data['language'];
$table['language'] = $data['language'];
$table['published'] = 1;

// Create new category and get catid back
Expand All @@ -521,8 +521,8 @@ public function save($data)
if ($data['name'] == $origTable->name)
{
list($name, $alias) = $this->generateNewTitle($data['catid'], $data['alias'], $data['name']);
$data['name'] = $name;
$data['alias'] = $alias;
$data['name'] = $name;
$data['alias'] = $alias;
}
else
{
Expand Down
34 changes: 17 additions & 17 deletions administrator/components/com_banners/models/banners.php
Expand Up @@ -96,23 +96,23 @@ protected function getListQuery()
$query->select(
$this->getState(
'list.select',
'a.id AS id,' .
'a.name AS name,' .
'a.alias AS alias,' .
'a.checked_out AS checked_out,' .
'a.checked_out_time AS checked_out_time,' .
'a.catid AS catid,' .
'a.clicks AS clicks,' .
'a.metakey AS metakey,' .
'a.sticky AS sticky,' .
'a.impmade AS impmade,' .
'a.imptotal AS imptotal,' .
'a.state AS state,' .
'a.ordering AS ordering,' .
'a.purchase_type AS purchase_type,' .
'a.language,' .
'a.publish_up,' .
'a.publish_down'
'a.id AS id,'
. 'a.name AS name,'
. 'a.alias AS alias,'
. 'a.checked_out AS checked_out,'
. 'a.checked_out_time AS checked_out_time,'
. 'a.catid AS catid,'
. 'a.clicks AS clicks,'
. 'a.metakey AS metakey,'
. 'a.sticky AS sticky,'
. 'a.impmade AS impmade,'
. 'a.imptotal AS imptotal,'
. 'a.state AS state,'
. 'a.ordering AS ordering,'
. 'a.purchase_type AS purchase_type,'
. 'a.language,'
. 'a.publish_up,'
. 'a.publish_down'
)
);
$query->from($db->quoteName('#__banners', 'a'));
Expand Down
18 changes: 9 additions & 9 deletions administrator/components/com_banners/models/clients.php
Expand Up @@ -99,7 +99,7 @@ protected function getStoreId($id = '')
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$db = $this->getDbo();
$query = $db->getQuery(true);

$defaultPurchase = JComponentHelper::getParams('com_banners')->get('purchase_type', 3);
Expand All @@ -108,14 +108,14 @@ protected function getListQuery()
$query->select(
$this->getState(
'list.select',
'a.id AS id,' .
'a.name AS name,' .
'a.contact AS contact,' .
'a.checked_out AS checked_out,' .
'a.checked_out_time AS checked_out_time, ' .
'a.state AS state,' .
'a.metakey AS metakey,' .
'a.purchase_type as purchase_type'
'a.id AS id,'
. 'a.name AS name,'
. 'a.contact AS contact,'
. 'a.checked_out AS checked_out,'
. 'a.checked_out_time AS checked_out_time, '
. 'a.state AS state,'
. 'a.metakey AS metakey,'
. 'a.purchase_type as purchase_type'
)
);

Expand Down

0 comments on commit 43936b1

Please sign in to comment.