diff --git a/administrator/components/com_banners/access.xml b/administrator/components/com_banners/access.xml index 7f3ace116eace..d81db5fbe78ee 100644 --- a/administrator/components/com_banners/access.xml +++ b/administrator/components/com_banners/access.xml @@ -1,18 +1,72 @@
- - - - - - - + + + + + + + + + + + + + +
- - - - + + + + + + +
diff --git a/administrator/components/com_banners/banners.xml b/administrator/components/com_banners/banners.xml index bcb02355da5e2..2769e45714602 100644 --- a/administrator/components/com_banners/banners.xml +++ b/administrator/components/com_banners/banners.xml @@ -35,14 +35,38 @@ Note that all & must be escaped to & for the file to be valid XML and be parsed by the installer --> - com_banners_banners - com_banners_categories - com_banners_clients - com_banners_tracks + + com_banners_banners + + + com_banners_categories + + + com_banners_clients + + + com_banners_tracks + access.xml diff --git a/administrator/components/com_banners/config.xml b/administrator/components/com_banners/config.xml index 5ea4132f6b837..c81c7627c437d 100644 --- a/administrator/components/com_banners/config.xml +++ b/administrator/components/com_banners/config.xml @@ -1,48 +1,46 @@ -
+ description="COM_BANNERS_FIELDSET_CONFIG_CLIENT_OPTIONS_DESC" + > + - - - - - + + + + + - - + > + + + > @@ -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" + />
-
- + description="COM_BANNERS_FIELDSET_CONFIG_BANNER_OPTIONS_DESC" + > + - - + + - + @@ -96,6 +94,7 @@ filter="rules" validate="rules" component="com_banners" - section="component" /> + section="component" + />
diff --git a/administrator/components/com_banners/models/banner.php b/administrator/components/com_banners/models/banner.php index a0c18f25fdb41..16e3b8e6cbe87 100644 --- a/administrator/components/com_banners/models/banner.php +++ b/administrator/components/com_banners/models/banner.php @@ -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)); @@ -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 @@ -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 { diff --git a/administrator/components/com_banners/models/banners.php b/administrator/components/com_banners/models/banners.php index d253ea6ec9daf..52ecdd2a5d131 100644 --- a/administrator/components/com_banners/models/banners.php +++ b/administrator/components/com_banners/models/banners.php @@ -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')); diff --git a/administrator/components/com_banners/models/clients.php b/administrator/components/com_banners/models/clients.php index 3eccf56840022..81d483a8ca5dd 100644 --- a/administrator/components/com_banners/models/clients.php +++ b/administrator/components/com_banners/models/clients.php @@ -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); @@ -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' ) ); diff --git a/administrator/components/com_banners/models/forms/banner.xml b/administrator/components/com_banners/models/forms/banner.xml index be3f732e511be..0a6cc912ca0f9 100644 --- a/administrator/components/com_banners/models/forms/banner.xml +++ b/administrator/components/com_banners/models/forms/banner.xml @@ -1,224 +1,376 @@
-
+
- + - + size="40" + required="true" + /> - + size="40" + hint="JFIELD_ALIAS_PLACEHOLDER" + /> - - + size="1" + default="1" + > - + table="#__banners" + /> - + - - + - - - + + + - + - +
-
+
- + - + - + - + - + filter="unset" + /> - + - + - +
-
+
- + default="0" + class="btn-group btn-group-yesno" + >
- - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + description="COM_BANNERS_FIELD_TRACKIMPRESSION_DESC" + default="0" + > + - - + +
-
+
- + - + class="btn-group btn-group-yesno" + default="0" + > - + description="COM_BANNERS_FIELD_METAKEYWORDPREFIX_DESC" + />
- - - - - - - + /> + + + + + +
- +
diff --git a/administrator/components/com_banners/models/forms/client.xml b/administrator/components/com_banners/models/forms/client.xml index 0ff3a5bedb428..d568ab1aeebd6 100644 --- a/administrator/components/com_banners/models/forms/client.xml +++ b/administrator/components/com_banners/models/forms/client.xml @@ -1,38 +1,62 @@
-
- +
+ - + class="input-xxlarge input-large-text" + size="40" + required="true" + /> - + - + - + - - - - - - - - + > + + + + + + - + default="0" + class="chzn-color" + > - + > @@ -80,36 +108,45 @@
-
- - +
+ - + > - - + description="COM_BANNERS_FIELD_CLIENT_METAKEYWORDPREFIX_DESC" + />
- - - + rows="5" + cols="80" + />
diff --git a/administrator/components/com_banners/models/forms/download.xml b/administrator/components/com_banners/models/forms/download.xml index 688c8a129d1c8..fbaed4e8e8f28 100644 --- a/administrator/components/com_banners/models/forms/download.xml +++ b/administrator/components/com_banners/models/forms/download.xml @@ -1,19 +1,24 @@
- - + > - - + />
diff --git a/administrator/components/com_banners/models/forms/filter_banners.xml b/administrator/components/com_banners/models/forms/filter_banners.xml index e7f043db69cb8..5ef151967fb41 100644 --- a/administrator/components/com_banners/models/forms/filter_banners.xml +++ b/administrator/components/com_banners/models/forms/filter_banners.xml @@ -8,6 +8,7 @@ description="COM_BANNERS_BANNERS_FILTER_SEARCH_DESC" hint="JSEARCH_FILTER" /> + + + + JOPTION_SELECT_LANGUAGE + @@ -93,13 +98,14 @@ + diff --git a/administrator/components/com_banners/models/forms/filter_clients.xml b/administrator/components/com_banners/models/forms/filter_clients.xml index b692198ed5d9b..1552335b63704 100644 --- a/administrator/components/com_banners/models/forms/filter_clients.xml +++ b/administrator/components/com_banners/models/forms/filter_clients.xml @@ -8,6 +8,7 @@ description="COM_BANNERS_CLIENTS_FILTER_SEARCH_DESC" hint="JSEARCH_FILTER" /> + + @@ -55,13 +57,14 @@ + diff --git a/administrator/components/com_banners/models/forms/filter_tracks.xml b/administrator/components/com_banners/models/forms/filter_tracks.xml index 6f449bae9fb29..a3cd61f8ad89a 100644 --- a/administrator/components/com_banners/models/forms/filter_tracks.xml +++ b/administrator/components/com_banners/models/forms/filter_tracks.xml @@ -8,6 +8,7 @@ description="COM_BANNERS_TRACKS_FILTER_SEARCH_DESC" hint="JSEARCH_FILTER" /> + + + COM_BANNERS_TYPE1 + + + JDATE_ASC + getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->delete($db->quoteName('#__banner_tracks')); @@ -374,7 +374,7 @@ protected function getCategoryName() if ($categoryId) { - $db = $this->getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->select('title') ->from($db->quoteName('#__categories')) @@ -411,7 +411,7 @@ protected function getClientName() if ($clientId) { - $db = $this->getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->select('name') ->from($db->quoteName('#__banner_clients')) @@ -470,21 +470,21 @@ public function getContent() { if (!isset($this->content)) { - $this->content = '"' . str_replace('"', '""', JText::_('COM_BANNERS_HEADING_NAME')) . '","' . - str_replace('"', '""', JText::_('COM_BANNERS_HEADING_CLIENT')) . '","' . - str_replace('"', '""', JText::_('JCATEGORY')) . '","' . - str_replace('"', '""', JText::_('COM_BANNERS_HEADING_TYPE')) . '","' . - str_replace('"', '""', JText::_('COM_BANNERS_HEADING_COUNT')) . '","' . - str_replace('"', '""', JText::_('JDATE')) . '"' . "\n"; + $this->content = '"' . str_replace('"', '""', JText::_('COM_BANNERS_HEADING_NAME')) . '","' + . str_replace('"', '""', JText::_('COM_BANNERS_HEADING_CLIENT')) . '","' + . str_replace('"', '""', JText::_('JCATEGORY')) . '","' + . str_replace('"', '""', JText::_('COM_BANNERS_HEADING_TYPE')) . '","' + . str_replace('"', '""', JText::_('COM_BANNERS_HEADING_COUNT')) . '","' + . str_replace('"', '""', JText::_('JDATE')) . '"' . "\n"; foreach ($this->getItems() as $item) { - $this->content .= '"' . str_replace('"', '""', $item->name) . '","' . - str_replace('"', '""', $item->client_name) . '","' . - str_replace('"', '""', $item->category_title) . '","' . - str_replace('"', '""', ($item->track_type == 1 ? JText::_('COM_BANNERS_IMPRESSION') : JText::_('COM_BANNERS_CLICK'))) . '","' . - str_replace('"', '""', $item->count) . '","' . - str_replace('"', '""', $item->track_date) . '"' . "\n"; + $this->content .= '"' . str_replace('"', '""', $item->name) . '","' + . str_replace('"', '""', $item->client_name) . '","' + . str_replace('"', '""', $item->category_title) . '","' + . str_replace('"', '""', ($item->track_type == 1 ? JText::_('COM_BANNERS_IMPRESSION') : JText::_('COM_BANNERS_CLICK'))) . '","' + . str_replace('"', '""', $item->count) . '","' + . str_replace('"', '""', $item->track_date) . '"' . "\n"; } if ($this->getState('compressed')) diff --git a/administrator/components/com_banners/tables/client.php b/administrator/components/com_banners/tables/client.php index ae0e62f1fe4b9..998e63d87855d 100644 --- a/administrator/components/com_banners/tables/client.php +++ b/administrator/components/com_banners/tables/client.php @@ -86,10 +86,10 @@ public function publish($pks = null, $state = 1, $userId = 0) // Update the publishing state for rows with the given primary keys. $this->_db->setQuery( - 'UPDATE ' . $this->_db->quoteName($this->_tbl) . - ' SET ' . $this->_db->quoteName('state') . ' = ' . (int) $state . - ' WHERE (' . $where . ')' . - $checkin + 'UPDATE ' . $this->_db->quoteName($this->_tbl) + . ' SET ' . $this->_db->quoteName('state') . ' = ' . (int) $state + . ' WHERE (' . $where . ')' + . $checkin ); try diff --git a/administrator/components/com_banners/views/banner/tmpl/edit.php b/administrator/components/com_banners/views/banner/tmpl/edit.php index 86d692d1854fc..4c299b4588fac 100644 --- a/administrator/components/com_banners/views/banner/tmpl/edit.php +++ b/administrator/components/com_banners/views/banner/tmpl/edit.php @@ -23,12 +23,12 @@ }; jQuery(document).ready(function ($){ $("#jform_type").on("change", function (a, params) { - + var v = typeof(params) !== "object" ? $("#jform_type").val() : params.selected; - + var img_url = $("#image, #url"); var custom = $("#custom"); - + switch (v) { case "0": // Image diff --git a/administrator/components/com_banners/views/banners/tmpl/default.php b/administrator/components/com_banners/views/banners/tmpl/default.php index f4eabd6ac8b5e..a87a929e44f0a 100644 --- a/administrator/components/com_banners/views/banners/tmpl/default.php +++ b/administrator/components/com_banners/views/banners/tmpl/default.php @@ -97,6 +97,7 @@ state, $i, 'clients.', $canChange); ?> state === 2 ? 'un' : '') . 'archive', 'cb' . $i, 'clients'); diff --git a/administrator/components/com_banners/views/clients/view.html.php b/administrator/components/com_banners/views/clients/view.html.php index 295aa03a86358..29f4b8aa4b1ae 100644 --- a/administrator/components/com_banners/views/clients/view.html.php +++ b/administrator/components/com_banners/views/clients/view.html.php @@ -128,12 +128,12 @@ protected function addToolbar() protected function getSortFields() { return array( - 'a.status' => JText::_('JSTATUS'), - 'a.name' => JText::_('COM_BANNERS_HEADING_CLIENT'), - 'contact' => JText::_('COM_BANNERS_HEADING_CONTACT'), + 'a.status' => JText::_('JSTATUS'), + 'a.name' => JText::_('COM_BANNERS_HEADING_CLIENT'), + 'contact' => JText::_('COM_BANNERS_HEADING_CONTACT'), 'client_name' => JText::_('COM_BANNERS_HEADING_CLIENT'), - 'nbanners' => JText::_('COM_BANNERS_HEADING_ACTIVE'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'nbanners' => JText::_('COM_BANNERS_HEADING_ACTIVE'), + 'a.id' => JText::_('JGRID_HEADING_ID') ); } } diff --git a/administrator/components/com_banners/views/tracks/view.html.php b/administrator/components/com_banners/views/tracks/view.html.php index f623d70ac5af1..0135cafaa5c40 100644 --- a/administrator/components/com_banners/views/tracks/view.html.php +++ b/administrator/components/com_banners/views/tracks/view.html.php @@ -104,7 +104,6 @@ protected function addToolbar() JToolbarHelper::help('JHELP_COMPONENTS_BANNERS_TRACKS'); JHtmlSidebar::setAction('index.php?option=com_banners&view=tracks'); - } /** @@ -117,10 +116,10 @@ protected function addToolbar() protected function getSortFields() { return array( - 'b.name' => JText::_('COM_BANNERS_HEADING_NAME'), - 'cl.name' => JText::_('COM_BANNERS_HEADING_CLIENT'), + 'b.name' => JText::_('COM_BANNERS_HEADING_NAME'), + 'cl.name' => JText::_('COM_BANNERS_HEADING_CLIENT'), 'track_type' => JText::_('COM_BANNERS_HEADING_TYPE'), - 'count' => JText::_('COM_BANNERS_HEADING_COUNT'), + 'count' => JText::_('COM_BANNERS_HEADING_COUNT'), 'track_date' => JText::_('JDATE') ); } diff --git a/components/com_banners/models/banner.php b/components/com_banners/models/banner.php index 149da0c17cce6..1bba5df67f7bb 100644 --- a/components/com_banners/models/banner.php +++ b/components/com_banners/models/banner.php @@ -155,9 +155,9 @@ public function &getItem() $db = $this->getDbo(); $query = $db->getQuery(true) ->select( - 'a.clickurl as clickurl,' . - 'a.cid as cid,' . - 'a.track_clicks as track_clicks' + 'a.clickurl as clickurl,' + . 'a.cid as cid,' + . 'a.track_clicks as track_clicks' ) ->from('#__banners as a') ->where('a.id = ' . (int) $id) diff --git a/components/com_banners/models/banners.php b/components/com_banners/models/banners.php index 7b597feae4cce..c7a7e432c0a1e 100644 --- a/components/com_banners/models/banners.php +++ b/components/com_banners/models/banners.php @@ -54,27 +54,27 @@ protected function getStoreId($id = '') */ protected function getListQuery() { - $db = $this->getDbo(); - $query = $db->getQuery(true); - $ordering = $this->getState('filter.ordering'); - $tagSearch = $this->getState('filter.tag_search'); - $cid = $this->getState('filter.client_id'); + $db = $this->getDbo(); + $query = $db->getQuery(true); + $ordering = $this->getState('filter.ordering'); + $tagSearch = $this->getState('filter.tag_search'); + $cid = $this->getState('filter.client_id'); $categoryId = $this->getState('filter.category_id'); - $keywords = $this->getState('filter.keywords'); - $randomise = ($ordering == 'random'); - $nullDate = $db->quote($db->getNullDate()); + $keywords = $this->getState('filter.keywords'); + $randomise = ($ordering == 'random'); + $nullDate = $db->quote($db->getNullDate()); $query->select( - 'a.id as id,' . - 'a.type as type,' . - 'a.name as name,' . - 'a.clickurl as clickurl,' . - 'a.cid as cid,' . - 'a.description as description,' . - 'a.params as params,' . - 'a.custombannercode as custombannercode,' . - 'a.track_impressions as track_impressions,' . - 'cl.track_impressions as client_track_impressions' + 'a.id as id,' + . 'a.type as type,' + . 'a.name as name,' + . 'a.clickurl as clickurl,' + . 'a.cid as cid,' + . 'a.description as description,' + . 'a.params as params,' + . 'a.custombannercode as custombannercode,' + . 'a.track_impressions as track_impressions,' + . 'cl.track_impressions as client_track_impressions' ) ->from('#__banners as a') ->join('LEFT', '#__banner_clients AS cl ON cl.id = a.cid') @@ -138,7 +138,7 @@ protected function getListQuery() } else { - $temp = array(); + $temp = array(); $config = JComponentHelper::getParams('com_banners'); $prefix = $config->get('metakey_prefix'); @@ -204,7 +204,7 @@ public function getItems() foreach ($this->cache['items'] as &$item) { - $parameters = new Registry; + $parameters = new Registry; $parameters->loadString($item->params); $item->params = $parameters; } @@ -223,9 +223,9 @@ public function getItems() public function impress() { $trackDate = JFactory::getDate()->format('Y-m-d H'); - $items = $this->getItems(); - $db = $this->getDbo(); - $query = $db->getQuery(true); + $items = $this->getItems(); + $db = $this->getDbo(); + $query = $db->getQuery(true); foreach ($items as $item) { @@ -256,7 +256,7 @@ public function impress() if ($trackImpressions < 0) { - $config = JComponentHelper::getParams('com_banners'); + $config = JComponentHelper::getParams('com_banners'); $trackImpressions = $config->get('track_impressions'); }