Bug fixes, error on compilation when using view date & version was fixed, headercheck file missing was fixed. Added swithces to controle custom import placeholders and if view version and date should be used
This commit is contained in:
@ -1196,7 +1196,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
|
||||
foreach ($values as $key => $value)
|
||||
{
|
||||
// Do special action for access.
|
||||
if ('access' == $key && strlen($value) > 0)
|
||||
if ('access' === $key && strlen($value) > 0)
|
||||
{
|
||||
$this->table->$key = $value;
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage ajax.php
|
||||
@ -1190,7 +1190,7 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
}
|
||||
}
|
||||
}
|
||||
$string[] = "<div>dynamicForm: <b>".$result->name."</b><br /><code><a href=\"index.php?option=com_[[[component]]]&task=form." . $result->name_code . implode('',$dynamicIds) ."&ref=[[[sview]]]\">" . $result->name . "</a></code></div>";
|
||||
$string[] = "<div>dynamicForm: <b>".$result->name."</b><br /><code><a href=\"index.php?option=com_[[[component]]]&task=form." . $result->name_code . implode('',$dynamicIds) ."&ref=compiler\">" . $result->name . "</a></code></div>";
|
||||
}
|
||||
$string[] = "</div><hr />";
|
||||
return implode("\n",$string);
|
||||
|
@ -10,9 +10,9 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@created 30th April, 2015
|
||||
@version @update number 11 of this MVC
|
||||
@build 2nd February, 2017
|
||||
@created 1st February, 2017
|
||||
@package Component Builder
|
||||
@subpackage compiler.php
|
||||
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
|
||||
@ -29,14 +29,120 @@ defined('_JEXEC') or die('Restricted access');
|
||||
// import the Joomla modellist library
|
||||
jimport('joomla.application.component.modellist');
|
||||
|
||||
// include component compiler
|
||||
require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/compiler.php';
|
||||
|
||||
/**
|
||||
* Componentbuilder Model
|
||||
* Componentbuilder Model for Compiler
|
||||
*/
|
||||
class ComponentbuilderModelCompiler extends JModelList
|
||||
{
|
||||
/**
|
||||
* Model user data.
|
||||
*
|
||||
* @var strings
|
||||
*/
|
||||
protected $user;
|
||||
protected $userId;
|
||||
protected $guest;
|
||||
protected $groups;
|
||||
protected $levels;
|
||||
protected $app;
|
||||
protected $input;
|
||||
protected $uikitComp;
|
||||
|
||||
/**
|
||||
* Method to build an SQL query to load the list data.
|
||||
*
|
||||
* @return string An SQL query
|
||||
*/
|
||||
protected function getListQuery()
|
||||
{
|
||||
// Get the current user for authorisation checks
|
||||
$this->user = JFactory::getUser();
|
||||
$this->userId = $this->user->get('id');
|
||||
$this->guest = $this->user->get('guest');
|
||||
$this->groups = $this->user->get('groups');
|
||||
$this->authorisedGroups = $this->user->getAuthorisedGroups();
|
||||
$this->levels = $this->user->getAuthorisedViewLevels();
|
||||
$this->app = JFactory::getApplication();
|
||||
$this->input = $this->app->input;
|
||||
$this->initSet = true;
|
||||
// Make sure all records load, since no pagination allowed.
|
||||
$this->setState('list.limit', 0);
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Get from #__componentbuilder_component as a
|
||||
$query->select($db->quoteName(
|
||||
array('a.id','a.system_name','a.name','a.name_code','a.component_version','a.debug_linenr','a.short_description','a.image','a.companyname','a.author','a.email','a.website','a.copyright','a.modified','a.created','a.version'),
|
||||
array('id','system_name','name','name_code','component_version','debug_linenr','short_description','image','companyname','author','email','website','copyright','modified','created','version')));
|
||||
$query->from($db->quoteName('#__componentbuilder_component', 'a'));
|
||||
$query->where('a.published = 1');
|
||||
$query->order('a.modified DESC');
|
||||
$query->order('a.created DESC');
|
||||
|
||||
// return the query object
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get an array of data items.
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getItems()
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
// check if this user has permission to access items
|
||||
if (!$user->authorise('compiler.access', 'com_componentbuilder'))
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
$app->enqueueMessage(JText::_('Not authorised!'), 'error');
|
||||
// redirect away if not a correct (TODO for now we go to default view)
|
||||
$app->redirect('index.php?option=com_componentbuilder');
|
||||
return false;
|
||||
}
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// Get the global params
|
||||
$globalParams = JComponentHelper::getParams('com_componentbuilder', true);
|
||||
|
||||
// Convert the parameter fields into objects.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
// Always create a slug for sef URL's
|
||||
$item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id;
|
||||
// Make sure the content prepare plugins fire on copyright.
|
||||
$item->copyright = JHtml::_('content.prepare',$item->copyright);
|
||||
// Checking if copyright has uikit components that must be loaded.
|
||||
$this->uikitComp = ComponentbuilderHelper::getUikitComp($item->copyright,$this->uikitComp);
|
||||
}
|
||||
}
|
||||
|
||||
// return items
|
||||
return $items;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the uikit needed components
|
||||
*
|
||||
* @return mixed An array of objects on success.
|
||||
*
|
||||
*/
|
||||
public function getUikitComp()
|
||||
{
|
||||
if (isset($this->uikitComp) && ComponentbuilderHelper::checkArray($this->uikitComp))
|
||||
{
|
||||
return $this->uikitComp;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected $compiler;
|
||||
|
||||
public function getComponents()
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 77 of this MVC
|
||||
@build 26th December, 2016
|
||||
@version @update number 80 of this MVC
|
||||
@build 2nd February, 2017
|
||||
@created 6th May, 2015
|
||||
@package Component Builder
|
||||
@subpackage component.php
|
||||
@ -101,18 +101,18 @@ class ComponentbuilderModelComponent extends JModelAdmin
|
||||
$item->css = base64_decode($item->css);
|
||||
}
|
||||
|
||||
if (!empty($item->php_preflight_update))
|
||||
{
|
||||
// base64 Decode php_preflight_update.
|
||||
$item->php_preflight_update = base64_decode($item->php_preflight_update);
|
||||
}
|
||||
|
||||
if (!empty($item->php_postflight_update))
|
||||
{
|
||||
// base64 Decode php_postflight_update.
|
||||
$item->php_postflight_update = base64_decode($item->php_postflight_update);
|
||||
}
|
||||
|
||||
if (!empty($item->php_preflight_update))
|
||||
{
|
||||
// base64 Decode php_preflight_update.
|
||||
$item->php_preflight_update = base64_decode($item->php_preflight_update);
|
||||
}
|
||||
|
||||
if (!empty($item->readme))
|
||||
{
|
||||
// base64 Decode readme.
|
||||
@ -1153,7 +1153,7 @@ class ComponentbuilderModelComponent extends JModelAdmin
|
||||
foreach ($values as $key => $value)
|
||||
{
|
||||
// Do special action for access.
|
||||
if ('access' == $key && strlen($value) > 0)
|
||||
if ('access' === $key && strlen($value) > 0)
|
||||
{
|
||||
$this->table->$key = $value;
|
||||
}
|
||||
@ -1223,18 +1223,18 @@ class ComponentbuilderModelComponent extends JModelAdmin
|
||||
$data['css'] = base64_encode($data['css']);
|
||||
}
|
||||
|
||||
// Set the php_preflight_update string to base64 string.
|
||||
if (isset($data['php_preflight_update']))
|
||||
{
|
||||
$data['php_preflight_update'] = base64_encode($data['php_preflight_update']);
|
||||
}
|
||||
|
||||
// Set the php_postflight_update string to base64 string.
|
||||
if (isset($data['php_postflight_update']))
|
||||
{
|
||||
$data['php_postflight_update'] = base64_encode($data['php_postflight_update']);
|
||||
}
|
||||
|
||||
// Set the php_preflight_update string to base64 string.
|
||||
if (isset($data['php_preflight_update']))
|
||||
{
|
||||
$data['php_preflight_update'] = base64_encode($data['php_preflight_update']);
|
||||
}
|
||||
|
||||
// Set the readme string to base64 string.
|
||||
if (isset($data['readme']))
|
||||
{
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage componentbuilder.php
|
||||
@ -47,6 +47,8 @@ class ComponentbuilderModelComponentbuilder extends JModelList
|
||||
);
|
||||
// view access array
|
||||
$viewAccess = array(
|
||||
'compiler.submenu' => 'compiler.submenu',
|
||||
'compiler.dashboard_list' => 'compiler.dashboard_list',
|
||||
'admin_views.access' => 'admin_view.access',
|
||||
'admin_view.access' => 'admin_view.access',
|
||||
'admin_views.submenu' => 'admin_view.submenu',
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 77 of this MVC
|
||||
@build 26th December, 2016
|
||||
@version @update number 80 of this MVC
|
||||
@build 2nd February, 2017
|
||||
@created 6th May, 2015
|
||||
@package Component Builder
|
||||
@subpackage components.php
|
||||
@ -259,17 +259,17 @@ class ComponentbuilderModelComponents extends JModelList
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
// decode css
|
||||
$item->css = base64_decode($item->css);
|
||||
// decode php_postflight_update
|
||||
$item->php_postflight_update = base64_decode($item->php_postflight_update);
|
||||
if ($basickey && !is_numeric($item->update_server_ftp) && $item->update_server_ftp === base64_encode(base64_decode($item->update_server_ftp, true)))
|
||||
{
|
||||
// decrypt update_server_ftp
|
||||
$item->update_server_ftp = $basic->decryptString($item->update_server_ftp);
|
||||
}
|
||||
// decode css
|
||||
$item->css = base64_decode($item->css);
|
||||
// decode php_preflight_update
|
||||
$item->php_preflight_update = base64_decode($item->php_preflight_update);
|
||||
// decode php_postflight_update
|
||||
$item->php_postflight_update = base64_decode($item->php_postflight_update);
|
||||
// decode readme
|
||||
$item->readme = base64_decode($item->readme);
|
||||
if ($basickey && !is_numeric($item->sales_server_ftp) && $item->sales_server_ftp === base64_encode(base64_decode($item->sales_server_ftp, true)))
|
||||
|
@ -898,7 +898,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
|
||||
foreach ($values as $key => $value)
|
||||
{
|
||||
// Do special action for access.
|
||||
if ('access' == $key && strlen($value) > 0)
|
||||
if ('access' === $key && strlen($value) > 0)
|
||||
{
|
||||
$this->table->$key = $value;
|
||||
}
|
||||
|
@ -726,7 +726,7 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
|
||||
foreach ($values as $key => $value)
|
||||
{
|
||||
// Do special action for access.
|
||||
if ('access' == $key && strlen($value) > 0)
|
||||
if ('access' === $key && strlen($value) > 0)
|
||||
{
|
||||
$this->table->$key = $value;
|
||||
}
|
||||
|
@ -796,7 +796,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
|
||||
foreach ($values as $key => $value)
|
||||
{
|
||||
// Do special action for access.
|
||||
if ('access' == $key && strlen($value) > 0)
|
||||
if ('access' === $key && strlen($value) > 0)
|
||||
{
|
||||
$this->table->$key = $value;
|
||||
}
|
||||
|
@ -946,7 +946,7 @@ class ComponentbuilderModelField extends JModelAdmin
|
||||
foreach ($values as $key => $value)
|
||||
{
|
||||
// Do special action for access.
|
||||
if ('access' == $key && strlen($value) > 0)
|
||||
if ('access' === $key && strlen($value) > 0)
|
||||
{
|
||||
$this->table->$key = $value;
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage adminviewfolderlist.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage adminviews.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage articles.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage component.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage customadminviews.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage customfilelist.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage customfolderlist.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage customgets.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage dbtables.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage dynamicgets.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fields.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fieldsmulti.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fieldtypes.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage maingets.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage siteviewfolderlist.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage siteviews.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage snippets.php
|
||||
|
@ -970,7 +970,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
|
||||
foreach ($values as $key => $value)
|
||||
{
|
||||
// Do special action for access.
|
||||
if ('access' == $key && strlen($value) > 0)
|
||||
if ('access' === $key && strlen($value) > 0)
|
||||
{
|
||||
$this->table->$key = $value;
|
||||
}
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 77 of this MVC
|
||||
@build 26th December, 2016
|
||||
@version @update number 80 of this MVC
|
||||
@build 2nd February, 2017
|
||||
@created 6th May, 2015
|
||||
@package Component Builder
|
||||
@subpackage component.js
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -760,7 +760,7 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
|
||||
foreach ($values as $key => $value)
|
||||
{
|
||||
// Do special action for access.
|
||||
if ('access' == $key && strlen($value) > 0)
|
||||
if ('access' === $key && strlen($value) > 0)
|
||||
{
|
||||
$this->table->$key = $value;
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.2.9
|
||||
@build 1st February, 2017
|
||||
@build 2nd February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage import.php
|
||||
|
@ -766,7 +766,7 @@ class ComponentbuilderModelLayout extends JModelAdmin
|
||||
foreach ($values as $key => $value)
|
||||
{
|
||||
// Do special action for access.
|
||||
if ('access' == $key && strlen($value) > 0)
|
||||
if ('access' === $key && strlen($value) > 0)
|
||||
{
|
||||
$this->table->$key = $value;
|
||||
}
|
||||
|
@ -904,7 +904,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin
|
||||
foreach ($values as $key => $value)
|
||||
{
|
||||
// Do special action for access.
|
||||
if ('access' == $key && strlen($value) > 0)
|
||||
if ('access' === $key && strlen($value) > 0)
|
||||
{
|
||||
$this->table->$key = $value;
|
||||
}
|
||||
|
@ -724,7 +724,7 @@ class ComponentbuilderModelSnippet extends JModelAdmin
|
||||
foreach ($values as $key => $value)
|
||||
{
|
||||
// Do special action for access.
|
||||
if ('access' == $key && strlen($value) > 0)
|
||||
if ('access' === $key && strlen($value) > 0)
|
||||
{
|
||||
$this->table->$key = $value;
|
||||
}
|
||||
|
@ -766,7 +766,7 @@ class ComponentbuilderModelTemplate extends JModelAdmin
|
||||
foreach ($values as $key => $value)
|
||||
{
|
||||
// Do special action for access.
|
||||
if ('access' == $key && strlen($value) > 0)
|
||||
if ('access' === $key && strlen($value) > 0)
|
||||
{
|
||||
$this->table->$key = $value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user