Next update.

This commit is contained in:
Llewellyn van der Merwe 2016-06-02 08:45:56 +01:00
parent 9905ffa027
commit a2e4972feb
89 changed files with 429 additions and 260 deletions

View File

@ -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) + *Author*: [Llewellyn van der Merwe] (mailto:info@vdm.io)
+ *Name*: [Demo] (https://www.vdm.io/) + *Name*: [Demo] (https://www.vdm.io/)
+ *First Build*: 5th August, 2015 + *First Build*: 5th August, 2015
+ *Last Build*: 2nd May, 2016 + *Last Build*: 2nd June, 2016
+ *Version*: 1.0.5 + *Version*: 1.0.5
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *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**, > (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.) > never making one mistake or taking any coffee break.)
+ *Line count*: **16713** + *Line count*: **16832**
+ *File count*: **152** + *File count*: **152**
+ *Folder count*: **50** + *Folder count*: **50**

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage admin.css @subpackage admin.css

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage dashboard.css @subpackage dashboard.css

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage help_document.css @subpackage help_document.css

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage help_documents.css @subpackage help_documents.css

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage look.css @subpackage look.css

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage looks.css @subpackage looks.css

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage controller.php @subpackage controller.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage demo.php @subpackage demo.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage help.php @subpackage help.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage help_document.php @subpackage help_document.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage help_documents.php @subpackage help_documents.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage import.php @subpackage import.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage look.php @subpackage look.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage looks.php @subpackage looks.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage demo.php @subpackage demo.php

View File

