diff --git a/README.md b/README.md index 7e6da2f..770ce14 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Demo (2.0.0) -![Demo image] (https://raw.githubusercontent.com/namibia/demo-joomla-3-component/master/admin/assets/images/component-300.jpg "The Demo") +![Demo image] (https://raw.githubusercontent.com/namibia/demo-joomla-3-component/master/admin/assets/images/vdm-component.jpg "The Demo") Just a basic demo of the most basic implementations of the [Joomla] (http://www.joomla.org) Component Builder's ability. @@ -10,7 +10,7 @@ Just a basic demo of the most basic implementations of the [Joomla] (http://www. + *Author*: [Llewellyn van der Merwe] (mailto:info@vdm.io) + *Name*: [Demo] (https://www.vdm.io/) + *First Build*: 18th October, 2016 -+ *Last Build*: 8th April, 2017 ++ *Last Build*: 21st August, 2017 + *Version*: 2.0.0 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html @@ -23,7 +23,7 @@ due to [Automated Component Builder] (https://www.vdm.io/joomla-component-builde > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > never making one mistake or taking any coffee break.) -+ *Line count*: **15283** ++ *Line count*: **15341** + *File count*: **147** + *Folder count*: **54** @@ -48,6 +48,7 @@ Project duration: **1.8 weeks** or **0.4 months** ## Donations - If you want to support this project, please consider donating: - * PayPal: pay@vdm.io - * Bitcoin: 3H35PYwikEosvcjxHXGPLS1GufZ4b4iFu3 \ No newline at end of file +If you want to support this project, please consider donating: +* PayPal: [paypal.me/payvdm](https://www.paypal.me/payvdm) +* Bitcoin: 1FLxiT6wyxgZ3boeviLkYJ1DRpp41uzpxa +* Ethereum: 0x243392daa3c9c8bc841fcacf7c7f72541cb16823 \ No newline at end of file diff --git a/admin/README.txt b/admin/README.txt index 7e6da2f..770ce14 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -1,6 +1,6 @@ # Demo (2.0.0) -![Demo image] (https://raw.githubusercontent.com/namibia/demo-joomla-3-component/master/admin/assets/images/component-300.jpg "The Demo") +![Demo image] (https://raw.githubusercontent.com/namibia/demo-joomla-3-component/master/admin/assets/images/vdm-component.jpg "The Demo") Just a basic demo of the most basic implementations of the [Joomla] (http://www.joomla.org) Component Builder's ability. @@ -10,7 +10,7 @@ Just a basic demo of the most basic implementations of the [Joomla] (http://www. + *Author*: [Llewellyn van der Merwe] (mailto:info@vdm.io) + *Name*: [Demo] (https://www.vdm.io/) + *First Build*: 18th October, 2016 -+ *Last Build*: 8th April, 2017 ++ *Last Build*: 21st August, 2017 + *Version*: 2.0.0 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html @@ -23,7 +23,7 @@ due to [Automated Component Builder] (https://www.vdm.io/joomla-component-builde > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > never making one mistake or taking any coffee break.) -+ *Line count*: **15283** ++ *Line count*: **15341** + *File count*: **147** + *Folder count*: **54** @@ -48,6 +48,7 @@ Project duration: **1.8 weeks** or **0.4 months** ## Donations - If you want to support this project, please consider donating: - * PayPal: pay@vdm.io - * Bitcoin: 3H35PYwikEosvcjxHXGPLS1GufZ4b4iFu3 \ No newline at end of file +If you want to support this project, please consider donating: +* PayPal: [paypal.me/payvdm](https://www.paypal.me/payvdm) +* Bitcoin: 1FLxiT6wyxgZ3boeviLkYJ1DRpp41uzpxa +* Ethereum: 0x243392daa3c9c8bc841fcacf7c7f72541cb16823 \ No newline at end of file diff --git a/admin/assets/css/admin.css b/admin/assets/css/admin.css index a595c70..4d83cae 100644 --- a/admin/assets/css/admin.css +++ b/admin/assets/css/admin.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage admin.css diff --git a/admin/assets/css/dashboard.css b/admin/assets/css/dashboard.css index 977d77e..05bd83e 100644 --- a/admin/assets/css/dashboard.css +++ b/admin/assets/css/dashboard.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage dashboard.css diff --git a/admin/assets/css/look.css b/admin/assets/css/look.css index 8abc8d7..2544c7f 100644 --- a/admin/assets/css/look.css +++ b/admin/assets/css/look.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage look.css diff --git a/admin/assets/css/looks.css b/admin/assets/css/looks.css index f906814..580a77d 100644 --- a/admin/assets/css/looks.css +++ b/admin/assets/css/looks.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage looks.css diff --git a/admin/assets/images/component-300.jpg b/admin/assets/images/component-300.jpg deleted file mode 100644 index 465bff0..0000000 Binary files a/admin/assets/images/component-300.jpg and /dev/null differ diff --git a/admin/assets/images/vdm-component.jpg b/admin/assets/images/vdm-component.jpg new file mode 100644 index 0000000..c043f04 Binary files /dev/null and b/admin/assets/images/vdm-component.jpg differ diff --git a/admin/controller.php b/admin/controller.php index abc4072..1b73073 100644 --- a/admin/controller.php +++ b/admin/controller.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage controller.php diff --git a/admin/controllers/demo.php b/admin/controllers/demo.php index b25ed11..81651aa 100644 --- a/admin/controllers/demo.php +++ b/admin/controllers/demo.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage demo.php diff --git a/admin/controllers/import.php b/admin/controllers/import.php index ff05a29..1ef5043 100644 --- a/admin/controllers/import.php +++ b/admin/controllers/import.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage import.php diff --git a/admin/controllers/look.php b/admin/controllers/look.php index 36fa449..33f3d5d 100644 --- a/admin/controllers/look.php +++ b/admin/controllers/look.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage look.php diff --git a/admin/controllers/looks.php b/admin/controllers/looks.php index cc04f43..234ad31 100644 --- a/admin/controllers/looks.php +++ b/admin/controllers/looks.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage looks.php diff --git a/admin/demo.php b/admin/demo.php index 61e9433..7686deb 100644 --- a/admin/demo.php +++ b/admin/demo.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage demo.php diff --git a/admin/helpers/demo.php b/admin/helpers/demo.php index aa9d3f7..d6ee649 100644 --- a/admin/helpers/demo.php +++ b/admin/helpers/demo.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage demo.php @@ -441,7 +441,14 @@ abstract class DemoHelper $query = $db->getQuery(true); $query->select($db->quoteName(array($what))); - $query->from($db->quoteName('#_'.$main.'_'.$table)); + if (empty($table)) + { + $query->from($db->quoteName('#__'.$main)); + } + else + { + $query->from($db->quoteName('#_'.$main.'_'.$table)); + } $query->where($db->quoteName($whereString) . ' '.$operator.' (' . implode(',',$where) . ')'); $db->setQuery($query); $db->execute(); @@ -724,12 +731,20 @@ abstract class DemoHelper **/ public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $component = 'demo') { - // load some joomla helpers - JLoader::import('joomla.application.component.model'); // load the model file - JLoader::import( $name, $path . '/models' ); - // return instance - return JModelLegacy::getInstance( $name, $component.'Model' ); + JModelLegacy::addIncludePath( $path . '/models' ); + // get instance + $model = JModelLegacy::getInstance( $name, $component.'Model' ); + // if model not found + if ($model == false) + { + // build class name + $class = $prefix.$name; + // initilize the model + new $class(); + $model = JModelLegacy::getInstance($name, $prefix); + } + return $model; } /** @@ -936,10 +951,16 @@ abstract class DemoHelper return false; } + // typo sorry! public static function sorten($string, $length = 40, $addTip = true) + { + return self::shorten($string, $length, $addTip); + } + + public static function shorten($string, $length = 40, $addTip = true) { if (self::checkString($string)) - { + { $initial = strlen($string); $words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE); $words_count = count($words); @@ -959,7 +980,7 @@ abstract class DemoHelper $final = strlen($newString); if ($initial != $final && $addTip) { - $title = self::sorten($string, 400 , false); + $title = self::shorten($string, 400 , false); return ''.trim($newString).'...'; } elseif ($initial != $final && !$addTip) @@ -990,7 +1011,8 @@ abstract class DemoHelper // If you don't need to handle multi-byte characters // you can use preg_replace rather than mb_ereg_replace // Thanks @Łukasz Rysiak! - $string = mb_ereg_replace("([^\w\s\d\-_\(\)])", '', $string); + // $string = mb_ereg_replace("([^\w\s\d\-_\(\)])", '', $string); + $string = preg_replace("([^\w\s\d\-_\(\)])", '', $string); // http://stackoverflow.com/a/2021729/1429677 return preg_replace('/\s+/', ' ', $string); } @@ -1057,15 +1079,15 @@ abstract class DemoHelper return ''; } - public static function htmlEscape($var, $charset = 'UTF-8', $sorten = false, $length = 40) + public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40) { if (self::checkString($var)) { $filter = new JFilterInput(); $string = $filter->clean(html_entity_decode(htmlentities($var, ENT_COMPAT, $charset)), 'HTML'); - if ($sorten) + if ($shorten) { - return self::sorten($string,$length); + return self::shorten($string,$length); } return $string; } diff --git a/admin/helpers/headercheck.php b/admin/helpers/headercheck.php index e796607..cbae176 100644 --- a/admin/helpers/headercheck.php +++ b/admin/helpers/headercheck.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage headercheck.php @@ -21,7 +21,7 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -class HeaderCheck +class demoHeaderCheck { function js_loaded($script_name) { diff --git a/admin/helpers/html/batch_.php b/admin/helpers/html/batch_.php index 916a2de..291be32 100644 --- a/admin/helpers/html/batch_.php +++ b/admin/helpers/html/batch_.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage batch_.php diff --git a/admin/layouts/batchselection.php b/admin/layouts/batchselection.php index 56bc822..f820938 100644 --- a/admin/layouts/batchselection.php +++ b/admin/layouts/batchselection.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage batchselection.php diff --git a/admin/layouts/look/details_above.php b/admin/layouts/look/details_above.php index 0d82da0..1a1dcb2 100644 --- a/admin/layouts/look/details_above.php +++ b/admin/layouts/look/details_above.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage details_above.php diff --git a/admin/layouts/look/details_fullwidth.php b/admin/layouts/look/details_fullwidth.php index 8800b99..91aef05 100644 --- a/admin/layouts/look/details_fullwidth.php +++ b/admin/layouts/look/details_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage details_fullwidth.php diff --git a/admin/layouts/look/details_under.php b/admin/layouts/look/details_under.php index 4814254..a4b21e8 100644 --- a/admin/layouts/look/details_under.php +++ b/admin/layouts/look/details_under.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage details_under.php diff --git a/admin/layouts/look/metadata.php b/admin/layouts/look/metadata.php index 470bb02..84d4cb4 100644 --- a/admin/layouts/look/metadata.php +++ b/admin/layouts/look/metadata.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage metadata.php diff --git a/admin/layouts/look/more_left.php b/admin/layouts/look/more_left.php index 8b6d65b..0dccdad 100644 --- a/admin/layouts/look/more_left.php +++ b/admin/layouts/look/more_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage more_left.php diff --git a/admin/layouts/look/more_right.php b/admin/layouts/look/more_right.php index ca7e96c..6e5e968 100644 --- a/admin/layouts/look/more_right.php +++ b/admin/layouts/look/more_right.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage more_right.php diff --git a/admin/layouts/look/publishing.php b/admin/layouts/look/publishing.php index b95bfc1..fcde37a 100644 --- a/admin/layouts/look/publishing.php +++ b/admin/layouts/look/publishing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage publishing.php diff --git a/admin/models/demo.php b/admin/models/demo.php index 8320184..ec738f9 100644 --- a/admin/models/demo.php +++ b/admin/models/demo.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage demo.php diff --git a/admin/models/forms/look.js b/admin/models/forms/look.js index b2fc9f4..528ec58 100644 --- a/admin/models/forms/look.js +++ b/admin/models/forms/look.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage look.js diff --git a/admin/models/import.php b/admin/models/import.php index f2aa2d4..3b361a1 100644 --- a/admin/models/import.php +++ b/admin/models/import.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage import.php diff --git a/admin/models/look.php b/admin/models/look.php index c99ea60..58f6c7d 100644 --- a/admin/models/look.php +++ b/admin/models/look.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage look.php diff --git a/admin/models/looks.php b/admin/models/looks.php index a815877..88875bf 100644 --- a/admin/models/looks.php +++ b/admin/models/looks.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage looks.php diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 68bac0f..f1a6fab 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -1,7 +1,7 @@ CREATE TABLE IF NOT EXISTS `#__demo_look` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', - `add` TINYINT(1) NOT NULL DEFAULT '0', + `add` TINYINT(1) NOT NULL DEFAULT 0, `alias` CHAR(64) NOT NULL DEFAULT '', `dateofbirth` DATE NOT NULL DEFAULT '0000-00-00', `description` TEXT NOT NULL, @@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS `#__demo_look` ( `image` CHAR(64) NOT NULL DEFAULT '', `mobile_phone` VARCHAR(64) NOT NULL DEFAULT '', `name` VARCHAR(255) NOT NULL DEFAULT '', - `not_required` INT(1) NOT NULL DEFAULT '0', + `not_required` INT(1) NOT NULL DEFAULT 0, `website` VARCHAR(255) NOT NULL DEFAULT '', `params` text NOT NULL DEFAULT '', `published` TINYINT(3) NOT NULL DEFAULT 1, diff --git a/admin/tables/look.php b/admin/tables/look.php index 2440af9..bd667ed 100644 --- a/admin/tables/look.php +++ b/admin/tables/look.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage look.php diff --git a/admin/views/demo/tmpl/default.php b/admin/views/demo/tmpl/default.php index ff94e8d..8fbd7a6 100644 --- a/admin/views/demo/tmpl/default.php +++ b/admin/views/demo/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage default.php diff --git a/admin/views/demo/tmpl/default_main.php b/admin/views/demo/tmpl/default_main.php index 48e7702..22df304 100644 --- a/admin/views/demo/tmpl/default_main.php +++ b/admin/views/demo/tmpl/default_main.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage default_main.php diff --git a/admin/views/demo/tmpl/default_vdm.php b/admin/views/demo/tmpl/default_vdm.php index 4b22322..03c7d12 100644 --- a/admin/views/demo/tmpl/default_vdm.php +++ b/admin/views/demo/tmpl/default_vdm.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage default_vdm.php @@ -21,30 +21,27 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -$manifest = DemoHelper::manifest(); -JHtml::_('bootstrap.loadCss'); - ?> -<?php echo JText::_('COM_DEMO'); ?> +<?php echo JText::_('COM_DEMO'); ?>
contributors)): ?> -contributors) > 1): ?> -

