Update the component to use github as update server

This commit is contained in:
Llewellyn van der Merwe 2018-05-05 15:32:19 +02:00
parent 00f642156a
commit 508dd34a81
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
81 changed files with 146 additions and 112 deletions

View File

@ -10,7 +10,7 @@ Just a basic demo of the most basic implementations of the [Joomla](http://www.j
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Demo](https://www.vdm.io/)
+ *First Build*: 18th October, 2016
+ *Last Build*: 24th April, 2018
+ *Last Build*: 5th May, 2018
+ *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-builder
> (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*: **14587**
+ *Line count*: **14621**
+ *File count*: **147**
+ *Folder count*: **54**

View File

@ -10,7 +10,7 @@ Just a basic demo of the most basic implementations of the [Joomla](http://www.j
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Demo](https://www.vdm.io/)
+ *First Build*: 18th October, 2016
+ *Last Build*: 24th April, 2018
+ *Last Build*: 5th May, 2018
+ *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-builder
> (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*: **14587**
+ *Line count*: **14621**
+ *File count*: **147**
+ *Folder count*: **54**

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage admin.css

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage dashboard.css

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage look.css

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage looks.css

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage admin.js

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage controller.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage demo.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage import.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage look.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage looks.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage demo.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage demo.php
@ -509,8 +509,15 @@ abstract class DemoHelper
return false;
}
public static function jsonToString($value, $sperator = ", ", $table = null)
public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name')
{
// do some table foot work
$external = false;
if (strpos($table, '#__') !== false)
{
$external = true;
$table = str_replace('#__', '', $table);
}
// check if string is JSON
$result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE)
@ -523,9 +530,19 @@ abstract class DemoHelper
$names = array();
foreach ($result as $val)
{
if ($name = self::getVar($table, $val, 'id', 'name'))
if ($external)
{
$names[] = $name;
if ($name = self::getVar(null, $val, $id, $name, '=', $table))
{
$names[] = $name;
}
}
else
{
if ($name = self::getVar($table, $val, $id, $name))
{
$names[] = $name;
}
}
}
if (self::checkArray($names))

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage headercheck.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage batch_.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage batchselection.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage details_above.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage details_fullwidth.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage details_under.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage metadata.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage more_left.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage more_right.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage publishing.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage demo.php

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage look.js

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage import.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage look.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage looks.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage look.php
@ -318,29 +318,29 @@ class DemoTableLook extends JTable
$asset->loadByName('com_demo');
return $asset->id;
}
/**
* Generate a valid alias from title / date.
* Remains public to be able to check for duplicated alias before saving
*
* @return string
*/
public function generateAlias()
{
if (empty($this->alias))
{
$this->alias = $this->name;
}
$this->alias = JApplication::stringURLSafe($this->alias);
if (trim(str_replace('-', '', $this->alias)) == '')
{
$this->alias = JFactory::getDate()->format("Y-m-d-H-i-s");
}
return $this->alias;
}
/**
* Generate a valid alias from title / date.
* Remains public to be able to check for duplicated alias before saving
*
* @return string
*/
public function generateAlias()
{
if (empty($this->alias))
{
$this->alias = $this->name;
}
$this->alias = JApplication::stringURLSafe($this->alias);
if (trim(str_replace('-', '', $this->alias)) == '')
{
$this->alias = JFactory::getDate()->format('Y-m-d-H-i-s');
}
return $this->alias;
}
}

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage default.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage default_main.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage default_vdm.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage view.html.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage default.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage view.html.php

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage submitbutton.js

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage edit.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage view.html.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage default.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage default_batch_body.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage default_batch_footer.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage default_body.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage default_foot.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage default_head.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage default_toolbar.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage view.html.php

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade">
<name>COM_DEMO</name>
<creationDate>24th April, 2018</creationDate>
<creationDate>5th May, 2018</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://www.vdm.io/</authorUrl>
@ -95,6 +95,6 @@
</administration>
<updateservers>
<server type="extension" enabled="1" element="com_demo" name="Demo">https://www.vdm.io/updates/demo_update_server.xml</server>
<server type="extension" enabled="1" element="com_demo" name="Demo">https://raw.githubusercontent.com/namibia/demo-joomla-3-component/master/demo_updateserver.xml</server>
</updateservers>
</extension>

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage script.php

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage look.css

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage looking.css

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage looks.css

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage site.css

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage site.js

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage controller.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage look.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage demo.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage category.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage demo.php
@ -74,8 +74,15 @@ abstract class DemoHelper
}
public static function jsonToString($value, $sperator = ", ", $table = null)
public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name')
{
// do some table foot work
$external = false;
if (strpos($table, '#__') !== false)
{
$external = true;
$table = str_replace('#__', '', $table);
}
// check if string is JSON
$result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE)
@ -88,9 +95,19 @@ abstract class DemoHelper
$names = array();
foreach ($result as $val)
{
if ($name = self::getVar($table, $val, 'id', 'name'))
if ($external)
{
$names[] = $name;
if ($name = self::getVar(null, $val, $id, $name, '=', $table))
{
$names[] = $name;
}
}
else
{
if ($name = self::getVar($table, $val, $id, $name))
{
$names[] = $name;
}
}
}
if (self::checkArray($names))

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage headercheck.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage route.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage details_above.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage details_fullwidth.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage details_under.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage metadata.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage more_left.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage more_right.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage publishing.php

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage look.js

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage look.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage looking.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage looks.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage router.php

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage submitbutton.js

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage edit.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage view.html.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage default.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage view.html.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage default.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0
@build 24th April, 2018
@build 5th May, 2018
@created 18th October, 2016
@package Demo
@subpackage view.html.php