@ -0,0 +1,49 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@author Llewellyn van der Merwe <http://www.vdm.io>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
/-----------------------------------------------------------------------------------------------------------------------------*/
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
class PHPExcel_Reader_chunkReadFilter implements PHPExcel_Reader_IReadFilter
{
private $_startRow = 0;
private $_endRow = 0;
/** Set the list of rows that we want to read */
public function setRows($startRow, $chunkSize)
{
$this->_startRow = $startRow;
$this->_endRow = $startRow + $chunkSize;
}
public function readCell($column, $row, $worksheetName = '')
{
// Only read the heading row, and the rows that are configured in $this->_startRow and $this->_endRow
if (($row == 1) || ($row >= $this->_startRow && $row < $this->_endRow)) {
return true;
}
return false;
}
}

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage demo.php @subpackage demo.php
@ -296,8 +296,9 @@ abstract class DemoHelper
*/ */
public static function getFileHeaders($dataType) public static function getFileHeaders($dataType)
{ {
// make sure the file is loaded // make sure these files are loaded
JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers'); JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');
JLoader::import('ChunkReadFilter', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/PHPExcel/Reader');
// get session object // get session object
$session = JFactory::getSession(); $session = JFactory::getSession();
$package = $session->get('package', null); $package = $session->get('package', null);
@ -305,9 +306,17 @@ abstract class DemoHelper
// set the headers // set the headers
if(isset($package['dir'])) if(isset($package['dir']))
{ {
$chunkFilter = new PHPExcel_Reader_chunkReadFilter();
// only load first three rows
$chunkFilter->setRows(2,1);
// identify the file type
$inputFileType = PHPExcel_IOFactory::identify($package['dir']); $inputFileType = PHPExcel_IOFactory::identify($package['dir']);
// create the reader for this file type
$excelReader = PHPExcel_IOFactory::createReader($inputFileType); $excelReader = PHPExcel_IOFactory::createReader($inputFileType);
// load the limiting filter
$excelReader->setReadFilter($chunkFilter);
$excelReader->setReadDataOnly(true); $excelReader->setReadDataOnly(true);
// load the rows (only first three)
$excelObj = $excelReader->load($package['dir']); $excelObj = $excelReader->load($package['dir']);
$headers = array(); $headers = array();
foreach ($excelObj->getActiveSheet()->getRowIterator() as $row) foreach ($excelObj->getActiveSheet()->getRowIterator() as $row)
@ -403,31 +412,33 @@ abstract class DemoHelper
return false; return false;
} }
public static function jsonToString($value, $sperator = ", ") public static function jsonToString($value, $sperator = ", ", $table = null)
{ {
// check if string is JSON // check if string is JSON
$result = json_decode($value, true); $result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE) { if (json_last_error() === JSON_ERROR_NONE)
{
// is JSON // is JSON
if (self::checkArray($result)) if (self::checkArray($result))
{ {
$value = ''; if (self::checkString($table))
$counter = 0;
foreach ($result as $string)
{ {
if ($counter) $names = array();
foreach ($result as $val)
{ {
$value .= $sperator.$string; if ($name = self::getVar($table, $val, 'id', 'name'))
}
else
{ {
$value .= $string; $names[] = $name;
} }
$counter++;
} }
return $value; if (self::checkArray($names))
{
return (string) implode($sperator,$names);
} }
return json_decode($value); }
return (string) implode($sperator,$result);
}
return (string) json_decode($value);
} }
return $value; return $value;
} }

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage batch_.php @subpackage batch_.php

View File

@ -18,6 +18,7 @@ COM_DEMO_CONFIG_GLOBAL_DESC="The Global Parameters"
COM_DEMO_CONFIG_GLOBAL_LABEL="Global" COM_DEMO_CONFIG_GLOBAL_LABEL="Global"
COM_DEMO_CONTRIBUTOR="Contributor" COM_DEMO_CONTRIBUTOR="Contributor"
COM_DEMO_CONTRIBUTORS="Contributors" COM_DEMO_CONTRIBUTORS="Contributors"
COM_DEMO_CREATE_NEW_S="Create New %s"
COM_DEMO_DASH="Dashboard" COM_DEMO_DASH="Dashboard"
COM_DEMO_DASHBOARD="Demo Dashboard" COM_DEMO_DASHBOARD="Demo Dashboard"
COM_DEMO_DASHBOARD_HELP_DOCUMENTS="Help Documents<br /><br />" COM_DEMO_DASHBOARD_HELP_DOCUMENTS="Help Documents<br /><br />"
@ -28,6 +29,7 @@ COM_DEMO_EDIT_CREATED_BY="Edit Created By"
COM_DEMO_EDIT_CREATED_BY_DESC=" Allows users in this group to edit created by." COM_DEMO_EDIT_CREATED_BY_DESC=" Allows users in this group to edit created by."
COM_DEMO_EDIT_CREATED_DATE="Edit Created Date" COM_DEMO_EDIT_CREATED_DATE="Edit Created Date"
COM_DEMO_EDIT_CREATED_DATE_DESC=" Allows users in this group to edit created date." COM_DEMO_EDIT_CREATED_DATE_DESC=" Allows users in this group to edit created date."
COM_DEMO_EDIT_S="Edit %s"
COM_DEMO_EDIT_VERSIONS="Edit Version" COM_DEMO_EDIT_VERSIONS="Edit Version"
COM_DEMO_EDIT_VERSIONS_DESC=" Allows users in this group to edit versions." COM_DEMO_EDIT_VERSIONS_DESC=" Allows users in this group to edit versions."
COM_DEMO_EXPORT_DATA="Export Data" COM_DEMO_EXPORT_DATA="Export Data"
@ -84,6 +86,7 @@ COM_DEMO_HELP_DOCUMENT_ADMIN_VIEW_DESCRIPTION="Select the view being targeted"
COM_DEMO_HELP_DOCUMENT_ADMIN_VIEW_LABEL="Admin Views" COM_DEMO_HELP_DOCUMENT_ADMIN_VIEW_LABEL="Admin Views"
COM_DEMO_HELP_DOCUMENT_ALIAS="Alias" COM_DEMO_HELP_DOCUMENT_ALIAS="Alias"
COM_DEMO_HELP_DOCUMENT_ALIAS_HINT="Auto-generated from name" COM_DEMO_HELP_DOCUMENT_ALIAS_HINT="Auto-generated from name"
COM_DEMO_HELP_DOCUMENT_ALIAS_LABEL="Alias"
COM_DEMO_HELP_DOCUMENT_ALL="All" COM_DEMO_HELP_DOCUMENT_ALL="All"
COM_DEMO_HELP_DOCUMENT_ARTICLE="Article" COM_DEMO_HELP_DOCUMENT_ARTICLE="Article"
COM_DEMO_HELP_DOCUMENT_ARTICLE_LABEL="Article" COM_DEMO_HELP_DOCUMENT_ARTICLE_LABEL="Article"
@ -242,6 +245,7 @@ COM_DEMO_LOOK_ADD_LABEL="Add Custom Stuff"
COM_DEMO_LOOK_AGE_LABEL="Age Group" COM_DEMO_LOOK_AGE_LABEL="Age Group"
COM_DEMO_LOOK_ALIAS="Alias" COM_DEMO_LOOK_ALIAS="Alias"
COM_DEMO_LOOK_ALIAS_HINT="Auto-generated from name" COM_DEMO_LOOK_ALIAS_HINT="Auto-generated from name"
COM_DEMO_LOOK_ALIAS_LABEL="Alias"
COM_DEMO_LOOK_CREATED_BY_DESC="The user that created the Look." COM_DEMO_LOOK_CREATED_BY_DESC="The user that created the Look."
COM_DEMO_LOOK_CREATED_BY_LABEL="Created by" COM_DEMO_LOOK_CREATED_BY_LABEL="Created by"
COM_DEMO_LOOK_CREATED_DATE_DESC="The date Look was created." COM_DEMO_LOOK_CREATED_DATE_DESC="The date Look was created."

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage batchselection.php @subpackage batchselection.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage details_above.php @subpackage details_above.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage details_fullwidth.php @subpackage details_fullwidth.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage details_left.php @subpackage details_left.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage details_right.php @subpackage details_right.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage details_under.php @subpackage details_under.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage metadata.php @subpackage metadata.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage publishing.php @subpackage publishing.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage details_above.php @subpackage details_above.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage details_left.php @subpackage details_left.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage details_right.php @subpackage details_right.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage details_under.php @subpackage details_under.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage metadata.php @subpackage metadata.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage publishing.php @subpackage publishing.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage repetable_numbers_left.php @subpackage repetable_numbers_left.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage repetable_numbers_right.php @subpackage repetable_numbers_right.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage demo.php @subpackage demo.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage articles.php @subpackage articles.php
@ -52,10 +52,9 @@ class JFormFieldArticles extends JFormFieldList
// if true set button // if true set button
if ($setButton === 'true') if ($setButton === 'true')
{ {
$user = JFactory::getUser(); $button = array();
// only add if user allowed to create article $script = array();
if ($user->authorise('core.create', 'com_demo')) $buttonName = $this->getAttribute('name');
{
// get the input from url // get the input from url
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
// get the view name & id // get the view name & id
@ -65,17 +64,78 @@ class JFormFieldArticles extends JFormFieldList
)); ));
// check if new item // check if new item
$ref = ''; $ref = '';
$refJ = '';
if (!is_null($values['id']) && strlen($values['view'])) if (!is_null($values['id']) && strlen($values['view']))
{ {
// only load referal if not new item. // only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id']; $ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
} }
// build the button $user = JFactory::getUser();
$button = '<a class="btn btn-small btn-success" // only add if user allowed to create article
if ($user->authorise('core.create', 'com_demo'))
{
// build Create button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Create" class="btn btn-small btn-success hasTooltip" title="'.JText::sprintf('COM_DEMO_CREATE_NEW_S', $buttonNamee).'" style="border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;"
href="index.php?option=com_demo&amp;view=article&amp;layout=edit'.$ref.'" > href="index.php?option=com_demo&amp;view=article&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span>' . JText::_('COM_DEMO_NEW') . '</a>'; <span class="icon-new icon-white"></span></a>';
// return the button attached to input field }
return $html . $button; // only add if user allowed to edit article
if (($buttonName == 'article' || $buttonName == 'articles') && $user->authorise('core.edit', 'com_demo'))
{
// build edit button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_DEMO_EDIT_S', $buttonNamee).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
<span class="icon-edit"></span></a>';
// build script
$script[] = "
jQuery(document).ready(function() {
jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
e.preventDefault();
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
".$buttonName."Button(".$buttonName."Value);
});
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
".$buttonName."Button(".$buttonName."Value);
});
function ".$buttonName."Button(value) {
if (value > 0) {
// hide the create button
jQuery('#".$buttonName."Create').hide();
// show edit button
jQuery('#".$buttonName."Edit').show();
var url = 'index.php?option=com_demo&view=articles&task=article.edit&id='+value+'".$refJ."';
jQuery('#".$buttonName."Edit').attr('href', url);
} else {
// show the create button
jQuery('#".$buttonName."Create').show();
// hide edit button
jQuery('#".$buttonName."Edit').hide();
}
}";
}
// check if button was created for article field.
if (is_array($button) && count($button) > 0)
{
// Add some final script
$script[] = "
jQuery(document).ready(function() {
jQuery('#jform_".$buttonName."').closest('.control-group').addClass('input-append');
});";
// Load the needed script.
$document = JFactory::getDocument();
$document->addScriptDeclaration(implode(' ',$script));
// return the button attached to input field.
return $html . implode('',$button);
} }
} }
return $html; return $html;

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage help_document.js @subpackage help_document.js