- -

- - -
+ contributors) > 1): ?> +

+ +

+ + +
\ No newline at end of file diff --git a/admin/views/demo/view.html.php b/admin/views/demo/view.html.php index 56b80a2..4739827 100644 --- a/admin/views/demo/view.html.php +++ b/admin/views/demo/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage view.html.php @@ -44,7 +44,10 @@ class DemoViewDemo extends JViewLegacy // Assign data to the view $this->icons = $this->get('Icons'); $this->contributors = DemoHelper::getContributors(); - + + // get the manifest details of the component + $this->manifest = DemoHelper::manifest(); + // Set the toolbar $this->addToolBar(); @@ -79,15 +82,19 @@ class DemoViewDemo extends JViewLegacy /** * Method to set up the document properties * - * * @return void */ protected function setDocument() { $document = JFactory::getDocument(); - + + // add dashboard style sheets $document->addStyleSheet(JURI::root() . "administrator/components/com_demo/assets/css/dashboard.css"); - + + // set page title $document->setTitle(JText::_('COM_DEMO_DASHBOARD')); + + // add manifest to page JavaScript + $document->addScriptDeclaration("var manifest = jQuery.parseJSON('" . json_encode($this->manifest) . "');", "text/javascript"); } } diff --git a/admin/views/import/tmpl/default.php b/admin/views/import/tmpl/default.php index 5afb8c6..f293cee 100644 --- a/admin/views/import/tmpl/default.php +++ b/admin/views/import/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage default.php diff --git a/admin/views/import/view.html.php b/admin/views/import/view.html.php index a5ae72f..50cc329 100644 --- a/admin/views/import/view.html.php +++ b/admin/views/import/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage view.html.php diff --git a/admin/views/look/submitbutton.js b/admin/views/look/submitbutton.js index 3215921..f2ecf51 100644 --- a/admin/views/look/submitbutton.js +++ b/admin/views/look/submitbutton.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage submitbutton.js diff --git a/admin/views/look/tmpl/edit.php b/admin/views/look/tmpl/edit.php index e895d43..de66910 100644 --- a/admin/views/look/tmpl/edit.php +++ b/admin/views/look/tmpl/edit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage edit.php @@ -53,7 +53,8 @@ $componentParams = JComponentHelper::getParams('com_demo');
diff --git a/admin/views/look/view.html.php b/admin/views/look/view.html.php index 45cb85b..b39d631 100644 --- a/admin/views/look/view.html.php +++ b/admin/views/look/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage view.html.php diff --git a/admin/views/looks/tmpl/default.php b/admin/views/looks/tmpl/default.php index 3df2361..6e851d2 100644 --- a/admin/views/looks/tmpl/default.php +++ b/admin/views/looks/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage default.php diff --git a/admin/views/looks/tmpl/default_batch_body.php b/admin/views/looks/tmpl/default_batch_body.php index 43ec3f6..8a3e918 100644 --- a/admin/views/looks/tmpl/default_batch_body.php +++ b/admin/views/looks/tmpl/default_batch_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage default_batch_body.php diff --git a/admin/views/looks/tmpl/default_batch_footer.php b/admin/views/looks/tmpl/default_batch_footer.php index dec3126..347ea3d 100644 --- a/admin/views/looks/tmpl/default_batch_footer.php +++ b/admin/views/looks/tmpl/default_batch_footer.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage default_batch_footer.php diff --git a/admin/views/looks/tmpl/default_body.php b/admin/views/looks/tmpl/default_body.php index 4663c6d..ec7e5e3 100644 --- a/admin/views/looks/tmpl/default_body.php +++ b/admin/views/looks/tmpl/default_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage default_body.php diff --git a/admin/views/looks/tmpl/default_foot.php b/admin/views/looks/tmpl/default_foot.php index f72cdc0..7cfc79d 100644 --- a/admin/views/looks/tmpl/default_foot.php +++ b/admin/views/looks/tmpl/default_foot.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage default_foot.php diff --git a/admin/views/looks/tmpl/default_head.php b/admin/views/looks/tmpl/default_head.php index fd5ae9a..970012c 100644 --- a/admin/views/looks/tmpl/default_head.php +++ b/admin/views/looks/tmpl/default_head.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage default_head.php diff --git a/admin/views/looks/tmpl/default_toolbar.php b/admin/views/looks/tmpl/default_toolbar.php index bb245ce..6ef02a0 100644 --- a/admin/views/looks/tmpl/default_toolbar.php +++ b/admin/views/looks/tmpl/default_toolbar.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage default_toolbar.php diff --git a/admin/views/looks/view.html.php b/admin/views/looks/view.html.php index a510fce..a1ef60f 100644 --- a/admin/views/looks/view.html.php +++ b/admin/views/looks/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage view.html.php @@ -144,7 +144,7 @@ class DemoViewLooks extends JViewLegacy { JToolBarHelper::custom('looks.exportData', 'download', '', 'COM_DEMO_EXPORT_DATA', true); } - } + } if ($this->canDo->get('core.import') && $this->canDo->get('look.import')) { diff --git a/demo.xml b/demo.xml index 781fbdf..0745fa4 100644 --- a/demo.xml +++ b/demo.xml @@ -1,7 +1,7 @@ COM_DEMO - 8th April, 2017 + 21st August, 2017 Llewellyn van der Merwe info@vdm.io https://www.vdm.io/ diff --git a/script.php b/script.php index 88d7f33..cd8f703 100644 --- a/script.php +++ b/script.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage script.php @@ -255,7 +255,7 @@ class com_demoInstallerScript $app = JFactory::getApplication(); $app->enqueueMessage('First set the components global settings and permissions in the Options area, or the front-end of the component will not work as expected.
Please note that each view on the front-end has access and permissions, so if you would like the public to access those views they must be given the access and permission.', 'Info'); echo ' - + '; } // do any updates needed @@ -296,7 +296,7 @@ class com_demoInstallerScript echo ' - +

Upgrade to Version 2.0.0 Was Successful! Let us know if anything is not working as expected.

'; } diff --git a/site/assets/css/look.css b/site/assets/css/look.css index 8abc8d7..2544c7f 100644 --- a/site/assets/css/look.css +++ b/site/assets/css/look.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage look.css diff --git a/site/assets/css/looking.css b/site/assets/css/looking.css index 51d2c67..7afe68d 100644 --- a/site/assets/css/looking.css +++ b/site/assets/css/looking.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage looking.css diff --git a/site/assets/css/looks.css b/site/assets/css/looks.css index f906814..580a77d 100644 --- a/site/assets/css/looks.css +++ b/site/assets/css/looks.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage looks.css diff --git a/site/assets/css/site.css b/site/assets/css/site.css index 2db15f9..b37c2ef 100644 --- a/site/assets/css/site.css +++ b/site/assets/css/site.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage site.css diff --git a/site/controller.php b/site/controller.php index bc384a9..16746e5 100644 --- a/site/controller.php +++ b/site/controller.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage controller.php diff --git a/site/controllers/look.php b/site/controllers/look.php index 897c7f7..3768202 100644 --- a/site/controllers/look.php +++ b/site/controllers/look.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage look.php diff --git a/site/demo.php b/site/demo.php index 175e25e..907c22a 100644 --- a/site/demo.php +++ b/site/demo.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage demo.php diff --git a/site/helpers/category.php b/site/helpers/category.php index 9dd6b55..4e000ca 100644 --- a/site/helpers/category.php +++ b/site/helpers/category.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage category.php diff --git a/site/helpers/demo.php b/site/helpers/demo.php index 45835e2..8c795a0 100644 --- a/site/helpers/demo.php +++ b/site/helpers/demo.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage demo.php @@ -165,12 +165,23 @@ abstract class DemoHelper **/ public static function getModel($name, $path = JPATH_COMPONENT_SITE, $component = 'demo') { - // load some joomla helpers - JLoader::import('joomla.application.component.model'); + // full path + $fullPath = $path . '/models'; // load the model file - JLoader::import( $name, $path . '/models' ); - // return instance - return JModelLegacy::getInstance( $name, $component.'Model' ); + JModelLegacy::addIncludePath($fullPath); + // get instance + $model = JModelLegacy::getInstance( $name, $component.'Model' ); + // if model not found + if ($model == false) + { + require_once $fullPath.'/'.strtolower($name).'.php'; + // build class name + $class = $prefix.$name; + // initialize the model + new $class(); + $model = JModelLegacy::getInstance($name, $prefix); + } + return $model; } /** @@ -480,7 +491,14 @@ abstract class DemoHelper $query = $db->getQuery(true); $query->select($db->quoteName(array($what))); - $query->from($db->quoteName('#_'.$main.'_'.$table)); + if (empty($table)) + { + $query->from($db->quoteName('#__'.$main)); + } + else + { + $query->from($db->quoteName('#_'.$main.'_'.$table)); + } $query->where($db->quoteName($whereString) . ' '.$operator.' (' . implode(',',$where) . ')'); $db->setQuery($query); $db->execute(); @@ -793,7 +811,13 @@ abstract class DemoHelper return false; } + // typo sorry! public static function sorten($string, $length = 40, $addTip = true) + { + return self::shorten($string, $length, $addTip); + } + + public static function shorten($string, $length = 40, $addTip = true) { if (self::checkString($string)) { @@ -816,7 +840,7 @@ abstract class DemoHelper $final = strlen($newString); if ($initial != $final && $addTip) { - $title = self::sorten($string, 400 , false); + $title = self::shorten($string, 400 , false); return ''.trim($newString).'...'; } elseif ($initial != $final && !$addTip) @@ -847,7 +871,8 @@ abstract class DemoHelper // If you don't need to handle multi-byte characters // you can use preg_replace rather than mb_ereg_replace // Thanks @Łukasz Rysiak! - $string = mb_ereg_replace("([^\w\s\d\-_\(\)])", '', $string); + // $string = mb_ereg_replace("([^\w\s\d\-_\(\)])", '', $string); + $string = preg_replace("([^\w\s\d\-_\(\)])", '', $string); // http://stackoverflow.com/a/2021729/1429677 return preg_replace('/\s+/', ' ', $string); } @@ -914,15 +939,15 @@ abstract class DemoHelper return ''; } - public static function htmlEscape($var, $charset = 'UTF-8', $sorten = false, $length = 40) + public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40) { if (self::checkString($var)) { $filter = new JFilterInput(); $string = $filter->clean(html_entity_decode(htmlentities($var, ENT_COMPAT, $charset)), 'HTML'); - if ($sorten) + if ($shorten) { - return self::sorten($string,$length); + return self::shorten($string,$length); } return $string; } diff --git a/site/helpers/headercheck.php b/site/helpers/headercheck.php index e796607..cbae176 100644 --- a/site/helpers/headercheck.php +++ b/site/helpers/headercheck.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage headercheck.php @@ -21,7 +21,7 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -class HeaderCheck +class demoHeaderCheck { function js_loaded($script_name) { diff --git a/site/helpers/route.php b/site/helpers/route.php index 71b2cd2..6513a21 100644 --- a/site/helpers/route.php +++ b/site/helpers/route.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage route.php diff --git a/site/layouts/look/details_above.php b/site/layouts/look/details_above.php index 0d82da0..1a1dcb2 100644 --- a/site/layouts/look/details_above.php +++ b/site/layouts/look/details_above.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage details_above.php diff --git a/site/layouts/look/details_fullwidth.php b/site/layouts/look/details_fullwidth.php index 8800b99..91aef05 100644 --- a/site/layouts/look/details_fullwidth.php +++ b/site/layouts/look/details_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage details_fullwidth.php diff --git a/site/layouts/look/details_under.php b/site/layouts/look/details_under.php index 4814254..a4b21e8 100644 --- a/site/layouts/look/details_under.php +++ b/site/layouts/look/details_under.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage details_under.php diff --git a/site/layouts/look/metadata.php b/site/layouts/look/metadata.php index 470bb02..84d4cb4 100644 --- a/site/layouts/look/metadata.php +++ b/site/layouts/look/metadata.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage metadata.php diff --git a/site/layouts/look/more_left.php b/site/layouts/look/more_left.php index 8b6d65b..0dccdad 100644 --- a/site/layouts/look/more_left.php +++ b/site/layouts/look/more_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage more_left.php diff --git a/site/layouts/look/more_right.php b/site/layouts/look/more_right.php index ca7e96c..6e5e968 100644 --- a/site/layouts/look/more_right.php +++ b/site/layouts/look/more_right.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage more_right.php diff --git a/site/layouts/look/publishing.php b/site/layouts/look/publishing.php index b95bfc1..fcde37a 100644 --- a/site/layouts/look/publishing.php +++ b/site/layouts/look/publishing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage publishing.php diff --git a/site/models/forms/look.js b/site/models/forms/look.js index b2fc9f4..528ec58 100644 --- a/site/models/forms/look.js +++ b/site/models/forms/look.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage look.js diff --git a/site/models/look.php b/site/models/look.php index c99ea60..58f6c7d 100644 --- a/site/models/look.php +++ b/site/models/look.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage look.php diff --git a/site/models/looking.php b/site/models/looking.php index d0d81af..fc90ef3 100644 --- a/site/models/looking.php +++ b/site/models/looking.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage looking.php diff --git a/site/models/looks.php b/site/models/looks.php index c4ecda4..1b5fc62 100644 --- a/site/models/looks.php +++ b/site/models/looks.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage looks.php @@ -71,6 +71,7 @@ class DemoModelLooks extends JModelList array('a.id','a.name','a.alias','a.description','a.add','a.email','a.mobile_phone','a.dateofbirth','a.image','a.website','a.not_required','a.published','a.hits','a.ordering'), array('id','name','alias','description','add','email','mobile_phone','dateofbirth','image','website','not_required','published','hits','ordering'))); $query->from($db->quoteName('#__demo_look', 'a')); + // Get where a.published is 1 $query->where('a.published = 1'); $query->order('a.name ASC'); diff --git a/site/router.php b/site/router.php index 1143218..7277343 100644 --- a/site/router.php +++ b/site/router.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage router.php diff --git a/site/views/look/submitbutton.js b/site/views/look/submitbutton.js index 3215921..f2ecf51 100644 --- a/site/views/look/submitbutton.js +++ b/site/views/look/submitbutton.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage submitbutton.js diff --git a/site/views/look/tmpl/edit.php b/site/views/look/tmpl/edit.php index b48e3d6..5faca15 100644 --- a/site/views/look/tmpl/edit.php +++ b/site/views/look/tmpl/edit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage edit.php @@ -33,7 +33,8 @@ $componentParams = JComponentHelper::getParams('com_demo'); toolbar->render(); ?> -
+ +
'details')); ?> @@ -96,6 +97,7 @@ $componentParams = JComponentHelper::getParams('com_demo');
+
diff --git a/site/views/look/view.html.php b/site/views/look/view.html.php index 5913b36..748a6fe 100644 --- a/site/views/look/view.html.php +++ b/site/views/look/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage view.html.php diff --git a/site/views/looking/tmpl/default.php b/site/views/looking/tmpl/default.php index 0fc8287..a3d1c4b 100644 --- a/site/views/looking/tmpl/default.php +++ b/site/views/looking/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage default.php diff --git a/site/views/looking/view.html.php b/site/views/looking/view.html.php index ce622a5..1ab9260 100644 --- a/site/views/looking/view.html.php +++ b/site/views/looking/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage view.html.php @@ -105,7 +105,7 @@ class DemoViewLooking extends JViewLegacy // Load the header checker class. require_once( JPATH_COMPONENT_SITE.'/helpers/headercheck.php' ); // Initialize the header checker. - $HeaderCheck = new HeaderCheck; + $HeaderCheck = new demoHeaderCheck; // Load uikit options. $uikit = $this->params->get('uikit_load'); diff --git a/site/views/looks/tmpl/default.php b/site/views/looks/tmpl/default.php index a248971..2b76e2a 100644 --- a/site/views/looks/tmpl/default.php +++ b/site/views/looks/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage default.php diff --git a/site/views/looks/view.html.php b/site/views/looks/view.html.php index 5a07a98..43d3e61 100644 --- a/site/views/looks/view.html.php +++ b/site/views/looks/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 2.0.0 - @build 8th April, 2017 + @build 21st August, 2017 @created 18th October, 2016 @package Demo @subpackage view.html.php @@ -69,7 +69,7 @@ class DemoViewLooks extends JViewLegacy // Load the header checker class. require_once( JPATH_COMPONENT_SITE.'/helpers/headercheck.php' ); // Initialize the header checker. - $HeaderCheck = new HeaderCheck; + $HeaderCheck = new demoHeaderCheck; // Load uikit options. $uikit = $this->params->get('uikit_load');