View File

@ -19,6 +19,7 @@
label="COM_DEMO_HELP_DOCUMENT_CREATED_DATE_LABEL" label="COM_DEMO_HELP_DOCUMENT_CREATED_DATE_LABEL"
description="COM_DEMO_HELP_DOCUMENT_CREATED_DATE_DESC" description="COM_DEMO_HELP_DOCUMENT_CREATED_DATE_DESC"
size="22" size="22"
format="%Y-%m-%d %H:%M:%S" format="%Y-%m-%d %H:%M:%S"
filter="user_utc" filter="user_utc"
/> />
@ -27,11 +28,13 @@
name="created_by" name="created_by"
type="user" type="user"
label="COM_DEMO_HELP_DOCUMENT_CREATED_BY_LABEL" label="COM_DEMO_HELP_DOCUMENT_CREATED_BY_LABEL"
description="COM_DEMO_HELP_DOCUMENT_CREATED_BY_DESC" description="COM_DEMO_HELP_DOCUMENT_CREATED_BY_DESC"
/> />
<!-- Published Field. Type: List (joomla) --> <!-- Published Field. Type: List (joomla) -->
<field name="published" type="list" label="JSTATUS" <field name="published" type="list" label="JSTATUS"
description="JFIELD_PUBLISHED_DESC" class="chzn-color-state" description="JFIELD_PUBLISHED_DESC" class="chzn-color-state"
filter="intval" size="1" default="1" > filter="intval" size="1" default="1" >
<option value="1"> <option value="1">
JPUBLISHED</option> JPUBLISHED</option>
@ -59,6 +62,7 @@
label="JFIELD_ACCESS_LABEL" label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC" description="JFIELD_ACCESS_DESC"
default="1" default="1"
required="false" required="false"
/> />
<!-- Ordering Field. Type: Numbers (joomla) --> <!-- Ordering Field. Type: Numbers (joomla) -->
@ -70,6 +74,7 @@
description="" description=""
default="0" default="0"
size="6" size="6"
required="false" required="false"
/> />
<!-- Version Field. Type: Text (joomla) --> <!-- Version Field. Type: Text (joomla) -->
@ -209,7 +214,7 @@
<field <field
type="text" type="text"
name="alias" name="alias"
label="JFIELD_ALIAS_LABEL" label="COM_DEMO_HELP_DOCUMENT_ALIAS_LABEL"
description="JFIELD_ALIAS_DESC" description="JFIELD_ALIAS_DESC"
filter="STRING" filter="STRING"
hint="COM_DEMO_HELP_DOCUMENT_ALIAS_HINT" hint="COM_DEMO_HELP_DOCUMENT_ALIAS_HINT"

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage look.js @subpackage look.js

View File

@ -19,6 +19,7 @@
label="COM_DEMO_LOOK_CREATED_DATE_LABEL" label="COM_DEMO_LOOK_CREATED_DATE_LABEL"
description="COM_DEMO_LOOK_CREATED_DATE_DESC" description="COM_DEMO_LOOK_CREATED_DATE_DESC"
size="22" size="22"
format="%Y-%m-%d %H:%M:%S" format="%Y-%m-%d %H:%M:%S"
filter="user_utc" filter="user_utc"
/> />
@ -27,11 +28,13 @@
name="created_by" name="created_by"
type="user" type="user"
label="COM_DEMO_LOOK_CREATED_BY_LABEL" label="COM_DEMO_LOOK_CREATED_BY_LABEL"
description="COM_DEMO_LOOK_CREATED_BY_DESC" description="COM_DEMO_LOOK_CREATED_BY_DESC"
/> />
<!-- Published Field. Type: List (joomla) --> <!-- Published Field. Type: List (joomla) -->
<field name="published" type="list" label="JSTATUS" <field name="published" type="list" label="JSTATUS"
description="JFIELD_PUBLISHED_DESC" class="chzn-color-state" description="JFIELD_PUBLISHED_DESC" class="chzn-color-state"
filter="intval" size="1" default="1" > filter="intval" size="1" default="1" >
<option value="1"> <option value="1">
JPUBLISHED</option> JPUBLISHED</option>
@ -59,6 +62,7 @@
label="JFIELD_ACCESS_LABEL" label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC" description="JFIELD_ACCESS_DESC"
default="1" default="1"
required="false" required="false"
/> />
<!-- Ordering Field. Type: Numbers (joomla) --> <!-- Ordering Field. Type: Numbers (joomla) -->
@ -70,6 +74,7 @@
description="" description=""
default="0" default="0"
size="6" size="6"
required="false" required="false"
/> />
<!-- Version Field. Type: Text (joomla) --> <!-- Version Field. Type: Text (joomla) -->
@ -276,7 +281,7 @@
<field <field
type="text" type="text"
name="alias" name="alias"
label="JFIELD_ALIAS_LABEL" label="COM_DEMO_LOOK_ALIAS_LABEL"
description="JFIELD_ALIAS_DESC" description="JFIELD_ALIAS_DESC"
filter="STRING" filter="STRING"
hint="COM_DEMO_LOOK_ALIAS_HINT" hint="COM_DEMO_LOOK_ALIAS_HINT"

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage help_document.php @subpackage help_document.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage help_documents.php @subpackage help_documents.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage import.php @subpackage import.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage look.php @subpackage look.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage looks.php @subpackage looks.php

View File

@ -81,3 +81,9 @@ CREATE TABLE IF NOT EXISTS `#__demo_help_document` (
KEY `idx_article` (`article`) KEY `idx_article` (`article`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
--
-- Always insure this column is large enough for all the access control values.
--
ALTER TABLE `#__assets` CHANGE `rules` `rules` MEDIUMTEXT NOT NULL COMMENT 'JSON encoded access control.';

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage help_document.php @subpackage help_document.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage look.php @subpackage look.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage default.php @subpackage default.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage default_main.php @subpackage default_main.php
@ -22,7 +22,7 @@
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
?> ?>
<?php if(is_array($this->icons['main'])) :?> <?php if(isset($this->icons['main']) && is_array($this->icons['main'])) :?>
<?php foreach($this->icons['main'] as $icon): ?> <?php foreach($this->icons['main'] as $icon): ?>
<div class="dashboard-wraper"> <div class="dashboard-wraper">
<div class="dashboard-content"> <div class="dashboard-content">
@ -33,5 +33,7 @@ defined('_JEXEC') or die('Restricted access');
</div> </div>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
<div class="clearfix"></div> <div class="clearfix"></div>
<?php else: ?>
<div class="alert alert-error"><h4 class="alert-heading"><?php echo JText::_("Permission denied, or not correctly set"); ?></h4><div class="alert-message"><?php echo JText::_("Please notify your System Administrator if result is unexpected."); ?></div></div>
<?php endif; ?> <?php endif; ?>

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage default_vdm.php @subpackage default_vdm.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage view.html.php @subpackage view.html.php

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage submitbutton.js @subpackage submitbutton.js

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage edit.php @subpackage edit.php
@ -28,7 +28,29 @@ JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive'); JHtml::_('behavior.keepalive');
$componentParams = JComponentHelper::getParams('com_demo'); $componentParams = JComponentHelper::getParams('com_demo');
?> ?>
<script type="text/javascript">
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_demo/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
jQuery('#loading').show();
// when page is ready remove and show
jQuery(window).load(function() {
jQuery('#demo_loader').fadeIn('fast');
jQuery('#loading').hide();
});
</script>
<div id="demo_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_demo&layout=edit&id='.(int) $this->item->id.$this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data"> <form action="<?php echo JRoute::_('index.php?option=com_demo&layout=edit&id='.(int) $this->item->id.$this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('help_document.details_above', $this); ?><div class="form-horizontal"> <?php echo JLayoutHelper::render('help_document.details_above', $this); ?><div class="form-horizontal">
@ -94,6 +116,7 @@ $componentParams = JComponentHelper::getParams('com_demo');
<div class="clearfix"></div> <div class="clearfix"></div>
<?php echo JLayoutHelper::render('help_document.details_under', $this); ?> <?php echo JLayoutHelper::render('help_document.details_under', $this); ?>
</form> </form>
</div>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage view.html.php @subpackage view.html.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage default.php @subpackage default.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage default_batch_body.php @subpackage default_batch_body.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage default_batch_footer.php @subpackage default_batch_footer.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage default_body.php @subpackage default_body.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage default_foot.php @subpackage default_foot.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage default_head.php @subpackage default_head.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage default_toolbar.php @subpackage default_toolbar.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage view.html.php @subpackage view.html.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage default.php @subpackage default.php
@ -26,8 +26,7 @@ JHtml::_('bootstrap.tooltip');
JHtml::_('script', 'system/core.js', false, true); JHtml::_('script', 'system/core.js', false, true);
?> ?>
<script type="text/javascript"> <script type="text/javascript">
<?php if ($this->hasPackage && DemoHelper::checkArray($this->headerList)) : ?>
<?php if ($this->hasPackage && DemoHelper::checkArray($this->headerList)) : ?>
Joomla.continueImport = function() Joomla.continueImport = function()
{ {
var form = document.getElementById('adminForm'); var form = document.getElementById('adminForm');
@ -54,7 +53,7 @@ JHtml::_('script', 'system/core.js', false, true);
form.submit(); form.submit();
} }
}; };
<?php else: ?> <?php else: ?>
Joomla.submitbutton = function() Joomla.submitbutton = function()
{ {
var form = document.getElementById('adminForm'); var form = document.getElementById('adminForm');
@ -107,10 +106,10 @@ JHtml::_('script', 'system/core.js', false, true);
form.submit(); form.submit();
} }
}; };
<?php endif; ?> <?php endif; ?>
// Add spindle-wheel for importations: // Add spindle-wheel for importations:
jQuery(document).ready(function($) { jQuery(document).ready(function($) {
var outerDiv = $('body'); var outerDiv = $('body');
$('<div id="loading"></div>') $('<div id="loading"></div>')
@ -125,7 +124,7 @@ JHtml::_('script', 'system/core.js', false, true);
.css("filter", "alpha(opacity = 80)") .css("filter", "alpha(opacity = 80)")
.css("display", "none") .css("display", "none")
.appendTo(outerDiv); .appendTo(outerDiv);
}); });
</script> </script>
@ -216,9 +215,7 @@ JHtml::_('script', 'system/core.js', false, true);
<input type="button" class="btn btn-primary" value="<?php echo JText::_('COM_DEMO_IMPORT_GET_BOTTON'); ?>" onclick="Joomla.submitbutton4()" />&nbsp;&nbsp;&nbsp;<small><?php echo JText::_('COM_DEMO_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small> <input type="button" class="btn btn-primary" value="<?php echo JText::_('COM_DEMO_IMPORT_GET_BOTTON'); ?>" onclick="Joomla.submitbutton4()" />&nbsp;&nbsp;&nbsp;<small><?php echo JText::_('COM_DEMO_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
</div> </div>
</fieldset> </fieldset>
<?php echo JHtml::_('bootstrap.endTab'); ?> <?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?> <?php echo JHtml::_('bootstrap.endTabSet'); ?>
<input type="hidden" name="gettype" value="upload" /> <input type="hidden" name="gettype" value="upload" />
<?php endif; ?> <?php endif; ?>

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage view.html.php @subpackage view.html.php

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage submitbutton.js @subpackage submitbutton.js

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage edit.php @subpackage edit.php
@ -28,7 +28,7 @@ JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive'); JHtml::_('behavior.keepalive');
$componentParams = JComponentHelper::getParams('com_demo'); $componentParams = JComponentHelper::getParams('com_demo');
?> ?>
<div id="demo_loader">
<form action="<?php echo JRoute::_('index.php?option=com_demo&layout=edit&id='.(int) $this->item->id.$this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data"> <form action="<?php echo JRoute::_('index.php?option=com_demo&layout=edit&id='.(int) $this->item->id.$this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('look.details_above', $this); ?><div class="form-horizontal"> <?php echo JLayoutHelper::render('look.details_above', $this); ?><div class="form-horizontal">
@ -100,6 +100,7 @@ $componentParams = JComponentHelper::getParams('com_demo');
<div class="clearfix"></div> <div class="clearfix"></div>
<?php echo JLayoutHelper::render('look.details_under', $this); ?> <?php echo JLayoutHelper::render('look.details_under', $this); ?>
</form> </form>
</div>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage view.html.php @subpackage view.html.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage default.php @subpackage default.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage default_batch_body.php @subpackage default_batch_body.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage default_batch_footer.php @subpackage default_batch_footer.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage default_body.php @subpackage default_body.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage default_foot.php @subpackage default_foot.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage default_head.php @subpackage default_head.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage default_toolbar.php @subpackage default_toolbar.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage view.html.php @subpackage view.html.php

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade"> <extension type="component" version="3.2" method="upgrade">
<name>COM_DEMO</name> <name>COM_DEMO</name>
<creationDate>2nd May, 2016</creationDate> <creationDate>2nd June, 2016</creationDate>
<author>Llewellyn van der Merwe</author> <author>Llewellyn van der Merwe</author>
<authorEmail>info@vdm.io</authorEmail> <authorEmail>info@vdm.io</authorEmail>
<authorUrl>https://www.vdm.io/</authorUrl> <authorUrl>https://www.vdm.io/</authorUrl>

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage script.php @subpackage script.php

View File

@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage site.css @subpackage site.css

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage controller.php @subpackage controller.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage help.php @subpackage help.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage demo.php @subpackage demo.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage demo.php @subpackage demo.php
@ -27,30 +27,33 @@ defined('_JEXEC') or die('Restricted access');
abstract class DemoHelper abstract class DemoHelper
{###SITE_GLOBAL_EVENT_HELPER### ###SITE_CUSTOM_HELPER_SCRIPT### {###SITE_GLOBAL_EVENT_HELPER### ###SITE_CUSTOM_HELPER_SCRIPT###
public static function jsonToString($value) public static function jsonToString($value, $sperator = ", ", $table = null)
{ {
// check if string is JSON // check if string is JSON
$result = json_decode($value, true); $result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE) { if (json_last_error() === JSON_ERROR_NONE)
{
// is JSON // is JSON
if (self::checkArray($result)) if (self::checkArray($result))
{ {
$value = ''; if (self::checkString($table))
$counter = 0;
foreach ($result as $string)
{ {
if ($counter) $names = array();
foreach ($result as $val)
{ {
$value .= ", ".$string; if ($name = self::getVar($table, $val, 'id', 'name'))
}
else
{ {
$value .= $string; $names[] = $name;
}
$counter++;
} }
} }
return json_decode($value); if (self::checkArray($names))
{
return (string) implode($sperator,$names);
}
}
return (string) implode($sperator,$result);
}
return (string) json_decode($value);
} }
return $value; return $value;
} }

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage headercheck.php @subpackage headercheck.php

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage route.php @subpackage route.php

View File

@ -1,5 +1,8 @@
COM_CONTENT_FIELD_MODIFIED_DESC="The last date this item was modified." COM_CONTENT_FIELD_MODIFIED_DESC="The last date this item was modified."
COM_DEMO="Demo" COM_DEMO="Demo"
COM_DEMO_CREATE_NEW_S="Create New %s"
COM_DEMO_EDIT_S="Edit %s"
COM_DEMO_NEW="New"
JGLOBAL_FIELD_ID_DESC="Record number in the database." JGLOBAL_FIELD_ID_DESC="Record number in the database."
JGLOBAL_FIELD_ID_LABEL="ID" JGLOBAL_FIELD_ID_LABEL="ID"
JGLOBAL_FIELD_MODIFIED_BY_DESC="The user who did the last modification." JGLOBAL_FIELD_MODIFIED_BY_DESC="The user who did the last modification."

View File

@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------/
@version 1.0.5 @version 1.0.5
@build 2nd May, 2016 @build 2nd June, 2016
@created 5th August, 2015 @created 5th August, 2015
@package Demo @package Demo
@subpackage router.php @subpackage router.php