Added the Feature to Combine/Join Values/Fields in the admin list view (called field relations) #293

Merged
Llewellyn merged 7 commits from staging into master 2018-05-30 11:46:36 +00:00
61 changed files with 4858 additions and 1057 deletions
Showing only changes of commit 2543d11277 - Show all commits

View File

@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.7.10) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.7.11) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -125,14 +125,14 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 18th May, 2018
+ *Version*: 2.7.10
+ *Last Build*: 22nd May, 2018
+ *Version*: 2.7.11
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **181594**
+ *Field count*: **1036**
+ *File count*: **1203**
+ *Folder count*: **193**
+ *Line count*: **185406**
+ *Field count*: **1052**
+ *File count*: **1236**
+ *Folder count*: **197**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.7.10) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.7.11) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -125,14 +125,14 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 18th May, 2018
+ *Version*: 2.7.10
+ *Last Build*: 22nd May, 2018
+ *Version*: 2.7.11
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **181594**
+ *Field count*: **1036**
+ *File count*: **1203**
+ *Folder count*: **193**
+ *Line count*: **185406**
+ *Field count*: **1052**
+ *File count*: **1236**
+ *Folder count*: **197**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -50,6 +50,16 @@
<action name="admin_fields.edit.own" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_OWN" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_OWN_DESC" />
<action name="admin_fields.edit.state" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_STATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_STATE_DESC" />
<action name="admin_fields.version" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_VERSION" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_VERSION_DESC" />
<action name="admin_fields_relations.access" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS_DESC" />
<action name="admin_fields_relations.batch" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE_DESC" />
<action name="admin_fields_relations.create" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE_DESC" />
<action name="admin_fields_relations.delete" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE_DESC" />
<action name="admin_fields_relations.edit" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_DESC" />
<action name="admin_fields_relations.edit.created_by" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY_DESC" />
<action name="admin_fields_relations.edit.created" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE_DESC" />
<action name="admin_fields_relations.edit.own" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN_DESC" />
<action name="admin_fields_relations.edit.state" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE_DESC" />
<action name="admin_fields_relations.version" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION_DESC" />
<action name="compiler.access" title="COM_COMPONENTBUILDER_COMPILER_ACCESS" description="COM_COMPONENTBUILDER_COMPILER_ACCESS_DESC" />
<action name="compiler.clear_tmp" title="COM_COMPONENTBUILDER_COMPILER_CLEAR_TMP_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_COMPILER_CLEAR_TMP_BUTTON_ACCESS_DESC" />
<action name="compiler.dashboard_list" title="COM_COMPONENTBUILDER_COMPILER_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_COMPILER_DASHBOARD_LIST_DESC" />
@ -561,6 +571,17 @@
<action name="admin_fields_conditions.access" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS_ACCESS" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS_ACCESS_DESC" />
<action name="admin_fields_conditions.version" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS_EDIT_VERSION" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS_EDIT_VERSION_DESC" />
</section>
<section name="admin_fields_relations">
<action name="admin_fields_relations.edit" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_DESC" />
<action name="admin_fields_relations.edit.own" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN_DESC" />
<action name="admin_fields_relations.edit.state" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE_DESC" />
<action name="admin_fields_relations.edit.created_by" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY_DESC" />
<action name="admin_fields_relations.edit.created" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE_DESC" />
<action name="admin_fields_relations.create" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE_DESC" />
<action name="admin_fields_relations.delete" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE_DESC" />
<action name="admin_fields_relations.access" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS_DESC" />
<action name="admin_fields_relations.version" title="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION" description="COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION_DESC" />
</section>
<section name="component_admin_views">
<action name="component_admin_views.edit" title="COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT" description="COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_DESC" />
<action name="component_admin_views.edit.own" title="COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_OWN" description="COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_OWN_DESC" />

View File

@ -0,0 +1,13 @@
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/* CSS Document */

View File

@ -0,0 +1,13 @@
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/* CSS Document */

View File

@ -112,6 +112,7 @@ class ComponentbuilderController extends JControllerLegacy
'help_document' => 'help_documents',
'admin_fields' => 'admins_fields',
'admin_fields_conditions' => 'admins_fields_conditions',
'admin_fields_relations' => 'admins_fields_relations',
'component_admin_views' => 'components_admin_views',
'component_site_views' => 'components_site_views',
'component_custom_admin_views' => 'components_custom_admin_views',

View File

@ -0,0 +1,312 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
/**
* Admin_fields_relations Controller
*/
class ComponentbuilderControllerAdmin_fields_relations extends JControllerForm
{
/**
* Current or most recently performed task.
*
* @var string
* @since 12.2
* @note Replaces _task.
*/
protected $task;
public function __construct($config = array())
{
$this->view_list = 'Admins_fields_relations'; // safeguard for setting the return view listing to the main view.
parent::__construct($config);
}
/**
* Method override to check if you can add a new record.
*
* @param array $data An array of input data.
*
* @return boolean
*
* @since 1.6
*/
protected function allowAdd($data = array())
{
// Access check.
$access = JFactory::getUser()->authorise('admin_fields_relations.access', 'com_componentbuilder');
if (!$access)
{
return false;
}
// In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('admin_fields_relations.create', $this->option);
}
/**
* Method override to check if you can edit an existing record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 1.6
*/
protected function allowEdit($data = array(), $key = 'id')
{
// get user object.
$user = JFactory::getUser();
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// Access check.
$access = ($user->authorise('admin_fields_relations.access', 'com_componentbuilder.admin_fields_relations.' . (int) $recordId) && $user->authorise('admin_fields_relations.access', 'com_componentbuilder'));
if (!$access)
{
return false;
}
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('admin_fields_relations.edit', 'com_componentbuilder.admin_fields_relations.' . (int) $recordId);
if (!$permission)
{
if ($user->authorise('admin_fields_relations.edit.own', 'com_componentbuilder.admin_fields_relations.' . $recordId))
{
// Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId))
{
// Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
{
return false;
}
$ownerId = $record->created_by;
}
// If the owner matches 'me' then allow.
if ($ownerId == $user->id)
{
if ($user->authorise('admin_fields_relations.edit.own', 'com_componentbuilder'))
{
return true;
}
}
}
return false;
}
}
// Since there is no permission, revert to the component permissions.
return $user->authorise('admin_fields_relations.edit', $this->option);
}
/**
* Gets the URL arguments to append to an item redirect.
*
* @param integer $recordId The primary key id for the item.
* @param string $urlVar The name of the URL variable for the id.
*
* @return string The arguments to append to the redirect URL.
*
* @since 12.2
*/
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
{
$tmpl = $this->input->get('tmpl');
$layout = $this->input->get('layout', 'edit', 'string');
$ref = $this->input->get('ref', 0, 'string');
$refid = $this->input->get('refid', 0, 'int');
// Setup redirect info.
$append = '';
if ($refid)
{
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
}
elseif ($ref)
{
$append .= '&ref='.(string)$ref;
}
if ($tmpl)
{
$append .= '&tmpl=' . $tmpl;
}
if ($layout)
{
$append .= '&layout=' . $layout;
}
if ($recordId)
{
$append .= '&' . $urlVar . '=' . $recordId;
}
return $append;
}
/**
* Method to run batch operations.
*
* @param object $model The model.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 2.5
*/
public function batch($model = null)
{
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Admin_fields_relations', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admins_fields_relations' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
/**
* Method to cancel an edit.
*
* @param string $key The name of the primary key of the URL variable.
*
* @return boolean True if access level checks pass, false otherwise.
*
* @since 12.2
*/
public function cancel($key = null)
{
// get the referal details
$this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int');
$cancel = parent::cancel($key);
if ($cancel)
{
if ($this->refid)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref)
{
$redirect = '&view='.(string)$this->ref;
// Redirect to the list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
}
else
{
// Redirect to the items screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . '&view=' . $this->view_list, false
)
);
}
return $cancel;
}
/**
* Method to save a record.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
*
* @return boolean True if successful, false otherwise.
*
* @since 12.2
*/
public function save($key = null, $urlVar = null)
{
// get the referal details
$this->ref = $this->input->get('ref', 0, 'word');
$this->refid = $this->input->get('refid', 0, 'int');
if ($this->ref || $this->refid)
{
// to make sure the item is checkedin on redirect
$this->task = 'save';
}
$saved = parent::save($key, $urlVar);
if ($this->refid && $saved)
{
$redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid;
// Redirect to the item screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref && $saved)
{
$redirect = '&view='.(string)$this->ref;
// Redirect to the list screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
return $saved;
}
/**
* Function that allows child controller access to model data
* after the data has been saved.
*
* @param JModel &$model The data model object.
* @param array $validData The validated data.
*
* @return void
*
* @since 11.1
*/
protected function postSaveHook(JModelLegacy $model, $validData = array())
{
return;
}
}

View File

@ -318,7 +318,8 @@ class ComponentbuilderControllerAdmin_view extends JControllerForm
// linked tables to update
$_tablesArray = array(
'admin_fields',
'admin_fields_conditions'
'admin_fields_conditions',
'admin_fields_relations'
);
foreach($_tablesArray as $_updateTable)
{

View File

@ -0,0 +1,34 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
/**
* Admins_fields_relations Controller
*/
class ComponentbuilderControllerAdmins_fields_relations extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS';
/**
* Proxy for getModel.
* @since 2.5
*/
public function getModel($name = 'Admin_fields_relations', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}

View File

@ -72,7 +72,7 @@ class Compiler extends Infusion
// first remove the files and folders
$this->removeFolder($this->componentPath . '/site');
// clear form component xml
$xmlPath = $this->componentPath . '/' . $this->fileContentStatic['###component###'] . '.xml';
$xmlPath = $this->componentPath . '/' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '.xml';
$componentXML = ComponentbuilderHelper::getFileContents($xmlPath);
$textToSite = ComponentbuilderHelper::getBetween($componentXML, '<files folder="site">', '</files>');
$textToSiteLang = ComponentbuilderHelper::getBetween($componentXML, '<languages folder="site">', '</languages>');
@ -215,16 +215,16 @@ class Compiler extends Infusion
{
if (JFile::exists($static['path']))
{
$this->fileContentStatic['###FILENAME###'] = $static['name'];
$this->fileContentStatic[$this->hhh . 'FILENAME' . $this->hhh] = $static['name'];
$php = '';
if (ComponentbuilderHelper::checkFileType($static['name'], 'php'))
{
$php = "<?php\n";
}
$string = ComponentbuilderHelper::getFileContents($static['path']);
if (strpos($string, '###BOM###') !== false)
if (strpos($string, $this->hhh . 'BOM' . $this->hhh) !== false)
{
list($wast, $code) = explode('###BOM###', $string);
list($wast, $code) = explode($this->hhh . 'BOM' . $this->hhh, $string);
$string = $php . $bom . $code;
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
// add to zip array
@ -250,7 +250,7 @@ class Compiler extends Infusion
{
if (JFile::exists($file['path']))
{
$this->fileContentStatic['###FILENAME###'] = $file['name'];
$this->fileContentStatic[$this->hhh . 'FILENAME' . $this->hhh] = $file['name'];
// do some weird stuff to improve the verion and dates being added to the license
$this->fixLicenseValues($file);
$php = '';
@ -259,9 +259,9 @@ class Compiler extends Infusion
$php = "<?php\n";
}
$string = ComponentbuilderHelper::getFileContents($file['path']);
if (strpos($string, '###BOM###') !== false)
if (strpos($string, $this->hhh . 'BOM' . $this->hhh) !== false)
{
list($bin, $code) = explode('###BOM###', $string);
list($bin, $code) = explode($this->hhh . 'BOM' . $this->hhh, $string);
$string = $php . $bom . $code;
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
$answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3);
@ -321,7 +321,7 @@ class Compiler extends Infusion
{
foreach ($data['config'] as $key => $value)
{
if ('###VERSION###' === $key)
if ($this->hhh . 'VERSION' . $this->hhh === $key)
{
// hmm we sould in some way make it known that this version number
// is not in relation the the project but to the file only... any ideas?
@ -340,9 +340,9 @@ class Compiler extends Infusion
return true;
}
// else insure to reset to global
$this->fileContentStatic['###CREATIONDATE###'] = $this->fileContentStatic['###CREATIONDATE###GLOBAL'];
$this->fileContentStatic['###BUILDDATE###'] = $this->fileContentStatic['###BUILDDATE###GLOBAL'];
$this->fileContentStatic['###VERSION###'] = $this->fileContentStatic['###VERSION###GLOBAL'];
$this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh . 'GLOBAL'];
$this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh . 'GLOBAL'];
$this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh . 'GLOBAL'];
}
// set all global numbers
@ -399,7 +399,7 @@ class Compiler extends Infusion
private function setReadMe($path)
{
// set readme data if not set already
if (!isset($this->fileContentStatic['###LINE_COUNT###']) || $this->fileContentStatic['###LINE_COUNT###'] != $this->lineCount)
if (!isset($this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh]) || $this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh] != $this->lineCount)
{
$this->buildReadMeData();
}
@ -414,39 +414,39 @@ class Compiler extends Infusion
private function buildReadMeData()
{
// set some defaults
$this->fileContentStatic['###LINE_COUNT###'] = $this->lineCount;
$this->fileContentStatic['###FIELD_COUNT###'] = $this->fieldCount;
$this->fileContentStatic['###FILE_COUNT###'] = $this->fileCount;
$this->fileContentStatic['###FOLDER_COUNT###'] = $this->folderCount;
$this->fileContentStatic['###PAGE_COUNT###'] = $this->pageCount;
$this->fileContentStatic['###folders###'] = $this->folderSeconds;
$this->fileContentStatic['###foldersSeconds###'] = $this->folderSeconds;
$this->fileContentStatic['###files###'] = $this->fileSeconds;
$this->fileContentStatic['###filesSeconds###'] = $this->fileSeconds;
$this->fileContentStatic['###lines###'] = $this->lineSeconds;
$this->fileContentStatic['###linesSeconds###'] = $this->lineSeconds;
$this->fileContentStatic['###seconds###'] = $this->actualSeconds;
$this->fileContentStatic['###actualSeconds###'] = $this->actualSeconds;
$this->fileContentStatic['###totalHours###'] = $this->totalHours;
$this->fileContentStatic['###totalDays###'] = $this->totalDays;
$this->fileContentStatic['###debugging###'] = $this->secondsDebugging;
$this->fileContentStatic['###secondsDebugging###'] = $this->secondsDebugging;
$this->fileContentStatic['###planning###'] = $this->secondsPlanning;
$this->fileContentStatic['###secondsPlanning###'] = $this->secondsPlanning;
$this->fileContentStatic['###mapping###'] = $this->secondsMapping;
$this->fileContentStatic['###secondsMapping###'] = $this->secondsMapping;
$this->fileContentStatic['###office###'] = $this->secondsOffice;
$this->fileContentStatic['###secondsOffice###'] = $this->secondsOffice;
$this->fileContentStatic['###actualTotalHours###'] = $this->actualTotalHours;
$this->fileContentStatic['###actualTotalDays###'] = $this->actualTotalDays;
$this->fileContentStatic['###debuggingHours###'] = $this->debuggingHours;
$this->fileContentStatic['###planningHours###'] = $this->planningHours;
$this->fileContentStatic['###mappingHours###'] = $this->mappingHours;
$this->fileContentStatic['###officeHours###'] = $this->officeHours;
$this->fileContentStatic['###actualHoursSpent###'] = $this->actualHoursSpent;
$this->fileContentStatic['###actualDaysSpent###'] = $this->actualDaysSpent;
$this->fileContentStatic['###projectWeekTime###'] = $this->projectWeekTime;
$this->fileContentStatic['###projectMonthTime###'] = $this->projectMonthTime;
$this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh] = $this->lineCount;
$this->fileContentStatic[$this->hhh . 'FIELD_COUNT' . $this->hhh] = $this->fieldCount;
$this->fileContentStatic[$this->hhh . 'FILE_COUNT' . $this->hhh] = $this->fileCount;
$this->fileContentStatic[$this->hhh . 'FOLDER_COUNT' . $this->hhh] = $this->folderCount;
$this->fileContentStatic[$this->hhh . 'PAGE_COUNT' . $this->hhh] = $this->pageCount;
$this->fileContentStatic[$this->hhh . 'folders' . $this->hhh] = $this->folderSeconds;
$this->fileContentStatic[$this->hhh . 'foldersSeconds' . $this->hhh] = $this->folderSeconds;
$this->fileContentStatic[$this->hhh . 'files' . $this->hhh] = $this->fileSeconds;
$this->fileContentStatic[$this->hhh . 'filesSeconds' . $this->hhh] = $this->fileSeconds;
$this->fileContentStatic[$this->hhh . 'lines' . $this->hhh] = $this->lineSeconds;
$this->fileContentStatic[$this->hhh . 'linesSeconds' . $this->hhh] = $this->lineSeconds;
$this->fileContentStatic[$this->hhh . 'seconds' . $this->hhh] = $this->actualSeconds;
$this->fileContentStatic[$this->hhh . 'actualSeconds' . $this->hhh] = $this->actualSeconds;
$this->fileContentStatic[$this->hhh . 'totalHours' . $this->hhh] = $this->totalHours;
$this->fileContentStatic[$this->hhh . 'totalDays' . $this->hhh] = $this->totalDays;
$this->fileContentStatic[$this->hhh . 'debugging' . $this->hhh] = $this->secondsDebugging;
$this->fileContentStatic[$this->hhh . 'secondsDebugging' . $this->hhh] = $this->secondsDebugging;
$this->fileContentStatic[$this->hhh . 'planning' . $this->hhh] = $this->secondsPlanning;
$this->fileContentStatic[$this->hhh . 'secondsPlanning' . $this->hhh] = $this->secondsPlanning;
$this->fileContentStatic[$this->hhh . 'mapping' . $this->hhh] = $this->secondsMapping;
$this->fileContentStatic[$this->hhh . 'secondsMapping' . $this->hhh] = $this->secondsMapping;
$this->fileContentStatic[$this->hhh . 'office' . $this->hhh] = $this->secondsOffice;
$this->fileContentStatic[$this->hhh . 'secondsOffice' . $this->hhh] = $this->secondsOffice;
$this->fileContentStatic[$this->hhh . 'actualTotalHours' . $this->hhh] = $this->actualTotalHours;
$this->fileContentStatic[$this->hhh . 'actualTotalDays' . $this->hhh] = $this->actualTotalDays;
$this->fileContentStatic[$this->hhh . 'debuggingHours' . $this->hhh] = $this->debuggingHours;
$this->fileContentStatic[$this->hhh . 'planningHours' . $this->hhh] = $this->planningHours;
$this->fileContentStatic[$this->hhh . 'mappingHours' . $this->hhh] = $this->mappingHours;
$this->fileContentStatic[$this->hhh . 'officeHours' . $this->hhh] = $this->officeHours;
$this->fileContentStatic[$this->hhh . 'actualHoursSpent' . $this->hhh] = $this->actualHoursSpent;
$this->fileContentStatic[$this->hhh . 'actualDaysSpent' . $this->hhh] = $this->actualDaysSpent;
$this->fileContentStatic[$this->hhh . 'projectWeekTime' . $this->hhh] = $this->projectWeekTime;
$this->fileContentStatic[$this->hhh . 'projectMonthTime' . $this->hhh] = $this->projectMonthTime;
}
private function zipComponent()

View File

@ -18,6 +18,27 @@ defined('_JEXEC') or die('Restricted access');
class Get
{
/**
* The hash placeholder
*
* @var string
*/
public $hhh = '#' . '#' . '#';
/**
* The open bracket placeholder
*
* @var string
*/
public $bbb = '[' . '[' . '[';
/**
* The close bracket placeholder
*
* @var string
*/
public $ddd = ']' . ']' . ']';
/**
* The app
*
@ -834,12 +855,12 @@ class Get
$component = ComponentbuilderHelper::convertRepeatableFields($component, $searchRepeatables, $updater);
// set component place holders
$this->placeholders['###component###'] = ComponentbuilderHelper::safeString($component->name_code);
$this->placeholders['###Component###'] = ComponentbuilderHelper::safeString($component->name_code, 'F');
$this->placeholders['###COMPONENT###'] = ComponentbuilderHelper::safeString($component->name_code, 'U');
$this->placeholders['[[[component]]]'] = $this->placeholders['###component###'];
$this->placeholders['[[[Component]]]'] = $this->placeholders['###Component###'];
$this->placeholders['[[[COMPONENT]]]'] = $this->placeholders['###COMPONENT###'];
$this->placeholders[$this->hhh . 'component' . $this->hhh] = ComponentbuilderHelper::safeString($component->name_code);
$this->placeholders[$this->hhh . 'Component' . $this->hhh] = ComponentbuilderHelper::safeString($component->name_code, 'F');
$this->placeholders[$this->hhh . 'COMPONENT' . $this->hhh] = ComponentbuilderHelper::safeString($component->name_code, 'U');
$this->placeholders[$this->bbb . 'component' . $this->ddd] = $this->placeholders[$this->hhh . 'component' . $this->hhh];
$this->placeholders[$this->bbb . 'Component' . $this->ddd] = $this->placeholders[$this->hhh . 'Component' . $this->hhh];
$this->placeholders[$this->bbb . 'COMPONENT' . $this->ddd] = $this->placeholders[$this->hhh . 'COMPONENT' . $this->hhh];
// set component sales name
$component->sales_name = ComponentbuilderHelper::safeString($component->system_name);
@ -1376,18 +1397,18 @@ class Get
$this->customScriptBuilder['token'][$name_single] = false;
$this->customScriptBuilder['token'][$name_list] = false;
// set some placeholders
$this->placeholders['###view###'] = ComponentbuilderHelper::safeString($name_single);
$this->placeholders['###views###'] = ComponentbuilderHelper::safeString($name_list);
$this->placeholders['###View###'] = ComponentbuilderHelper::safeString($name_single, 'F');
$this->placeholders['###Views###'] = ComponentbuilderHelper::safeString($name_list, 'F');
$this->placeholders['###VIEW###'] = ComponentbuilderHelper::safeString($name_single, 'U');
$this->placeholders['###VIEWS###'] = ComponentbuilderHelper::safeString($name_list, 'U');
$this->placeholders['[[[view]]]'] = $this->placeholders['###view###'];
$this->placeholders['[[[views]]]'] = $this->placeholders['###views###'];
$this->placeholders['[[[View]]]'] = $this->placeholders['###View###'];
$this->placeholders['[[[Views]]]'] = $this->placeholders['###Views###'];
$this->placeholders['[[[VIEW]]]'] = $this->placeholders['###VIEW###'];
$this->placeholders['[[[VIEWS]]]'] = $this->placeholders['###VIEWS###'];
$this->placeholders[$this->hhh . 'view' . $this->hhh] = ComponentbuilderHelper::safeString($name_single);
$this->placeholders[$this->hhh . 'views' . $this->hhh] = ComponentbuilderHelper::safeString($name_list);
$this->placeholders[$this->hhh . 'View' . $this->hhh] = ComponentbuilderHelper::safeString($name_single, 'F');
$this->placeholders[$this->hhh . 'Views' . $this->hhh] = ComponentbuilderHelper::safeString($name_list, 'F');
$this->placeholders[$this->hhh . 'VIEW' . $this->hhh] = ComponentbuilderHelper::safeString($name_single, 'U');
$this->placeholders[$this->hhh . 'VIEWS' . $this->hhh] = ComponentbuilderHelper::safeString($name_list, 'U');
$this->placeholders[$this->bbb . 'view' . $this->ddd] = $this->placeholders[$this->hhh . 'view' . $this->hhh];
$this->placeholders[$this->bbb . 'views' . $this->ddd] = $this->placeholders[$this->hhh . 'views' . $this->hhh];
$this->placeholders[$this->bbb . 'View' . $this->ddd] = $this->placeholders[$this->hhh . 'View' . $this->hhh];
$this->placeholders[$this->bbb . 'Views' . $this->ddd] = $this->placeholders[$this->hhh . 'Views' . $this->hhh];
$this->placeholders[$this->bbb . 'VIEW' . $this->ddd] = $this->placeholders[$this->hhh . 'VIEW' . $this->hhh];
$this->placeholders[$this->bbb . 'VIEWS' . $this->ddd] = $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh];
// add the tables
$view->addtables = (isset($view->addtables) && ComponentbuilderHelper::checkJson($view->addtables)) ? json_decode($view->addtables, true) : null;
if (ComponentbuilderHelper::checkArray($view->addtables))
@ -1819,18 +1840,18 @@ class Get
}
}
// clear placeholders
unset($this->placeholders['###view###']);
unset($this->placeholders['###views###']);
unset($this->placeholders['###View###']);
unset($this->placeholders['###Views###']);
unset($this->placeholders['###VIEW###']);
unset($this->placeholders['###VIEWS###']);
unset($this->placeholders['[[[view]]]']);
unset($this->placeholders['[[[views]]]']);
unset($this->placeholders['[[[View]]]']);
unset($this->placeholders['[[[Views]]]']);
unset($this->placeholders['[[[VIEW]]]']);
unset($this->placeholders['[[[VIEWS]]]']);
unset($this->placeholders[$this->hhh . 'view' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'views' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'View' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'Views' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'VIEW' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]);
unset($this->placeholders[$this->bbb . 'view' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'views' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'View' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'Views' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'VIEW' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'VIEWS' . $this->ddd]);
// store this view to class object
$this->_adminViewData[$id] = $view;
@ -3605,7 +3626,7 @@ class Get
if (ComponentbuilderHelper::checkArray($langStringTargets))
{
// insure string is not broken
$content = str_replace('COM_###COMPONENT###', $this->langPrefix, $content);
$content = str_replace('COM_' . $this->hhh . 'COMPONENT' . $this->hhh, $this->langPrefix, $content);
// reset some buckets
$langHolders = array();
$langCheck = array();
@ -3938,9 +3959,9 @@ class Get
$data = $this->db->loadObjectList();
// start building the MySql dump
$dump = "--";
$dump .= PHP_EOL . "-- Dumping data for table `#__[[[component]]]_" . $view . "`";
$dump .= PHP_EOL . "-- Dumping data for table `#__".$this->bbb."component".$this->ddd."_" . $view . "`";
$dump .= PHP_EOL . "--";
$dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__[[[component]]]_" . $view . "` (";
$dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__".$this->bbb."component".$this->ddd."_" . $view . "` (";
foreach ($data as $line)
{
$comaSet = 0;
@ -4442,7 +4463,7 @@ class Get
}
// check what type of place holders we should load here
$placeholderType = (int) $item['comment_type'] . '2';
if (stripos($item['code'], '[[[view') !== false || stripos($item['code'], '[[[sview') !== false || stripos($item['code'], '[[[arg') !== false)
if (stripos($item['code'], $this->bbb . 'view') !== false || stripos($item['code'], $this->bbb . 'sview') !== false || stripos($item['code'], $this->bbb . 'arg') !== false)
{
// if view is being set dynamicly then we can't update this code via IDE (TODO)
$placeholderType = 3;
@ -4472,7 +4493,7 @@ class Get
$number = 0;
foreach ($values as $value)
{
$this->placeholders['[[[' . $key . $number . ']]]'] = $value;
$this->placeholders[$this->bbb . $key . $number . $this->ddd] = $value;
$number++;
}
}
@ -5043,9 +5064,9 @@ class Get
$fileTypes = array('\.php', '\.js');
// set some local placeholders
$placeholders = array();
$placeholders[ComponentbuilderHelper::safeString($this->componentCodeName, 'F') . 'Helper::'] = '[[[Component]]]Helper::';
$placeholders['COM_' . ComponentbuilderHelper::safeString($this->componentCodeName, 'U')] = 'COM_[[[COMPONENT]]]';
$placeholders['com_' . $this->componentCodeName] = 'com_[[[component]]]';
$placeholders[ComponentbuilderHelper::safeString($this->componentCodeName, 'F') . 'Helper::'] = $this->bbb . 'Component' . $this->ddd . 'Helper::';
$placeholders['COM_' . ComponentbuilderHelper::safeString($this->componentCodeName, 'U')] = 'COM_' . $this->bbb . 'COMPONENT' . $this->ddd;
$placeholders['com_' . $this->componentCodeName] = 'com_' . $this->bbb . 'component' . $this->ddd;
foreach ($paths as $target => $path)
{
// we are changing the working directory to the componet path
@ -5760,7 +5781,7 @@ class Get
return round($val1 + $val2);
break;
// Subtract one number from the other
case 'add':
case 'sub':
return round($val1 - $val2);
break;
}

View File

@ -490,11 +490,11 @@ class Structure extends Get
if ($addLocalFolder)
{
// check if we sould add it to the media xml list
if (!isset($this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###']))
if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh]))
{
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] = '';
$this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] = '';
}
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] .= PHP_EOL . "\t\t<folder>" . $libFolder . "</folder>";
$this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] .= PHP_EOL . "\t\t<folder>" . $libFolder . "</folder>";
}
}
// if config fields are found load into component config (avoiding dublicates)
@ -755,9 +755,10 @@ class Structure extends Get
// do license check
$LICENSE = false;
$licenseChecker = strtolower($this->componentData->license);
if (strpos($licenseChecker, 'gnu') !== false && strpos($licenseChecker, 'gpl') !== false)
if (strpos($licenseChecker, 'gnu') !== false && strpos($licenseChecker, '2') !== false &&
(strpos($licenseChecker, 'gpl') !== false || strpos($licenseChecker, 'general public license') !== false))
{
$LICENSE = true;
$LICENSE = true; // we only add version 2 auto at this time (TODO)
}
// do README check
$README = false;
@ -890,20 +891,20 @@ class Structure extends Get
if ($view['settings']->name_list != 'null')
{
$target = array('admin' => $view['settings']->name_list);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'list', false, $config);
}
if ($view['settings']->name_single != 'null')
{
$target = array('admin' => $view['settings']->name_single);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'single', false, $config);
}
if (isset($view['edit_create_site_view']) && $view['edit_create_site_view'])
{
// setup the front site edit-view files
$target = array('site' => $view['settings']->name_single);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'edit', false, $config);
}
}
@ -927,14 +928,14 @@ class Structure extends Get
{
// set list view
$target = array('site' => $view['settings']->code);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'list', false, $config);
}
elseif ($view['settings']->main_get->gettype == 1)
{
// set single view
$target = array('site' => $view['settings']->code);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'single', false, $config);
}
}
@ -950,14 +951,14 @@ class Structure extends Get
{
// set list view$view
$target = array('custom_admin' => $view['settings']->code);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'list', false, $config);
}
elseif ($view['settings']->main_get->gettype == 1)
{
// set single view
$target = array('custom_admin' => $view['settings']->code);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'single', false, $config);
}
}
@ -1278,31 +1279,31 @@ class Structure extends Get
$newname = '';
}
// check if we sould add it to the media xml list
if (!isset($this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###']))
if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh]))
{
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] = '';
$this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] = '';
}
if (count($pathArray) == 1 && $firstFolder === 'media')
{
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] .= PHP_EOL . "\t\t<folder>" . $lastFolder . "</folder>";
$this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] .= PHP_EOL . "\t\t<folder>" . $lastFolder . "</folder>";
}
// check if we sould add it to the site xml list
if (!isset($this->fileContentStatic['###EXSTRA_SITE_FOLDERS###']))
if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS' . $this->hhh]))
{
$this->fileContentStatic['###EXSTRA_SITE_FOLDERS###'] = '';
$this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS' . $this->hhh] = '';
}
if (count($pathArray) == 1 && $firstFolder === 'site')
{
$this->fileContentStatic['###EXSTRA_SITE_FOLDERS###'] .= PHP_EOL . "\t\t<folder>" . $lastFolder . "</folder>";
$this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS' . $this->hhh] .= PHP_EOL . "\t\t<folder>" . $lastFolder . "</folder>";
}
// check if we sould add it to the admin xml list
if (!isset($this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###']))
if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS' . $this->hhh]))
{
$this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###'] = '';
$this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS' . $this->hhh] = '';
}
if (count($pathArray) == 1 && $firstFolder === 'admin')
{
$this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###'] .= PHP_EOL . "\t\t\t<folder>" . $lastFolder . "</folder>";
$this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS' . $this->hhh] .= PHP_EOL . "\t\t\t<folder>" . $lastFolder . "</folder>";
}
// make we have not duplicates
$key_pointer = ComponentbuilderHelper::safeString($custom['folder']) . '_f' . $pointer_tracker;

View File

@ -384,8 +384,8 @@ class Fields extends Structure
$this->accessBuilder[$view_name_single] = $view_name_single;
}
// main lang prefix
$langView = $this->langPrefix . '_' . $this->placeholders['###VIEW###'];
$langViews = $this->langPrefix . '_' . $this->placeholders['###VIEWS###'];
$langView = $this->langPrefix . '_' . $this->placeholders[$this->hhh . 'VIEW' . $this->hhh];
$langViews = $this->langPrefix . '_' . $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh];
// set default lang
$this->langContent[$this->lang][$langView] = $view['settings']->name_single;
$this->langContent[$this->lang][$langViews] = $view['settings']->name_list;
@ -2696,17 +2696,17 @@ class Fields extends Structure
);
// make field dynamic
$replace = array(
'###TABLE###' => $data['custom']['table'],
'###ID###' => $data['custom']['id'],
'###TEXT###' => $data['custom']['text'],
'###CODE_TEXT###' => $data['code'] . '_' . $data['custom']['text'],
'###CODE###' => $data['code'],
'###component###' => $this->fileContentStatic['###component###'],
'###Component###' => $this->fileContentStatic['###Component###'],
'###view_type###' => $view_name_single . '_' . $data['type'],
'###type###' => $data['type'],
'###view###' => $view_name_single,
'###views###' => $view_name_list
$this->hhh . 'TABLE' . $this->hhh => $data['custom']['table'],
$this->hhh . 'ID' . $this->hhh => $data['custom']['id'],
$this->hhh . 'TEXT' . $this->hhh => $data['custom']['text'],
$this->hhh . 'CODE_TEXT' . $this->hhh => $data['code'] . '_' . $data['custom']['text'],
$this->hhh . 'CODE' . $this->hhh => $data['code'],
$this->hhh . 'component' . $this->hhh => $this->fileContentStatic[$this->hhh . 'component' . $this->hhh],
$this->hhh . 'Component' . $this->hhh => $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh],
$this->hhh . 'view_type' . $this->hhh => $view_name_single . '_' . $data['type'],
$this->hhh . 'type' . $this->hhh => $data['type'],
$this->hhh . 'view' . $this->hhh => $view_name_single,
$this->hhh . 'views' . $this->hhh => $view_name_list
);
// now load the php script
if (isset($data['custom']['php']) && ComponentbuilderHelper::checkArray($data['custom']['php']))
@ -2780,23 +2780,23 @@ class Fields extends Structure
$this->langContent[$this->lang][$groupLangName] = ComponentbuilderHelper::safeString($tempName, 'W');
// build the Group Control
$this->setGroupControl[$data['type']] = $groupLangName;
// ###JFORM_GETGROUPS_PHP### <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']]['###JFORM_GETGROUPS_PHP###'] = $phpCode;
// JFORM_GETGROUPS_PHP <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']][$this->hhh . 'JFORM_GETGROUPS_PHP' . $this->hhh] = $phpCode;
// ###JFORM_GETEXCLUDED_PHP### <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']]['###JFORM_GETEXCLUDED_PHP###'] = $phpxCode;
// JFORM_GETEXCLUDED_PHP <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']][$this->hhh . 'JFORM_GETEXCLUDED_PHP' . $this->hhh] = $phpxCode;
}
else
{
// ###JFORM_GETOPTIONS_PHP### <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']]['###JFORM_GETOPTIONS_PHP###'] = $phpCode;
// JFORM_GETOPTIONS_PHP <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']][$this->hhh . 'JFORM_GETOPTIONS_PHP' . $this->hhh] = $phpCode;
}
// ###Type### <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']]['###Type###'] = ComponentbuilderHelper::safeString($data['custom']['type'], 'F');
// ###type### <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']]['###type###'] = $data['custom']['type'];
// ###type### <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']]['###ADD_BUTTON###'] = $this->setAddButtonToListField($data['custom']);
// Type <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']][$this->hhh . 'Type' . $this->hhh] = ComponentbuilderHelper::safeString($data['custom']['type'], 'F');
// type <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']][$this->hhh . 'type' . $this->hhh] = $data['custom']['type'];
// type <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']][$this->hhh . 'ADD_BUTTON' . $this->hhh] = $this->setAddButtonToListField($data['custom']);
}
}
@ -2818,15 +2818,15 @@ class Fields extends Structure
// check that the component value is set
if (!isset($fieldData['component']) || !ComponentbuilderHelper::checkString($fieldData['component']))
{
$fieldData['component'] = "com_" . $this->fileContentStatic['###component###'];
$fieldData['component'] = "com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh];
}
// check that the componet has the com_ value in it
if (strpos($fieldData['component'], 'com_') === false || strpos($fieldData['component'], '=') !== false)
{
$fieldData['component'] = "com_" . $fieldData['component'];
}
// make sure the component is update if ### or [[[ component placeholder is used
if (strpos($fieldData['component'], '###') !== false || strpos($fieldData['component'], '[[[') !== false) // should not be needed... but
// make sure the component is update if # # # or [ [ [ component placeholder is used
if (strpos($fieldData['component'], $this->hhh) !== false || strpos($fieldData['component'], $this->bbb) !== false) // should not be needed... but
{
$fieldData['component'] = $this->setPlaceholders($fieldData['component'], $this->placeholders);
}
@ -2841,7 +2841,7 @@ class Fields extends Structure
// set switch to activate easy update
$coreLoad = true;
// since the view is local to the component use this component name
$component = "com_" . $this->fileContentStatic['###component###'];
$component = "com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh];
}
else
{

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -3085,15 +3085,15 @@ abstract class ComponentbuilderHelper
}
/**
* Move File to Server
*
* @param string $localPath The local path to the file
* @param string $fileName The the actual file name
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return bool true on success
* Move File to Server
*
* @param string $localPath The local path to the file
* @param string $fileName The the actual file name
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return bool true on success
**/
public static function moveToServer($localPath, $fileName, $serverID, $protocol = null, $permission = 'core.export')
{
@ -3128,23 +3128,23 @@ abstract class ComponentbuilderHelper
}
/**
* the SFTP objects
* the SFTP objects
**/
protected static $sftp = array();
/**
* the FTP objects
* the FTP objects
**/
protected static $ftp = array();
/**
* get the server object
*
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return object on success server object
* get the server object
*
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return object on success server object
**/
public static function getServer($serverID, $protocol = null, $permission = 'core.export')
{
@ -3167,12 +3167,12 @@ abstract class ComponentbuilderHelper
}
/**
* get the sftp object
*
* @param int $serverID The server local id to use
* @param string $permission The permission validation area
*
* @return object on success with sftp power
* get the sftp object
*
* @param int $serverID The server local id to use
* @param string $permission The permission validation area
*
* @return object on success with sftp power
**/
public static function getSftp($serverID, $permission = 'core.export')
{
@ -3326,12 +3326,12 @@ abstract class ComponentbuilderHelper
}
/**
* get the JClientFtp object
*
* @param int $serverID The server local id to use
* @param string $permission The permission validation area
*
* @return object on success with ftp power
* get the JClientFtp object
*
* @param int $serverID The server local id to use
* @param string $permission The permission validation area
*
* @return object on success with ftp power
**/
public static function getFtp($serverID, $permission)
{
@ -3417,13 +3417,13 @@ abstract class ComponentbuilderHelper
}
/**
* get the server details
*
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return object on success with server details
* get the server details
*
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return object on success with server details
**/
public static function getServerDetails($serverID, $protocol = 2, $permission = 'core.export')
{

View File

@ -94,6 +94,46 @@ COM_COMPONENTBUILDER_ADMINS_FIELDS_N_ITEMS_UNFEATURED="%s Admins Fields unfeatur
COM_COMPONENTBUILDER_ADMINS_FIELDS_N_ITEMS_UNFEATURED_1="%s Admin Fields unfeatured."
COM_COMPONENTBUILDER_ADMINS_FIELDS_N_ITEMS_UNPUBLISHED="%s Admins Fields unpublished."
COM_COMPONENTBUILDER_ADMINS_FIELDS_N_ITEMS_UNPUBLISHED_1="%s Admin Fields unpublished."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS="Admins Fields Relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS="Admins Fields Relations Access"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS_DESC="Allows the users in this group to access access admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_OPTIONS="Batch process the selected Admins Fields Relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_TIP="All changes will be applied to all selected Admins Fields Relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE="Admins Fields Relations Batch Use"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE="Admins Fields Relations Create"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE_DESC="Allows the users in this group to create create admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE="Admins Fields Relations Delete"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE_DESC="Allows the users in this group to delete delete admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT="Admins Fields Relations Edit"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY="Admins Fields Relations Edit Created By"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE="Admins Fields Relations Edit Created Date"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_DESC="Allows the users in this group to edit the admin fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN="Admins Fields Relations Edit Own"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN_DESC="Allows the users in this group to edit edit own admins fields relations created by them"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE="Admins Fields Relations Edit State"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE_DESC="Allows the users in this group to update the state of the admin fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION="Admins Fields Relations Edit Version"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_ARCHIVED="%s Admins Fields Relations archived."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_ARCHIVED_1="%s Admin Fields Relations archived."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_CHECKED_IN_0="No Admin Fields Relations successfully checked in."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_CHECKED_IN_1="%d Admin Fields Relations successfully checked in."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_CHECKED_IN_MORE="%d Admins Fields Relations successfully checked in."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_DELETED="%s Admins Fields Relations deleted."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_DELETED_1="%s Admin Fields Relations deleted."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_FEATURED="%s Admins Fields Relations featured."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_FEATURED_1="%s Admin Fields Relations featured."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_PUBLISHED="%s Admins Fields Relations published."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_PUBLISHED_1="%s Admin Fields Relations published."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_TRASHED="%s Admins Fields Relations trashed."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_TRASHED_1="%s Admin Fields Relations trashed."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_UNFEATURED="%s Admins Fields Relations unfeatured."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_UNFEATURED_1="%s Admin Fields Relations unfeatured."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_UNPUBLISHED="%s Admins Fields Relations unpublished."
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_UNPUBLISHED_1="%s Admin Fields Relations unpublished."
COM_COMPONENTBUILDER_ADMIN_BEHAVIOUR="Admin Behaviour"
COM_COMPONENTBUILDER_ADMIN_FIELDS="Admin Fields"
COM_COMPONENTBUILDER_ADMIN_FIELDS_ABOVE_TABS="Above Tabs"
@ -110,7 +150,7 @@ COM_COMPONENTBUILDER_ADMIN_FIELDS_ALIGNMENT_LABEL="Alignment"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS="Admin Fields Conditions"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ACTIVE_ONLY_FOUR_TEXT_FIELD="Active (only 4 text_field)"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS="Addconditions"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS_DESCRIPTION="Conditional setup for the above fields."
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS_DESCRIPTION="Conditional setup for the fields behaviour."
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS_LABEL="Conditions"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADMIN_VIEW="Admin View"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADMIN_VIEW_DESCRIPTION="Select an admin view"
@ -148,7 +188,7 @@ COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MODIFIED_BY_LABEL="Modified By"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MODIFIED_DATE_DESC="The date this Admin Fields Conditions was modified."
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MODIFIED_DATE_LABEL="Modified Date"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NEW="A New Admin Fields Conditions"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NOTE_ON_CONDITIONS_DESCRIPTION="Here you can add conditional field settings"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NOTE_ON_CONDITIONS_DESCRIPTION="Here you can add conditional settings"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NOTE_ON_CONDITIONS_LABEL="Condition Implementation"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ORDERING_LABEL="Ordering"
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_PERMISSION="Permissions"
@ -206,6 +246,47 @@ COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION="Permissions"
COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION_DESCRIPTION="What permission to use."
COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION_LABEL="Permissions"
COM_COMPONENTBUILDER_ADMIN_FIELDS_PUBLISHING="Publishing"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS="Admin Fields Relations"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADDRELATIONS="Addrelations"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADDRELATIONS_DESCRIPTION="Relations setup for the the field combination."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADDRELATIONS_LABEL="Relations"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADMIN_VIEW="Admin View"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADMIN_VIEW_DESCRIPTION="Select an admin view"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADMIN_VIEW_LABEL="View"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CONCATENATE="Concatenate"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_BY_DESC="The user that created this Admin Fields Relations."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_BY_LABEL="Created By"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_DATE_DESC="The date this Admin Fields Relations was created."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_DATE_LABEL="Created Date"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CUSTOM_CODE="Custom Code"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_EDIT="Editing the Admin Fields Relations"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ERROR_UNIQUE_ALIAS="Another Admin Fields Relations has the same alias."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ID="Id"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOINFIELDS="Joinfields"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOINFIELDS_DESCRIPTION="Select the target join fields."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOINFIELDS_LABEL="Join Field"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOIN_TYPE_LABEL="Join Type"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_LISTFIELD="Listfield"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_LISTFIELD_DESCRIPTION="Select the target list field."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_LISTFIELD_LABEL="List Field"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_BY_DESC="The last user that modified this Admin Fields Relations."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_BY_LABEL="Modified By"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_DATE_DESC="The date this Admin Fields Relations was modified."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_DATE_LABEL="Modified Date"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NEW="A New Admin Fields Relations"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NOTE_ON_RELATIONS_DESCRIPTION="<p>Here you are able to combine/join multiple fields into one for display in the list view of the admin area.</p><p>You are able to add calculations, or even model the values into one result.</p>"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NOTE_ON_RELATIONS_LABEL="Relations Implementation"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ORDERING_LABEL="Ordering"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_PERMISSION="Permissions"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_PUBLISHING="Publishing"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_RELATIONS="Relations"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Admin Fields Relations to customise the alias."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_SET_DESCRIPTION="Glue/Code"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_SET_HINT="Glue/Code"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_SET_LABEL="Set"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_STATUS="Status"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_VERSION_DESC="A count of the number of times this Admin Fields Relations has been revised."
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_VERSION_LABEL="Revision"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RIGHT_IN_TAB="Right in Tab"
COM_COMPONENTBUILDER_ADMIN_FIELDS_RIGHT_OF_TABS="Right of Tabs"
COM_COMPONENTBUILDER_ADMIN_FIELDS_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Admin Fields to customise the alias."
@ -472,7 +553,7 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_EYE_CLOSE="Eye Close"
COM_COMPONENTBUILDER_ADMIN_VIEW_EYE_OPEN="Eye Open"
COM_COMPONENTBUILDER_ADMIN_VIEW_FEATURED="Featured"
COM_COMPONENTBUILDER_ADMIN_VIEW_FEED="Feed"
COM_COMPONENTBUILDER_ADMIN_VIEW_FIELDS_CONDITIONS="Fields & Conditions"
COM_COMPONENTBUILDER_ADMIN_VIEW_FIELDS="Fields"
COM_COMPONENTBUILDER_ADMIN_VIEW_FILE="File"
COM_COMPONENTBUILDER_ADMIN_VIEW_FILE_ADD="File Add"
COM_COMPONENTBUILDER_ADMIN_VIEW_FILE_CHECK="File Check"
@ -615,7 +696,15 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ALIAS_BUILDER_DEFAULT_LABEL="Default Alias
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_BEGINNER_IMPORT_DESCRIPTION="<p>Please do not change this area unless you would like to add special import to this view that goes beyond the default import concept that Component Builder already does automatic if this view is set to have import & export in the component area where this view is linked to the component.</p>"
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_BEGINNER_IMPORT_LABEL="Beginners notice."
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_BUTTONS_DESCRIPTION="Some Shortcut Buttons<hr /><div id='jform_create_edit_buttons'></div>"
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_DISPLAY_DESCRIPTION="<hr /><h4>Linked Fields <span id='header_admin_fields_buttons'></span></h4><div id='display_admin_fields'>Display of the fields will load here!</div><hr /><h4>Field Conditions <span id='header_admin_fields_conditions_buttons'></span></h4><div id='display_admin_fields_conditions'>Display of the fields conditions will load here!</div>"
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_DISPLAY_DESCRIPTION="<hr />
<h4>Linked Fields <span id='header_admin_fields_buttons'></span></h4>
<div id='display_admin_fields'>Display of the fields will load here!</div>
<hr />
<h4>Field Relations <span id='header_admin_fields_relations_buttons'></span></h4>
<div id='display_admin_fields_relations'>Display of the fields relations will load here!</div>
<hr />
<h4>Field Conditions <span id='header_admin_fields_conditions_buttons'></span></h4>
<div id='display_admin_fields_conditions'>Display of the fields conditions will load here!</div>"
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_NOTICE_DESCRIPTION="<h5>Welcome to the new improved fields and conditions layout.</h5><div class='note_create_edit_notice_p'><p>We had to remove the repeatable fields layouts since Joomla has depreciated it. With this new improved layout we trust your experience will be better then ever before.</p><p>You can still <a href='https://youtu.be/CdSKSCTzmRA?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=32m28s' target='_blank'>watch the tutorials</a>, and though it was made during the time repeatable fields were still being used, the various concepts and layouts still look mostly the same.</p></div>"
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_NOTICE_LABEL="Fields &amp; Conditions"
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_LINKED_TO_NOTICE_DESCRIPTION="<div id='display_linked_to'>Searching the database.<span class='loading-dots'></span></div>"
@ -2210,6 +2299,7 @@ COM_COMPONENTBUILDER_COMPONENT_UPDATES_VERSION_MESSAGE="Error! Please add some t
COM_COMPONENTBUILDER_COMPONENT_UPDATES_VERSION_UPDATE="Version Update"
COM_COMPONENTBUILDER_COMPONENT_UPDATES_VERSION_UPDATE_DESCRIPTION="Add Version Updates Here!"
COM_COMPONENTBUILDER_COMPONENT_UPDATES_VERSION_UPDATE_LABEL="Version Updates"
COM_COMPONENTBUILDER_CONCATENATE="Concatenate"
COM_COMPONENTBUILDER_CONDITIONS="Conditions"
COM_COMPONENTBUILDER_CONFIG_ACTIVE="Active"
COM_COMPONENTBUILDER_CONFIG_ADD_MENU_PREFIX_DESCRIPTION="Would you like to add a prefix to the Joomla menu name of your components"
@ -3640,6 +3730,7 @@ COM_COMPONENTBUILDER_EDIT_S="Edit %s"
COM_COMPONENTBUILDER_EDIT_S_FOR_THIS_S="Edit %s for this %s"
COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS="Edit the admin fields"
COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS_CONDITIONS="Edit the admin fields conditions"
COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS_RELATIONS="Edit the admin fields relations"
COM_COMPONENTBUILDER_EDIT_VERSIONS="Edit Version"
COM_COMPONENTBUILDER_EDIT_VERSIONS_DESC=" Allows users in this group to edit versions."
COM_COMPONENTBUILDER_EMAIL="Email"
@ -4090,6 +4181,7 @@ COM_COMPONENTBUILDER_GET_SNIPPETS_TEMPLATES_BUTTON_ACCESS_DESC=" Allows the user
COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_INSTALL_IT_LOCALLY="Get the snippet from gitHub and install it locally"
COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_UPDATE_THE_LOCAL_VERSION="Get the snippet from gitHub and update the local version"
COM_COMPONENTBUILDER_GLOBAL="Global"
COM_COMPONENTBUILDER_GLUECODE="Glue/Code"
COM_COMPONENTBUILDER_GREAT_THIS_FUNCTION_NAME_WILL_WORK="Great, this function name will work!"
COM_COMPONENTBUILDER_GREAT_THIS_VALIDATION_RULE_NAME_S_WILL_WORK="Great, this validation rule name (%s) will work!"
COM_COMPONENTBUILDER_HAS_METADATA="Has Metadata"
@ -4279,6 +4371,8 @@ COM_COMPONENTBUILDER_JCB_COMMUNITY_PACKAGES="JCB Community Packages"
COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS="JCB Community Snippets"
COM_COMPONENTBUILDER_JCB_PACKAGE_IMPORT="JCB Package Import"
COM_COMPONENTBUILDER_JCB_PACKAGE_INFO_PATH_DOES_NOT_WORK_WE_ADVICE_YOU_BNOT_TO_CONTINUEB_WITH_THE_IMPORT_OF_THE_SELECTED_PACKAGE="JCB Package info path does not work, we advice you <b>not to continue</b> with the import of the selected package!"
COM_COMPONENTBUILDER_JOIN_FIELDS="Join Fields"
COM_COMPONENTBUILDER_JOIN_TYPE="Join Type"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT="Joomla Component"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS="Joomla Components"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_ACCESS="Joomla Components Access"
@ -5412,6 +5506,7 @@ COM_COMPONENTBUILDER_LICENSE_S="License: %s"
COM_COMPONENTBUILDER_LINK="Link"
COM_COMPONENTBUILDER_LINK_LOCAL_DYNAMIC="Link & Local (dynamic)"
COM_COMPONENTBUILDER_LINK_TO_THE_CONTRIBUTOR="Link to the contributor"
COM_COMPONENTBUILDER_LIST_FIELD="List Field"
COM_COMPONENTBUILDER_LOADING="loading"
COM_COMPONENTBUILDER_LOCAL="Local"
COM_COMPONENTBUILDER_LOCAL_GET="Local (get)"

View File

@ -39,6 +39,26 @@ COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_STATE="Admins Fields Edit State"
COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_STATE_DESC="Allows the users in this group to update the state of the admin fields"
COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_VERSION="Admins Fields Edit Version"
COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version admins fields"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS="Admins Fields Relations Access"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS_DESC="Allows the users in this group to access access admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE="Admins Fields Relations Batch Use"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE="Admins Fields Relations Create"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE_DESC="Allows the users in this group to create create admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE="Admins Fields Relations Delete"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE_DESC="Allows the users in this group to delete delete admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT="Admins Fields Relations Edit"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY="Admins Fields Relations Edit Created By"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE="Admins Fields Relations Edit Created Date"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created admins fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_DESC="Allows the users in this group to edit the admin fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN="Admins Fields Relations Edit Own"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN_DESC="Allows the users in this group to edit edit own admins fields relations created by them"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE="Admins Fields Relations Edit State"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE_DESC="Allows the users in this group to update the state of the admin fields relations"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION="Admins Fields Relations Edit Version"
COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version admins fields relations"
COM_COMPONENTBUILDER_ADMIN_VIEWS_ACCESS="Admin Views Access"
COM_COMPONENTBUILDER_ADMIN_VIEWS_ACCESS_DESC="Allows the users in this group to access access admin views"
COM_COMPONENTBUILDER_ADMIN_VIEWS_BATCH_USE="Admin Views Batch Use"

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,44 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$app = JFactory::getApplication();
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'created',
'created_by',
'modified',
'modified_by'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
foreach ($fields as $field)
{
$field = is_array($field) ? $field : array($field);
foreach ($field as $f)
{
if ($form->getField($f))
{
if (in_array($f, $hiddenFields))
{
$form->setFieldAttribute($f, 'type', 'hidden');
}
echo $form->renderField($f);
break;
}
}
}

View File

@ -0,0 +1,46 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$app = JFactory::getApplication();
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'published',
'ordering',
'access',
'version',
'hits',
'id'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
foreach ($fields as $field)
{
$field = is_array($field) ? $field : array($field);
foreach ($field as $f)
{
if ($form->getField($f))
{
if (in_array($f, $hiddenFields))
{
$form->setFieldAttribute($f, 'type', 'hidden');
}
echo $form->renderField($f);
break;
}
}
}

View File

@ -0,0 +1,27 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();
$fields = array(
'admin_view'
);
?>
<div class="form-inline form-inline-header">
<?php foreach($fields as $field){
echo $form->renderField($field);
} ?>
</div>

View File

@ -0,0 +1,35 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'note_on_relations',
'addrelations'
);
?>
<div class="form-vertical">
<?php foreach($fields as $field): ?>
<div class="control-group">
<div class="control-label">
<?php echo $form->getLabel($field); ?>
</div>
<div class="controls">
<?php echo $form->getInput($field); ?>
</div>
</div>
<?php endforeach; ?>
</div>

View File

@ -0,0 +1,878 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\Registry\Registry;
// import Joomla modelform library
jimport('joomla.application.component.modeladmin');
/**
* Componentbuilder Admin_fields_relations Model
*/
class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
{
/**
* @var string The prefix to use with controller messages.
* @since 1.6
*/
protected $text_prefix = 'COM_COMPONENTBUILDER';
/**
* The type alias for this content type.
*
* @var string
* @since 3.2
*/
public $typeAlias = 'com_componentbuilder.admin_fields_relations';
/**
* Returns a Table object, always creating it
*
* @param type $type The table type to instantiate
* @param string $prefix A prefix for the table class name. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return JTable A database object
*
* @since 1.6
*/
public function getTable($type = 'admin_fields_relations', $prefix = 'ComponentbuilderTable', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
/**
* Method to get a single record.
*
* @param integer $pk The id of the primary key.
*
* @return mixed Object on success, false on failure.
*
* @since 1.6
*/
public function getItem($pk = null)
{
if ($item = parent::getItem($pk))
{
if (!empty($item->params) && !is_array($item->params))
{
// Convert the params field to an array.
$registry = new Registry;
$registry->loadString($item->params);
$item->params = $registry->toArray();
}
if (!empty($item->metadata))
{
// Convert the metadata field to an array.
$registry = new Registry;
$registry->loadString($item->metadata);
$item->metadata = $registry->toArray();
}
if (!empty($item->addrelations))
{
// Convert the addrelations field to an array.
$addrelations = new Registry;
$addrelations->loadString($item->addrelations);
$item->addrelations = $addrelations->toArray();
}
// check what type of conditions array we have here (should be subform... but just incase)
// This could happen due to huge data sets
if (isset($item->addconditions) && isset($item->addconditions['target_field']))
{
$bucket = array();
foreach($item->addconditions as $option => $values)
{
foreach($values as $nr => $value)
{
$bucket['addconditions'.$nr][$option] = $value;
}
}
$item->addconditions = $bucket;
// update the fields
$conditionsUpdate = new stdClass();
$conditionsUpdate->id = (int) $item->id;
$conditionsUpdate->addconditions = json_encode($bucket);
$this->_db->updateObject('#__componentbuilder_admin_fields_conditions', $conditionsUpdate, 'id');
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.admin_fields_relations');
}
}
return $item;
}
/**
* Method to get the record form.
*
* @param array $data Data for the form.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
*
* @return mixed A JForm object on success, false on failure
*
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{
// Get the form.
$form = $this->loadForm('com_componentbuilder.admin_fields_relations', 'admin_fields_relations', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
{
return false;
}
$jinput = JFactory::getApplication()->input;
// The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
if ($jinput->get('a_id'))
{
$id = $jinput->get('a_id', 0, 'INT');
}
// The back end uses id so we use that the rest of the time and set it to 0 by default.
else
{
$id = $jinput->get('id', 0, 'INT');
}
$user = JFactory::getUser();
// Check for existing item.
// Modify the form based on Edit State access controls.
if ($id != 0 && (!$user->authorise('admin_fields_relations.edit.state', 'com_componentbuilder.admin_fields_relations.' . (int) $id))
|| ($id == 0 && !$user->authorise('admin_fields_relations.edit.state', 'com_componentbuilder')))
{
// Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true');
// Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset');
}
// If this is a new item insure the greated by is set.
if (0 == $id)
{
// Set the created_by to this user
$form->setValue('created_by', null, $user->id);
}
// Modify the form based on Edit Creaded By access controls.
if ($id != 0 && (!$user->authorise('admin_fields_relations.edit.created_by', 'com_componentbuilder.admin_fields_relations.' . (int) $id))
|| ($id == 0 && !$user->authorise('admin_fields_relations.edit.created_by', 'com_componentbuilder')))
{
// Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true');
// Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true');
// Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset');
}
// Modify the form based on Edit Creaded Date access controls.
if ($id != 0 && (!$user->authorise('admin_fields_relations.edit.created', 'com_componentbuilder.admin_fields_relations.' . (int) $id))
|| ($id == 0 && !$user->authorise('admin_fields_relations.edit.created', 'com_componentbuilder')))
{
// Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true');
// Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset');
}
// Only load these values if no id is found
if (0 == $id)
{
// Set redirected field name
$redirectedField = $jinput->get('ref', null, 'STRING');
// Set redirected field value
$redirectedValue = $jinput->get('refid', 0, 'INT');
if (0 != $redirectedValue && $redirectedField)
{
// Now set the local-redirected field default value
$form->setValue($redirectedField, null, $redirectedValue);
}
}
return $form;
}
/**
* Method to get the script that have to be included on the form
*
* @return string script files
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/admin_fields_relations.js';
}
/**
* Method to test whether a record can be deleted.
*
* @param object $record A record object.
*
* @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
*
* @since 1.6
*/
protected function canDelete($record)
{
if (!empty($record->id))
{
if ($record->published != -2)
{
return;
}
$user = JFactory::getUser();
// The record has been set. Check the record permissions.
return $user->authorise('admin_fields_relations.delete', 'com_componentbuilder.admin_fields_relations.' . (int) $record->id);
}
return false;
}
/**
* Method to test whether a record can have its state edited.
*
* @param object $record A record object.
*
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
*
* @since 1.6
*/
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('admin_fields_relations.edit.state', 'com_componentbuilder.admin_fields_relations.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
return false;
}
}
// In the absense of better information, revert to the component permissions.
return $user->authorise('admin_fields_relations.edit.state', 'com_componentbuilder');
}
/**
* Method override to check if you can edit an existing record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
* @since 2.5
*/
protected function allowEdit($data = array(), $key = 'id')
{
// Check specific edit permission then general edit permission.
$user = JFactory::getUser();
return $user->authorise('admin_fields_relations.edit', 'com_componentbuilder.admin_fields_relations.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('admin_fields_relations.edit', 'com_componentbuilder');
}
/**
* Prepare and sanitise the table data prior to saving.
*
* @param JTable $table A JTable object.
*
* @return void
*
* @since 1.6
*/
protected function prepareTable($table)
{
$date = JFactory::getDate();
$user = JFactory::getUser();
if (isset($table->name))
{
$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
}
if (isset($table->alias) && empty($table->alias))
{
$table->generateAlias();
}
if (empty($table->id))
{
$table->created = $date->toSql();
// set the user
if ($table->created_by == 0 || empty($table->created_by))
{
$table->created_by = $user->id;
}
// Set ordering to the last item if not set
if (empty($table->ordering))
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('MAX(ordering)')
->from($db->quoteName('#__componentbuilder_admin_fields_relations'));
$db->setQuery($query);
$max = $db->loadResult();
$table->ordering = $max + 1;
}
}
else
{
$table->modified = $date->toSql();
$table->modified_by = $user->id;
}
if (!empty($table->id))
{
// Increment the items version number.
$table->version++;
}
}
/**
* Method to get the data that should be injected in the form.
*
* @return mixed The data for the form.
*
* @since 1.6
*/
protected function loadFormData()
{
// Check the session for previously entered form data.
$data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.admin_fields_relations.data', array());
if (empty($data))
{
$data = $this->getItem();
}
return $data;
}
/**
* Method to get the unique fields of this table.
*
* @return mixed An array of field names, boolean false if none is set.
*
* @since 3.0
*/
protected function getUniqeFields()
{
return false;
}
/**
* Method to delete one or more records.
*
* @param array &$pks An array of record primary keys.
*
* @return boolean True if successful, false if an error occurs.
*
* @since 12.2
*/
public function delete(&$pks)
{
if (!parent::delete($pks))
{
return false;
}
return true;
}
/**
* Method to change the published state of one or more records.
*
* @param array &$pks A list of the primary keys to change.
* @param integer $value The value of the published state.
*
* @return boolean True on success.
*
* @since 12.2
*/
public function publish(&$pks, $value = 1)
{
if (!parent::publish($pks, $value))
{
return false;
}
return true;
}
/**
* Method to perform batch operations on an item or a set of items.
*
* @param array $commands An array of commands to perform.
* @param array $pks An array of item ids.
* @param array $contexts An array of item contexts.
*
* @return boolean Returns true on success, false on failure.
*
* @since 12.2
*/
public function batch($commands, $pks, $contexts)
{
// Sanitize ids.
$pks = array_unique($pks);
JArrayHelper::toInteger($pks);
// Remove any values of zero.
if (array_search(0, $pks, true))
{
unset($pks[array_search(0, $pks, true)]);
}
if (empty($pks))
{
$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
return false;
}
$done = false;
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations');
$this->batchSet = true;
if (!$this->canDo->get('core.batch'))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
return false;
}
if ($this->type == false)
{
$type = new JUcmType;
$this->type = $type->getTypeByAlias($this->typeAlias);
}
$this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
if (!empty($commands['move_copy']))
{
$cmd = JArrayHelper::getValue($commands, 'move_copy', 'c');
if ($cmd == 'c')
{
$result = $this->batchCopy($commands, $pks, $contexts);
if (is_array($result))
{
foreach ($result as $old => $new)
{
$contexts[$new] = $contexts[$old];
}
$pks = array_values($result);
}
else
{
return false;
}
}
elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts))
{
return false;
}
$done = true;
}
if (!$done)
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
return false;
}
// Clear the cache
$this->cleanCache();
return true;
}
/**
* Batch copy items to a new category or current.
*
* @param integer $values The new values.
* @param array $pks An array of row IDs.
* @param array $contexts An array of item contexts.
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
if (empty($this->batchSet))
{
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations');
}
if (!$this->canDo->get('admin_fields_relations.create') && !$this->canDo->get('admin_fields_relations.batch'))
{
return false;
}
// get list of uniqe fields
$uniqeFields = $this->getUniqeFields();
// remove move_copy from array
unset($values['move_copy']);
// make sure published is set
if (!isset($values['published']))
{
$values['published'] = 0;
}
elseif (isset($values['published']) && !$this->canDo->get('admin_fields_relations.edit.state'))
{
$values['published'] = 0;
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
// Pop the first ID off the stack
$pk = array_shift($pks);
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('admin_fields_relations.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// Fatal error
$this->setError($error);
return false;
}
else
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->admin_view) && !is_numeric($this->table->admin_view))
{
$this->table->admin_view = $this->generateUniqe('admin_view',$this->table->admin_view);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
{
foreach ($values as $key => $value)
{
if (strlen($value) > 0 && isset($this->table->$key))
{
$this->table->$key = $value;
}
}
}
// update all uniqe fields
if (ComponentbuilderHelper::checkArray($uniqeFields))
{
foreach ($uniqeFields as $uniqeField)
{
$this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField);
}
}
// Reset the ID because we are making a copy
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
return false;
}
if (!empty($this->type))
{
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
return false;
}
// Get the new item ID
$newId = $this->table->get('id');
// Add the new ID to the array
$newIds[$pk] = $newId;
}
// Clean the cache
$this->cleanCache();
return $newIds;
}
/**
* Batch move items to a new category
*
* @param integer $value The new category ID.
* @param array $pks An array of row IDs.
* @param array $contexts An array of item contexts.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
if (empty($this->batchSet))
{
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations');
}
if (!$this->canDo->get('admin_fields_relations.edit') && !$this->canDo->get('admin_fields_relations.batch'))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
// make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('admin_fields_relations.edit.state'))
{
unset($values['published']);
}
// remove move_copy from array
unset($values['move_copy']);
// Parent exists so we proceed
foreach ($pks as $pk)
{
if (!$this->user->authorise('admin_fields_relations.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// Fatal error
$this->setError($error);
return false;
}
else
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
// insert all set values.
if (ComponentbuilderHelper::checkArray($values))
{
foreach ($values as $key => $value)
{
// Do special action for access.
if ('access' === $key && strlen($value) > 0)
{
$this->table->$key = $value;
}
elseif (strlen($value) > 0 && isset($this->table->$key))
{
$this->table->$key = $value;
}
}
}
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
return false;
}
if (!empty($this->type))
{
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
return false;
}
}
// Clean the cache
$this->cleanCache();
return true;
}
/**
* Method to save the form data.
*
* @param array $data The form data.
*
* @return boolean True on success.
*
* @since 1.6
*/
public function save($data)
{
$input = JFactory::getApplication()->input;
$filter = JFilterInput::getInstance();
// set the metadata to the Item Data
if (isset($data['metadata']) && isset($data['metadata']['author']))
{
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
$metadata = new JRegistry;
$metadata->loadArray($data['metadata']);
$data['metadata'] = (string) $metadata;
}
// Set the addrelations items to data.
if (isset($data['addrelations']) && is_array($data['addrelations']))
{
$addrelations = new JRegistry;
$addrelations->loadArray($data['addrelations']);
$data['addrelations'] = (string) $addrelations;
}
elseif (!isset($data['addrelations']))
{
// Set the empty addrelations to data
$data['addrelations'] = '';
}
// Set the Params Items to data
if (isset($data['params']) && is_array($data['params']))
{
$params = new JRegistry;
$params->loadArray($data['params']);
$data['params'] = (string) $params;
}
// Alter the uniqe field for save as copy
if ($input->get('task') === 'save2copy')
{
// Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields();
if (ComponentbuilderHelper::checkArray($uniqeFields))
{
foreach ($uniqeFields as $uniqeField)
{
$data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]);
}
}
}
if (parent::save($data))
{
return true;
}
return false;
}
/**
* Method to generate a uniqe value.
*
* @param string $field name.
* @param string $value data.
*
* @return string New value.
*
* @since 3.0
*/
protected function generateUniqe($field,$value)
{
// set field value uniqe
$table = $this->getTable();
while ($table->load(array($field => $value)))
{
$value = JString::increment($value);
}
return $value;
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{
// Alter the title
$table = $this->getTable();
while ($table->load(array('title' => $title)))
{
$title = JString::increment($title);
}
return $title;
}
}

View File

@ -729,7 +729,8 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
{
$_tablesArray = array(
'admin_fields',
'admin_fields_conditions'
'admin_fields_conditions',
'admin_fields_relations'
);
foreach($_tablesArray as $_updateTable)
{
@ -769,7 +770,8 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
{
$_tablesArray = array(
'admin_fields',
'admin_fields_conditions'
'admin_fields_conditions',
'admin_fields_relations'
);
foreach($_tablesArray as $_updateTable)
{

View File

@ -0,0 +1,242 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import the Joomla modellist library
jimport('joomla.application.component.modellist');
/**
* Admins_fields_relations Model
*/
class ComponentbuilderModelAdmins_fields_relations extends JModelList
{
public function __construct($config = array())
{
if (empty($config['filter_fields']))
{
$config['filter_fields'] = array(
'a.id','id',
'a.published','published',
'a.ordering','ordering',
'a.created_by','created_by',
'a.modified_by','modified_by'
);
}
parent::__construct($config);
}
/**
* Method to auto-populate the model state.
*
* @return void
*/
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication();
// Adjust the context to support modal layouts.
if ($layout = $app->input->get('layout'))
{
$this->context .= '.' . $layout;
}
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
$this->setState('filter.sorting', $sorting);
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
$this->setState('filter.access', $access);
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
$this->setState('filter.created_by', $created_by);
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
$this->setState('filter.created', $created);
// List state information.
parent::populateState($ordering, $direction);
}
/**
* Method to get an array of data items.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getItems()
{
// check in items
$this->checkInNow();
// load parent items
$items = parent::getItems();
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('admin_fields_relations.access', 'com_componentbuilder.admin_fields_relations.' . (int) $item->id) && $user->authorise('admin_fields_relations.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
continue;
}
}
}
// return items
return $items;
}
/**
* Method to build an SQL query to load the list data.
*
* @return string An SQL query
*/
protected function getListQuery()
{
// Get the user object.
$user = JFactory::getUser();
// Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// Select some fields
$query->select('a.*');
// From the componentbuilder_item table
$query->from($db->quoteName('#__componentbuilder_admin_fields_relations', 'a'));
// From the componentbuilder_admin_view table.
$query->select($db->quoteName('g.system_name','admin_view_system_name'));
$query->join('LEFT', $db->quoteName('#__componentbuilder_admin_view', 'g') . ' ON (' . $db->quoteName('a.admin_view') . ' = ' . $db->quoteName('g.id') . ')');
// Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published))
{
$query->where('a.published = ' . (int) $published);
}
elseif ($published === '')
{
$query->where('(a.published = 0 OR a.published = 1)');
}
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '')
{
$query->order($db->escape($orderCol . ' ' . $orderDirn));
}
return $query;
}
/**
* Method to get a store id based on model configuration state.
*
* @return string A store id.
*
*/
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
$id .= ':' . $this->getState('filter.ordering');
$id .= ':' . $this->getState('filter.created_by');
$id .= ':' . $this->getState('filter.modified_by');
return parent::getStoreId($id);
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{
// Get a db connection.
$db = JFactory::getDbo();
// reset query
$query = $db->getQuery(true);
$query->select('*');
$query->from($db->quoteName('#__componentbuilder_admin_fields_relations'));
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
// Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql();
// reset query
$query = $db->getQuery(true);
// Fields to update.
$fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0'
);
// Conditions for which records should be updated.
$conditions = array(
$db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\''
);
// Check table
$query->update($db->quoteName('#__componentbuilder_admin_fields_relations'))->set($fields)->where($conditions);
$db->setQuery($query);
$db->execute();
}
}
return false;
}
}

View File

@ -238,6 +238,7 @@ class ComponentbuilderModelAjax extends JModelList
'library_files_folders_urls' => 'libraries_files_folders_urls',
'admin_fields' => 'admins_fields',
'admin_fields_conditions' => 'admins_fields_conditions',
'admin_fields_relations' => 'admins_fields_relations',
'validation_rule' => 'validation_rules',
'field' => 'fields',
'component_admin_views' => 'components_admin_views' ,
@ -410,6 +411,9 @@ class ComponentbuilderModelAjax extends JModelList
'type' => 'setURLType',
// Admin View
'field' => 'setItemNames',
'listfield' => 'setItemNames',
'joinfields' => 'setItemNames',
'join_type' => 'setJoinType',
'list' => 'setAdminBehaviour',
'title' => 'setYesNo',
'alias' => 'setYesNo',
@ -456,6 +460,10 @@ class ComponentbuilderModelAjax extends JModelList
'update' => JText::_('COM_COMPONENTBUILDER_UPDATE'),
// Admin View (fields)
'field' => JText::_('COM_COMPONENTBUILDER_FIELD'),
'listfield' => JText::_('COM_COMPONENTBUILDER_LIST_FIELD'),
'joinfields' => JText::_('COM_COMPONENTBUILDER_JOIN_FIELDS'),
'set' => JText::_('COM_COMPONENTBUILDER_GLUECODE'),
'join_type' => JText::_('COM_COMPONENTBUILDER_JOIN_TYPE'),
'list' => JText::_('COM_COMPONENTBUILDER_ADMIN_BEHAVIOUR'),
'order_list' => JText::_('COM_COMPONENTBUILDER_ORDER_IN_LIST_VIEWS'),
'title' => JText::_('COM_COMPONENTBUILDER_TITLE'),
@ -625,6 +633,7 @@ class ComponentbuilderModelAjax extends JModelList
'library_files_folders_urls' => array('addurls','addfiles','addfolders'),
'admin_fields' => 'addfields',
'admin_fields_conditions' => 'addconditions',
'admin_fields_relations' => 'addrelations',
'component_admin_views' => 'addadmin_views',
'component_site_views' => 'addsite_views',
'component_custom_admin_views' => 'addcustom_admin_views');
@ -755,6 +764,8 @@ class ComponentbuilderModelAjax extends JModelList
'field' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')),
'target_field' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')),
'match_field' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')),
'listfield' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')),
'joinfields' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')),
// joomla component view
'siteview' => array('table' => 'site_view', 'tables' => 'site_views', 'id' => 'id', 'name' => 'name', 'text' => 'Site View'),
'customadminview' => array('table' => 'custom_admin_view', 'tables' => 'custom_admin_views', 'id' => 'id', 'name' => 'system_name', 'text' => 'Custom Admin View'),
@ -832,6 +843,20 @@ class ComponentbuilderModelAjax extends JModelList
return JText::_('COM_COMPONENTBUILDER_NO_ITEM_FOUND');
}
protected function setJoinType($header, $value)
{
switch ($value)
{
case 1:
return JText::_('COM_COMPONENTBUILDER_CONCATENATE');
break;
case 2:
return JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE');
break;
}
return JText::_('COM_COMPONENTBUILDER_NOT_SET');
}
protected function setURLType($header, $value)
{
switch ($value)

View File

@ -131,6 +131,9 @@ class ComponentbuilderModelComponentbuilder extends JModelList
'admin_fields_conditions.create' => 'admin_fields_conditions.create',
'admins_fields_conditions.access' => 'admin_fields_conditions.access',
'admin_fields_conditions.access' => 'admin_fields_conditions.access',
'admin_fields_relations.create' => 'admin_fields_relations.create',
'admins_fields_relations.access' => 'admin_fields_relations.access',
'admin_fields_relations.access' => 'admin_fields_relations.access',
'component_admin_views.create' => 'component_admin_views.create',
'components_admin_views.access' => 'component_admin_views.access',
'component_admin_views.access' => 'component_admin_views.access',

View File

@ -0,0 +1,101 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
/**
* Joinfields Form Field class for the Componentbuilder component
*/
class JFormFieldJoinfields extends JFormFieldList
{
/**
* The joinfields field type.
*
* @var string
*/
public $type = 'joinfields';
/**
* Method to get a list of options for a list input.
*
* @return array An array of JHtml options.
*/
public function getOptions()
{
// load the db opbject
$db = JFactory::getDBO();
// get the input from url
$jinput = JFactory::getApplication()->input;
// get the id
$ID = $jinput->getInt('id', 0);
// rest the fields ids
$fieldIds = array();
if (is_numeric($ID) && $ID >= 1)
{
// get the admin view ID
$adminView = ComponentbuilderHelper::getVar('admin_fields_relations', (int) $ID, 'id', 'admin_view');
}
else
{
// get the admin view ID
$adminView = $jinput->getInt('refid', 0);
}
if (is_numeric($adminView) && $adminView >= 1)
{
// get all the fields linked to the admin view
if ($addFields = ComponentbuilderHelper::getVar('admin_fields', (int) $adminView, 'admin_view', 'addfields'))
{
if (ComponentbuilderHelper::checkJson($addFields))
{
$addFields = json_decode($addFields, true);
if (ComponentbuilderHelper::checkArray($addFields))
{
foreach($addFields as $addField)
{
if (isset($addField['field']) && (!isset($addField['list']) || ($addField['list'] != 1 && $addField['list'] != 2)))
{
$fieldIds[] = (int) $addField['field'];
}
}
}
}
}
// filter by fields linked
if (ComponentbuilderHelper::checkArray($fieldIds))
{
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.id','a.name'),array('id','name')));
$query->from($db->quoteName('#__componentbuilder_field', 'a'));
$query->where($db->quoteName('a.published') . ' >= 1');
// only load these fields
$query->where($db->quoteName('a.id') . ' IN (' . implode(',', $fieldIds) . ')');
$query->order('a.name ASC');
$db->setQuery((string)$query);
$items = $db->loadObjectList();
$options = array();
if ($items)
{
foreach($items as $item)
{
$options[] = JHtml::_('select.option', $item->id, $item->name);
}
}
return $options;
}
}
return false;
}
}

View File

@ -0,0 +1,101 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
/**
* Listfields Form Field class for the Componentbuilder component
*/
class JFormFieldListfields extends JFormFieldList
{
/**
* The listfields field type.
*
* @var string
*/
public $type = 'listfields';
/**
* Method to get a list of options for a list input.
*
* @return array An array of JHtml options.
*/
public function getOptions()
{
// load the db opbject
$db = JFactory::getDBO();
// get the input from url
$jinput = JFactory::getApplication()->input;
// get the id
$ID = $jinput->getInt('id', 0);
// rest the fields ids
$fieldIds = array();
if (is_numeric($ID) && $ID >= 1)
{
// get the admin view ID
$adminView = ComponentbuilderHelper::getVar('admin_fields_relations', (int) $ID, 'id', 'admin_view');
}
else
{
// get the admin view ID
$adminView = $jinput->getInt('refid', 0);
}
if (is_numeric($adminView) && $adminView >= 1)
{
// get all the fields linked to the admin view
if ($addFields = ComponentbuilderHelper::getVar('admin_fields', (int) $adminView, 'admin_view', 'addfields'))
{
if (ComponentbuilderHelper::checkJson($addFields))
{
$addFields = json_decode($addFields, true);
if (ComponentbuilderHelper::checkArray($addFields))
{
foreach($addFields as $addField)
{
if (isset($addField['field']) && isset($addField['list']) && $addField['list'] == 1)
{
$fieldIds[] = (int) $addField['field'];
}
}
}
}
}
// filter by fields linked
if (ComponentbuilderHelper::checkArray($fieldIds))
{
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.id','a.name'),array('id','name')));
$query->from($db->quoteName('#__componentbuilder_field', 'a'));
$query->where($db->quoteName('a.published') . ' >= 1');
// only load these fields
$query->where($db->quoteName('a.id') . ' IN (' . implode(',', $fieldIds) . ')');
$query->order('a.name ASC');
$db->setQuery((string)$query);
$items = $db->loadObjectList();
$options = array();
if ($items)
{
foreach($items as $item)
{
$options[] = JHtml::_('select.option', $item->id, $item->name);
}
}
return $options;
}
}
return false;
}
}

View File

@ -0,0 +1,44 @@
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
function getFieldSelectOptions_server(fieldId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldSelectOptions&format=json";
if(token.length > 0 && fieldId > 0){
var request = 'token='+token+'&id='+fieldId;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
data: request,
jsonp: 'callback'
});
}
function getFieldSelectOptions(fieldKey){
// first check if the field is set
if(jQuery("#jform_addconditions__addconditions"+fieldKey+"__match_field").length) {
var fieldId = jQuery("#jform_addconditions__addconditions"+fieldKey+"__match_field option:selected").val();
getFieldSelectOptions_server(fieldId).done(function(result) {
if(result){
jQuery('textarea#jform_addconditions__addconditions'+fieldKey+'__match_options').val(result);
}
else
{
jQuery('textarea#jform_addconditions__addconditions'+fieldKey+'__match_options').val('');
}
});
}
}

View File

@ -0,0 +1,189 @@
<?xml version="1.0" encoding="utf-8"?>
<form
addrulepath="/administrator/components/com_componentbuilder/models/rules"
addfieldpath="/administrator/components/com_componentbuilder/models/fields"
>
<fieldset name="details">
<!-- Default Fields. -->
<!-- Id Field. Type: Text (joomla) -->
<field
name="id"
type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"
description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"
readonly="true"
/>
<!-- Date Created Field. Type: Calendar (joomla) -->
<field
name="created"
type="calendar"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_DATE_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_DATE_DESC"
size="22"
format="%Y-%m-%d %H:%M:%S"
filter="user_utc"
/>
<!-- User Created Field. Type: User (joomla) -->
<field
name="created_by"
type="user"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_BY_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_BY_DESC"
/>
<!-- Published Field. Type: List (joomla) -->
<field name="published" type="list" label="JSTATUS"
description="JFIELD_PUBLISHED_DESC" class="chzn-color-state"
filter="intval" size="1" default="1" >
<option value="1">
JPUBLISHED</option>
<option value="0">
JUNPUBLISHED</option>
<option value="2">
JARCHIVED</option>
<option value="-2">
JTRASHED</option>
</field>
<!-- Date Modified Field. Type: Calendar (joomla) -->
<field name="modified" type="calendar" class="readonly"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_DATE_LABEL" description="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_DATE_DESC"
size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />
<!-- User Modified Field. Type: User (joomla) -->
<field name="modified_by" type="user"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_BY_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_BY_DESC"
class="readonly"
readonly="true"
filter="unset"
/>
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"
type="number"
class="inputbox validate-ordering"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ORDERING_LABEL"
description=""
default="0"
size="6"
required="false"
/>
<!-- Version Field. Type: Text (joomla) -->
<field
name="version"
type="text"
class="readonly"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_VERSION_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_VERSION_DESC"
size="6"
readonly="true"
filter="unset"
/>
<!-- Dynamic Fields. -->
<!-- Admin_view Field. Type: Adminviewsreadonly. (custom) -->
<field
type="adminviewsreadonly"
name="admin_view"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADMIN_VIEW_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADMIN_VIEW_DESCRIPTION"
class="list_class"
multiple="false"
required="true"
readonly="true"
button="false"
/>
<!-- Addrelations Field. Type: Subform. (joomla) -->
<field
type="subform"
name="addrelations"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADDRELATIONS_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADDRELATIONS_DESCRIPTION"
icon="list">
<form hidden="true" name="list_addrelations_modal" repeat="true">
<!-- Listfield Field. Type: Listfields. (custom) -->
<field
type="listfields"
name="listfield"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_LISTFIELD_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_LISTFIELD_DESCRIPTION"
class="fieldMedium"
multiple="false"
required="false"
button="false"
/>
<!-- Joinfields Field. Type: Joinfields. (custom) -->
<field
type="joinfields"
name="joinfields"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOINFIELDS_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOINFIELDS_DESCRIPTION"
class="fieldMedium"
multiple="true"
required="false"
button="false"
/>
<!-- Join_type Field. Type: List. (joomla) -->
<field
type="list"
name="join_type"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOIN_TYPE_LABEL"
class="list_class"
multiple="false"
required="false"
validate="int"
default="1">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CONCATENATE</option>
<option value="2">
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CUSTOM_CODE</option>
</field>
<!-- Set Field. Type: Text. (joomla) -->
<field
type="text"
name="set"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_SET_LABEL"
size="150"
maxlength="150"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_SET_DESCRIPTION"
class="text_area"
required="false"
filter="RAW"
hint="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_SET_HINT"
autocomplete="on"
/>
</form>
</field>
<!-- Note_on_relations Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_on_relations" label="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NOTE_ON_RELATIONS_LABEL" description="COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NOTE_ON_RELATIONS_DESCRIPTION" heading="h4" class="alert alert-info note_on_relations" />
</fieldset>
<!-- Access Control Fields. -->
<fieldset name="accesscontrol">
<!-- Asset Id Field. Type: Hidden (joomla) -->
<field
name="asset_id"
type="hidden"
filter="unset"
/>
<!-- Rules Field. Type: Rules (joomla) -->
<field
name="rules"
type="rules"
label="Permissions in relation to this admin_fields_relations"
translate_label="false"
filter="rules"
validate="rules"
class="inputbox"
component="com_componentbuilder"
section="admin_fields_relations"
/>
</fieldset>
</form>

View File

@ -1196,10 +1196,13 @@ jQuery(document).ready(function()
// now load the fields
getAjaxDisplay('admin_fields');
getAjaxDisplay('admin_fields_conditions');
getAjaxDisplay('admin_fields_relations');
// set button
addButtonID('admin_fields_conditions','create_edit_buttons', 1); // <-- second
// set button to create more fields
addButton('field','create_edit_buttons'); // <-- third
// set button
addButtonID('admin_fields_relations','create_edit_buttons', 1); // <-- forth
});
function checkAliasField() {

View File

@ -0,0 +1,25 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Form\FormRule;
use Joomla\Registry\Registry;
/**
* Form Rule (Int) class for the Joomla Platform.
*/
class JFormRuleInt extends FormRule
{
}

View File

@ -956,6 +956,32 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_admin_fields_conditions` (
KEY `idx_admin_view` (`admin_view`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__componentbuilder_admin_fields_relations` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
`addrelations` MEDIUMTEXT NOT NULL,
`admin_view` INT(11) NOT NULL DEFAULT 0,
`params` text NOT NULL DEFAULT '',
`published` TINYINT(3) NOT NULL DEFAULT 1,
`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`version` INT(10) unsigned NOT NULL DEFAULT 1,
`hits` INT(10) unsigned NOT NULL DEFAULT 0,
`access` INT(10) unsigned NOT NULL DEFAULT 0,
`ordering` INT(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `idx_access` (`access`),
KEY `idx_checkout` (`checked_out`),
KEY `idx_createdby` (`created_by`),
KEY `idx_modifiedby` (`modified_by`),
KEY `idx_state` (`published`),
KEY `idx_admin_view` (`admin_view`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__componentbuilder_component_admin_views` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
@ -1644,6 +1670,13 @@ INSERT INTO `#__componentbuilder_admin_fields` (`id`, `addfields`, `admin_view`,
INSERT INTO `#__componentbuilder_admin_fields_conditions` (`id`, `addconditions`, `admin_view`, `published`, `created`, `modified`, `version`, `hits`, `ordering`) VALUES
(111, '{\"addconditions0\":{\"target_field\":[\"1011\",\"100\",\"158\",\"196\",\"280\"],\"target_behavior\":\"1\",\"target_relation\":\"0\",\"match_field\":\"682\",\"match_behavior\":\"1\",\"match_options\":\"1|Yes\"}}', 109, 1, '2017-10-12 21:36:00', '0000-00-00 00:00:00', 2, '', '');
--
-- Dumping data for table `#__componentbuilder_admin_fields_relations`
--
INSERT INTO `#__componentbuilder_admin_fields_relations` (`id`, `addrelations`, `admin_view`, `published`, `created`, `modified`, `version`, `hits`, `ordering`) VALUES
(1, '{\"addrelations0\":{\"listfield\":\"201\",\"joinfields\":[\"279\"],\"join_type\":\"1\",\"set\":\" \"}}', 14, 1, '2018-05-22 01:20:34', '2018-05-22 01:37:07', 2, '', 1);
--
-- Dumping data for table `#__componentbuilder_component_admin_views`
--

View File

@ -17,6 +17,7 @@ DROP TABLE IF EXISTS `#__componentbuilder_server`;
DROP TABLE IF EXISTS `#__componentbuilder_help_document`;
DROP TABLE IF EXISTS `#__componentbuilder_admin_fields`;
DROP TABLE IF EXISTS `#__componentbuilder_admin_fields_conditions`;
DROP TABLE IF EXISTS `#__componentbuilder_admin_fields_relations`;
DROP TABLE IF EXISTS `#__componentbuilder_component_admin_views`;
DROP TABLE IF EXISTS `#__componentbuilder_component_site_views`;
DROP TABLE IF EXISTS `#__componentbuilder_component_custom_admin_views`;

View File

@ -0,0 +1,82 @@
CREATE TABLE IF NOT EXISTS `#__componentbuilder_field` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
`add_css_view` TINYINT(1) NOT NULL DEFAULT 0,
`add_css_views` TINYINT(1) NOT NULL DEFAULT 0,
`add_javascript_view_footer` TINYINT(1) NOT NULL DEFAULT 0,
`add_javascript_views_footer` TINYINT(1) NOT NULL DEFAULT 0,
`catid` INT(11) NOT NULL DEFAULT 0,
`css_view` TEXT NOT NULL,
`css_views` TEXT NOT NULL,
`datadefault` CHAR(64) NOT NULL DEFAULT '',
`datadefault_other` CHAR(64) NOT NULL DEFAULT '',
`datalenght` CHAR(64) NOT NULL DEFAULT '',
`datalenght_other` CHAR(64) NOT NULL DEFAULT '',
`datatype` CHAR(64) NOT NULL DEFAULT '',
`fieldtype` INT(11) NOT NULL DEFAULT 0,
`indexes` CHAR(64) NOT NULL DEFAULT '',
`javascript_view_footer` TEXT NOT NULL,
`javascript_views_footer` TEXT NOT NULL,
`name` VARCHAR(255) NOT NULL DEFAULT '',
`null_switch` CHAR(64) NOT NULL DEFAULT '',
`store` INT(11) NOT NULL DEFAULT 0,
`xml` TEXT NOT NULL,
`params` text NOT NULL DEFAULT '',
`published` TINYINT(3) NOT NULL DEFAULT 1,
`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`version` INT(10) unsigned NOT NULL DEFAULT 1,
`hits` INT(10) unsigned NOT NULL DEFAULT 0,
`access` INT(10) unsigned NOT NULL DEFAULT 0,
`ordering` INT(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `idx_access` (`access`),
KEY `idx_checkout` (`checked_out`),
KEY `idx_createdby` (`created_by`),
KEY `idx_modifiedby` (`modified_by`),
KEY `idx_state` (`published`),
KEY `idx_name` (`name`),
KEY `idx_fieldtype` (`fieldtype`),
KEY `idx_datatype` (`datatype`),
KEY `idx_indexes` (`indexes`),
KEY `idx_null_switch` (`null_switch`),
KEY `idx_catid` (`catid`),
KEY `idx_add_css_views` (`add_css_views`),
KEY `idx_add_css_view` (`add_css_view`),
KEY `idx_datalenght` (`datalenght`),
KEY `idx_add_javascript_views_footer` (`add_javascript_views_footer`),
KEY `idx_datadefault_other` (`datadefault_other`),
KEY `idx_datadefault` (`datadefault`),
KEY `idx_datalenght_other` (`datalenght_other`),
KEY `idx_add_javascript_view_footer` (`add_javascript_view_footer`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__componentbuilder_admin_fields_relations` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
`addrelations` MEDIUMTEXT NOT NULL,
`admin_view` INT(11) NOT NULL DEFAULT 0,
`params` text NOT NULL DEFAULT '',
`published` TINYINT(3) NOT NULL DEFAULT 1,
`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`version` INT(10) unsigned NOT NULL DEFAULT 1,
`hits` INT(10) unsigned NOT NULL DEFAULT 0,
`access` INT(10) unsigned NOT NULL DEFAULT 0,
`ordering` INT(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `idx_access` (`access`),
KEY `idx_checkout` (`checked_out`),
KEY `idx_createdby` (`created_by`),
KEY `idx_modifiedby` (`modified_by`),
KEY `idx_state` (`published`),
KEY `idx_admin_view` (`admin_view`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;

View File

@ -0,0 +1,324 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\Registry\Registry;
// import Joomla table library
jimport('joomla.database.table');
/**
* Admins_fields_relations Table class
*/
class ComponentbuilderTableAdmin_fields_relations extends JTable
{
/**
* Ensure the params and metadata in json encoded in the bind method
*
* @var array
* @since 3.3
*/
protected $_jsonEncode = array('params', 'metadata');
/**
* Constructor
*
* @param object Database connector object
*/
function __construct(&$db)
{
parent::__construct('#__componentbuilder_admin_fields_relations', 'id', $db);
// Adding History Options
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_componentbuilder.admin_fields_relations'));
}
public function bind($array, $ignore = '')
{
if (isset($array['params']) && is_array($array['params']))
{
$registry = new JRegistry;
$registry->loadArray($array['params']);
$array['params'] = (string) $registry;
}
if (isset($array['metadata']) && is_array($array['metadata']))
{
$registry = new JRegistry;
$registry->loadArray($array['metadata']);
$array['metadata'] = (string) $registry;
}
// Bind the rules.
if (isset($array['rules']) && is_array($array['rules']))
{
$rules = new JAccessRules($array['rules']);
$this->setRules($rules);
}
return parent::bind($array, $ignore);
}
/**
* Overload the store method for the Admin_fields_relations table.
*
* @param boolean Toggle whether null values should be updated.
* @return boolean True on success, false on failure.
* @since 1.6
*/
public function store($updateNulls = false)
{
$date = JFactory::getDate();
$user = JFactory::getUser();
if ($this->id)
{
// Existing item
$this->modified = $date->toSql();
$this->modified_by = $user->get('id');
}
else
{
// New admin_fields_relations. A admin_fields_relations created and created_by field can be set by the user,
// so we don't touch either of these if they are set.
if (!(int) $this->created)
{
$this->created = $date->toSql();
}
if (empty($this->created_by))
{
$this->created_by = $user->get('id');
}
}
if (isset($this->alias))
{
// Verify that the alias is unique
$table = JTable::getInstance('admin_fields_relations', 'ComponentbuilderTable');
if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0))
{
$this->setError(JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ERROR_UNIQUE_ALIAS'));
return false;
}
}
if (isset($this->url))
{
// Convert IDN urls to punycode
$this->url = JStringPunycode::urlToPunycode($this->url);
}
if (isset($this->website))
{
// Convert IDN urls to punycode
$this->website = JStringPunycode::urlToPunycode($this->website);
}
return parent::store($updateNulls);
}
/**
* Overloaded check method to ensure data integrity.
*
* @return boolean True on success.
*/
public function check()
{
if (isset($this->alias))
{
// Generate a valid alias
$this->generateAlias();
$table = JTable::getInstance('admin_fields_relations', 'componentbuilderTable');
while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0))
{
$this->alias = JString::increment($this->alias, 'dash');
}
}
/*
* Clean up keywords -- eliminate extra spaces between phrases
* and cr (\r) and lf (\n) characters from string.
* Only process if not empty.
*/
if (!empty($this->metakey))
{
// Array of characters to remove.
$bad_characters = array("\n", "\r", "\"", "<", ">");
// Remove bad characters.
$after_clean = JString::str_ireplace($bad_characters, "", $this->metakey);
// Create array using commas as delimiter.
$keys = explode(',', $after_clean);
$clean_keys = array();
foreach ($keys as $key)
{
// Ignore blank keywords.
if (trim($key))
{
$clean_keys[] = trim($key);
}
}
// Put array back together delimited by ", "
$this->metakey = implode(", ", $clean_keys);
}
// Clean up description -- eliminate quotes and <> brackets
if (!empty($this->metadesc))
{
// Only process if not empty
$bad_characters = array("\"", "<", ">");
$this->metadesc = JString::str_ireplace($bad_characters, "", $this->metadesc);
}
// If we don't have any access rules set at this point just use an empty JAccessRules class
if (!$this->getRules())
{
$rules = $this->getDefaultAssetValues('com_componentbuilder.admin_fields_relations.'.$this->id);
$this->setRules($rules);
}
// Set ordering
if ($this->published < 0)
{
// Set ordering to 0 if state is archived or trashed
$this->ordering = 0;
}
return true;
}
/**
* Gets the default asset values for a component.
*
* @param $string $component The component asset name to search for
*
* @return JAccessRules The JAccessRules object for the asset
*/
protected function getDefaultAssetValues($component, $try = true)
{
// Need to find the asset id by the name of the component.
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('id'))
->from($db->quoteName('#__assets'))
->where($db->quoteName('name') . ' = ' . $db->quote($component));
$db->setQuery($query);
$db->execute();
if ($db->loadRowList())
{
// asset alread set so use saved rules
$assetId = (int) $db->loadResult();
return JAccess::getAssetRules($assetId);
}
// try again
elseif ($try)
{
$try = explode('.',$component);
$result = $this->getDefaultAssetValues($try[0], false);
if ($result instanceof JAccessRules)
{
if (isset($try[1]))
{
$_result = (string) $result;
$_result = json_decode($_result);
foreach ($_result as $name => &$rule)
{
$v = explode('.', $name);
if ($try[1] !== $v[0])
{
// remove since it is not part of this view
unset($_result->$name);
}
else
{
// clear the value since we inherit
$rule = array();
}
}
// check if there are any view values remaining
if (count( (array) $_result))
{
$_result = json_encode($_result);
$_result = array($_result);
// Instantiate and return the JAccessRules object for the asset rules.
$rules = new JAccessRules;
$rules->mergeCollection($_result);
return $rules;
}
}
return $result;
}
}
return JAccess::getAssetRules(0);
}
/**
* Method to compute the default name of the asset.
* The default name is in the form 'table_name.id'
* where id is the value of the primary key of the table.
*
* @return string
* @since 2.5
*/
protected function _getAssetName()
{
$k = $this->_tbl_key;
return 'com_componentbuilder.admin_fields_relations.'.(int) $this->$k;
}
/**
* Method to return the title to use for the asset table.
*
* @return string
* @since 2.5
*/
protected function _getAssetTitle()
{
if (isset($this->title))
{
return $this->title;
}
return '';
}
/**
* Get the parent asset id for the record
*
* @return int
* @since 2.5
*/
protected function _getAssetParentId(JTable $table = NULL, $id = NULL)
{
$asset = JTable::getInstance('Asset');
$asset->loadByName('com_componentbuilder');
return $asset->id;
}
/**
* This view does not actually have an alias
*
* @return bool
*/
public function generateAlias()
{
return false;
}
}

View File

@ -0,0 +1,35 @@
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
Joomla.submitbutton = function(task)
{
if (task == ''){
return false;
} else {
var isValid=true;
var action = task.split('.');
if (action[1] != 'cancel' && action[1] != 'close'){
var forms = $$('form.form-validate');
for (var i=0;i<forms.length;i++){
if (!document.formvalidator.isValid(forms[i])){
isValid = false;
break;
}
}
}
if (isValid){
Joomla.submitform(task);
return true;
} else {
alert(Joomla.JText._('admin_fields_relations, some values are not acceptable.','Some values are unacceptable'));
return false;
}
}
}

View File

@ -0,0 +1,131 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = JComponentHelper::getParams('com_componentbuilder');
?>
<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_componentbuilder/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('#componentbuilder_loader').fadeIn('fast');
jQuery('#loading').hide();
});
</script>
<div id="componentbuilder_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&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('admin_fields_relations.relations_above', $this); ?>
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'admin_fields_relationsTab', array('active' => 'relations')); ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_fields_relationsTab', 'relations', JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_RELATIONS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('admin_fields_relations.relations_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php if ($this->canDo->get('admin_fields_relations.delete') || $this->canDo->get('admin_fields_relations.edit.created_by') || $this->canDo->get('admin_fields_relations.edit.state') || $this->canDo->get('admin_fields_relations.edit.created')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_fields_relationsTab', 'publishing', JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('admin_fields_relations.publishing', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('admin_fields_relations.publlshing', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_fields_relationsTab', 'permissions', JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
<div class="adminformlist">
<?php foreach ($this->form->getFieldset('accesscontrol') as $field): ?>
<div>
<?php echo $field->label; echo $field->input;?>
</div>
<div class="clearfix"></div>
<?php endforeach; ?>
</div>
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<div>
<input type="hidden" name="task" value="admin_fields_relations.edit" />
<?php echo JHtml::_('form.token'); ?>
</div>
</div>
</div>
</form>
</div>
<script type="text/javascript">
<?php $numberAddconditions = range(0, count( (array) $this->item->addconditions) + 3, 1);?>
// for the values already set
jQuery(document).ready(function(){
<?php foreach($numberAddconditions as $fieldNr): ?>
jQuery('#adminForm').on('change', '#jform_addconditions__addconditions<?php echo $fieldNr ?>__match_field',function (e) {
e.preventDefault();
getFieldSelectOptions(<?php echo $fieldNr ?>);
});
<?php endforeach; ?>
jQuery(document).on('subform-row-add', function(event, row){
var groupName = jQuery(row).data('group');
var fieldName = groupName.replace(/([0-9])/g, '');
var fieldNr = groupName.replace(/([A-z_])/g, '');
if ('addconditions' === fieldName) {
jQuery('#adminForm').on('change', '#jform_addconditions__addconditions'+fieldNr+'__match_field',function (e) {
e.preventDefault();
getFieldSelectOptions(fieldNr);
});
}
});
});
</script>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,190 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla view library
jimport('joomla.application.component.view');
/**
* Admin_fields_relations View class
*/
class ComponentbuilderViewAdmin_fields_relations extends JViewLegacy
{
/**
* display method of View
* @return void
*/
public function display($tpl = null)
{
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->script = $this->get('Script');
$this->state = $this->get('State');
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations',$this->item);
// get input
$jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
$this->referral = '';
if ($this->refid)
{
// return to the item that refered to this item
$this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
}
elseif($this->ref)
{
// return to the list view that refered to this item
$this->referral = '&ref='.(string)$this->ref;
}
// Set the toolbar
$this->addToolBar();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
}
/**
* Setting the toolbar
*/
protected function addToolBar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_EDIT'), 'pencil-2 article-add');
// Built the actions for new and existing records.
if ($this->refid || $this->ref)
{
if ($this->canDo->get('admin_fields_relations.create') && $isNew)
{
// We can create the record.
JToolBarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE');
}
elseif ($this->canDo->get('admin_fields_relations.edit'))
{
// We can save the record.
JToolBarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE');
}
if ($isNew)
{
// Do not creat but cancel.
JToolBarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CANCEL');
}
else
{
// We can close it.
JToolBarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CLOSE');
}
}
else
{
if ($isNew)
{
// For new records, check the create permission.
if ($this->canDo->get('admin_fields_relations.create'))
{
JToolBarHelper::apply('admin_fields_relations.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE');
JToolBarHelper::custom('admin_fields_relations.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
};
JToolBarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CANCEL');
}
else
{
if ($this->canDo->get('admin_fields_relations.edit'))
{
// We can save the new record
JToolBarHelper::apply('admin_fields_relations.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE');
// We can save this record, but check the create permission to see
// if we can return to make a new one.
if ($this->canDo->get('admin_fields_relations.create'))
{
JToolBarHelper::custom('admin_fields_relations.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
}
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('admin_fields_relations.version'));
if ($this->state->params->get('save_history', 1) && $this->canDo->get('admin_fields_relations.edit') && $canVersion)
{
JToolbarHelper::versions('com_componentbuilder.admin_fields_relations', $this->item->id);
}
if ($this->canDo->get('admin_fields_relations.create'))
{
JToolBarHelper::custom('admin_fields_relations.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
JToolBarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CLOSE');
}
}
JToolbarHelper::divider();
// set help url for this view if found
$help_url = ComponentbuilderHelper::getHelpUrl('admin_fields_relations');
if (ComponentbuilderHelper::checkString($help_url))
{
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
}
}
/**
* Escapes a value for output in a view script.
*
* @param mixed $var The output to escape.
*
* @return mixed The escaped value.
*/
public function escape($var)
{
if(strlen($var) > 30)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
}
/**
* Method to set up the document properties
*
* @return void
*/
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admin_fields_relations.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
// Add Ajax Token
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/admin_fields_relations/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
JText::script('view not acceptable. Error');
}
}

View File

@ -75,18 +75,18 @@ $componentParams = JComponentHelper::getParams('com_componentbuilder');
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_viewTab', 'fields_conditions', JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_FIELDS_CONDITIONS', true)); ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_viewTab', 'fields', JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_FIELDS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('admin_view.fields_conditions_left', $this); ?>
<?php echo JLayoutHelper::render('admin_view.fields_left', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('admin_view.fields_conditions_right', $this); ?>
<?php echo JLayoutHelper::render('admin_view.fields_right', $this); ?>
</div>
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('admin_view.fields_conditions_fullwidth', $this); ?>
<?php echo JLayoutHelper::render('admin_view.fields_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>

View File

@ -76,6 +76,9 @@ $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.
<?php if ($canDo->get('admin_view.edit') && $admin_field_id = ComponentbuilderHelper::getVar('admin_fields', $item->id, 'admin_view', 'id')): ?>
<a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=admins_fields&task=admin_fields.edit&id=<?php echo $admin_field_id; ?>&ref=admin_views" title="<?php echo JText::_('COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS'); ?>" ><span class="icon-list"></span></a>
<?php endif; ?>
<?php if ($canDo->get('admin_view.edit') && $admin_relation_id = ComponentbuilderHelper::getVar('admin_fields_relations', $item->id, 'admin_view', 'id')): ?>
<a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=admins_fields_relations&task=admin_fields_relations.edit&id=<?php echo $admin_relation_id; ?>&ref=admin_views" title="<?php echo JText::_('COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS_RELATIONS'); ?>" ><span class="icon-tree-2"></span></a>
<?php endif; ?>
<?php if ($canDo->get('admin_view.edit') && $admin_condition_id = ComponentbuilderHelper::getVar('admin_fields_conditions', $item->id, 'admin_view', 'id')): ?>
<a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=admins_fields_conditions&task=admin_fields_conditions.edit&id=<?php echo $admin_condition_id; ?>&ref=admin_views" title="<?php echo JText::_('COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS_CONDITIONS'); ?>" ><span class="icon-shuffle"></span></a>
<?php endif; ?>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,85 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// load tooltip behavior
JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', 'select');
if ($this->saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_componentbuilder&task=admins_fields_relations.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'admin_fields_relationsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<script type="text/javascript">
Joomla.orderTable = function()
{
table = document.getElementById("sortTable");
direction = document.getElementById("directionTable");
order = table.options[table.selectedIndex].value;
if (order != '<?php echo $this->listOrder; ?>')
{
dirn = 'asc';
}
else
{
dirn = direction.options[direction.selectedIndex].value;
}
Joomla.tableOrdering(order, dirn, '');
}
</script>
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=admins_fields_relations'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<?php if (empty($this->items)): ?>
<?php echo $this->loadTemplate('toolbar');?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<?php echo $this->loadTemplate('toolbar');?>
<table class="table table-striped" id="admin_fields_relationsList">
<thead><?php echo $this->loadTemplate('head');?></thead>
<tfoot><?php echo $this->loadTemplate('foot');?></tfoot>
<tbody><?php echo $this->loadTemplate('body');?></tbody>
</table>
<?php //Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
); ?>
<?php endif; ?>
<input type="hidden" name="filter_order" value="" />
<input type="hidden" name="filter_order_Dir" value="" />
<input type="hidden" name="boxchecked" value="0" />
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</form>

View File

@ -0,0 +1,18 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<p><?php echo JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_TIP'); ?></p>
<?php echo $this->batchDisplay; ?>

View File

@ -0,0 +1,23 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<!-- clear the batch values if cancel -->
<button class="btn" type="button" onclick="" data-dismiss="modal">
<?php echo JText::_('JCANCEL'); ?>
</button>
<!-- post the batch values if process -->
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('admin_fields_relations.batch');">
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
</button>

View File

@ -0,0 +1,94 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$edit = "index.php?option=com_componentbuilder&view=admins_fields_relations&task=admin_fields_relations.edit";
?>
<?php foreach ($this->items as $i => $item): ?>
<?php
$canCheckin = $this->user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
$userChkOut = JFactory::getUser($item->checked_out);
$canDo = ComponentbuilderHelper::getActions('admin_fields_relations',$item,'admins_fields_relations');
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="order nowrap center hidden-phone">
<?php if ($canDo->get('admin_fields_relations.edit.state')): ?>
<?php
if ($this->saveOrder)
{
$iconClass = ' inactive';
}
else
{
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
}
?>
<span class="sortable-handler<?php echo $iconClass; ?>">
<i class="icon-menu"></i>
</span>
<?php if ($this->saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5"
value="<?php echo $item->ordering; ?>" class="width-20 text-area-order " />
<?php endif; ?>
<?php else: ?>
&#8942;
<?php endif; ?>
</td>
<td class="nowrap center">
<?php if ($canDo->get('admin_fields_relations.edit')): ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
<?php else: ?>
&#9633;
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
<?php endif; ?>
<?php else: ?>
&#9633;
<?php endif; ?>
</td>
<td class="nowrap">
<?php if ($canDo->get('admin_fields_relations.edit')): ?>
<div class="name">
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $this->escape($item->admin_view_system_name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'admins_fields_relations.', $canCheckin); ?>
<?php endif; ?>
</div>
<?php else: ?>
<div class="name"><?php echo $this->escape($item->admin_view_system_name); ?></div>
<?php endif; ?>
</td>
<td class="center">
<?php if ($canDo->get('admin_fields_relations.edit.state')) : ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_fields_relations.', true, 'cb'); ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_fields_relations.', false, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_fields_relations.', true, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_fields_relations.', false, 'cb'); ?>
<?php endif; ?>
</td>
<td class="nowrap center hidden-phone">
<?php echo $item->id; ?>
</td>
</tr>
<?php endforeach; ?>

View File

@ -0,0 +1,18 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<tr>
<td colspan="5"><?php echo $this->pagination->getListFooter(); ?></td>
</tr>

View File

@ -0,0 +1,47 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<tr>
<?php if ($this->canEdit&& $this->canState): ?>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?>
</th>
<th width="20" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?>
</th>
<?php else: ?>
<th width="20" class="nowrap center hidden-phone">
&#9662;
</th>
<th width="20" class="nowrap center">
&#9632;
</th>
<?php endif; ?>
<th class="nowrap" >
<?php echo JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADMIN_VIEW_LABEL'); ?>
</th>
<?php if ($this->canState): ?>
<th width="10" class="nowrap center" >
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_STATUS', 'published', $this->listDirn, $this->listOrder); ?>
</th>
<?php else: ?>
<th width="10" class="nowrap center" >
<?php echo JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_STATUS'); ?>
</th>
<?php endif; ?>
<th width="5" class="nowrap center hidden-phone" >
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ID', 'id', $this->listDirn, $this->listOrder); ?>
</th>
</tr>

View File

@ -0,0 +1,45 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('Search');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('Search Admins_fields_relations'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
<?php echo JHtml::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
</select>
</div>
</div>
<div class="clearfix"> </div>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,227 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
* @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla view library
jimport('joomla.application.component.view');
/**
* Componentbuilder View class for the Admins_fields_relations
*/
class ComponentbuilderViewAdmins_fields_relations extends JViewLegacy
{
/**
* Admins_fields_relations view display method
* @return void
*/
function display($tpl = null)
{
if ($this->getLayout() !== 'modal')
{
// Include helper submenu
ComponentbuilderHelper::addSubmenu('admins_fields_relations');
}
// Assign data to the view
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->user = JFactory::getUser();
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations');
$this->canEdit = $this->canDo->get('admin_fields_relations.edit');
$this->canState = $this->canDo->get('admin_fields_relations.edit.state');
$this->canCreate = $this->canDo->get('admin_fields_relations.create');
$this->canDelete = $this->canDo->get('admin_fields_relations.delete');
$this->canBatch = $this->canDo->get('core.batch');
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')
{
$this->addToolbar();
$this->sidebar = JHtmlSidebar::render();
// load the batch html
if ($this->canCreate && $this->canEdit && $this->canState)
{
$this->batchDisplay = JHtmlBatch_::render();
}
}
// Check for errors.
if (count($errors = $this->get('Errors')))
{
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
}
/**
* Setting the toolbar
*/
protected function addToolBar()
{
JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS'), 'joomla');
JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=admins_fields_relations');
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
if ($this->canCreate)
{
JToolBarHelper::addNew('admin_fields_relations.add');
}
// Only load if there are items
if (ComponentbuilderHelper::checkArray($this->items))
{
if ($this->canEdit)
{
JToolBarHelper::editList('admin_fields_relations.edit');
}
if ($this->canState)
{
JToolBarHelper::publishList('admins_fields_relations.publish');
JToolBarHelper::unpublishList('admins_fields_relations.unpublish');
JToolBarHelper::archiveList('admins_fields_relations.archive');
if ($this->canDo->get('core.admin'))
{
JToolBarHelper::checkin('admins_fields_relations.checkin');
}
}
// Add a batch button
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
{
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
// set the batch button name
$title = JText::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button
$layout = new JLayoutFile('joomla.toolbar.batch');
// add the button to the page
$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
}
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
{
JToolbarHelper::deleteList('', 'admins_fields_relations.delete', 'JTOOLBAR_EMPTY_TRASH');
}
elseif ($this->canState && $this->canDelete)
{
JToolbarHelper::trash('admins_fields_relations.trash');
}
}
// set help url for this view if found
$help_url = ComponentbuilderHelper::getHelpUrl('admins_fields_relations');
if (ComponentbuilderHelper::checkString($help_url))
{
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
}
// add the options comp button
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{
JToolBarHelper::preferences('com_componentbuilder');
}
if ($this->canState)
{
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_PUBLISHED'),
'filter_published',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
);
// only load if batch allowed
if ($this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
}
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_ACCESS'),
'filter_access',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
);
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
);
}
}
/**
* Method to set up the document properties
*
* @return void
*/
protected function setDocument()
{
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admins_fields_relations.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
}
/**
* Escapes a value for output in a view script.
*
* @param mixed $var The output to escape.
*
* @return mixed The escaped value.
*/
public function escape($var)
{
if(strlen($var) > 50)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
}
/**
* Returns an array of fields the table can be sorted by
*
* @return array Array containing the field name to sort by as the key and display text as value
*/
protected function getSortFields()
{
return array(
'a.sorting' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
}

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name>
<creationDate>18th May, 2018</creationDate>
<creationDate>22nd May, 2018</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>
<copyright>Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>2.7.10</version>
<version>2.7.11</version>
<description><![CDATA[
<h1>Component Builder (v.2.7.10)</h1>
<h1>Component Builder (v.2.7.11)</h1>
<div style="clear: both;"></div>
<p>The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.

View File

@ -390,4 +390,21 @@
<maintainerurl>http://www.joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.7.11</version>
<infourl title="Component Builder!">http://www.joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">http://domain.com/demo.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://www.joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
</updates>

View File

@ -1850,6 +1850,92 @@ class com_componentbuilderInstallerScript
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// Where Admin_fields_relations alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.admin_fields_relations') );
$db->setQuery($query);
// Execute query to see if alias is found
$db->execute();
$admin_fields_relations_found = $db->getNumRows();
// Now check if there were any rows
if ($admin_fields_relations_found)
{
// Since there are load the needed admin_fields_relations type ids
$admin_fields_relations_ids = $db->loadColumn();
// Remove Admin_fields_relations from the content type table
$admin_fields_relations_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.admin_fields_relations') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($admin_fields_relations_condition);
$db->setQuery($query);
// Execute the query to remove Admin_fields_relations items
$admin_fields_relations_done = $db->execute();
if ($admin_fields_relations_done);
{
// If succesfully remove Admin_fields_relations add queued success message.
$app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields_relations) type alias was removed from the <b>#__content_type</b> table'));
}
// Remove Admin_fields_relations items from the contentitem tag map table
$admin_fields_relations_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.admin_fields_relations') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($admin_fields_relations_condition);
$db->setQuery($query);
// Execute the query to remove Admin_fields_relations items
$admin_fields_relations_done = $db->execute();
if ($admin_fields_relations_done);
{
// If succesfully remove Admin_fields_relations add queued success message.
$app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields_relations) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// Remove Admin_fields_relations items from the ucm content table
$admin_fields_relations_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_componentbuilder.admin_fields_relations') );
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($admin_fields_relations_condition);
$db->setQuery($query);
// Execute the query to remove Admin_fields_relations items
$admin_fields_relations_done = $db->execute();
if ($admin_fields_relations_done);
{
// If succesfully remove Admin_fields_relations add queued success message.
$app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields_relations) type alias was removed from the <b>#__ucm_content</b> table'));
}
// Make sure that all the Admin_fields_relations items are cleared from DB
foreach ($admin_fields_relations_ids as $admin_fields_relations_id)
{
// Remove Admin_fields_relations items from the ucm base table
$admin_fields_relations_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $admin_fields_relations_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($admin_fields_relations_condition);
$db->setQuery($query);
// Execute the query to remove Admin_fields_relations items
$db->execute();
// Remove Admin_fields_relations items from the ucm history table
$admin_fields_relations_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $admin_fields_relations_id);
// Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($admin_fields_relations_condition);
$db->setQuery($query);
// Execute the query to remove Admin_fields_relations items
$db->execute();
}
}
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
@ -3529,6 +3615,18 @@ class com_componentbuilderInstallerScript
// Set the object into the content types table.
$admin_fields_conditions_Inserted = $db->insertObject('#__content_types', $admin_fields_conditions);
// Create the admin_fields_relations content type object.
$admin_fields_relations = new stdClass();
$admin_fields_relations->type_title = 'Componentbuilder Admin_fields_relations';
$admin_fields_relations->type_alias = 'com_componentbuilder.admin_fields_relations';
$admin_fields_relations->table = '{"special": {"dbtable": "#__componentbuilder_admin_fields_relations","key": "id","type": "Admin_fields_relations","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
$admin_fields_relations->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}';
$admin_fields_relations->router = 'ComponentbuilderHelperRoute::getAdmin_fields_relationsRoute';
$admin_fields_relations->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_relations.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}';
// Set the object into the content types table.
$admin_fields_relations_Inserted = $db->insertObject('#__content_types', $admin_fields_relations);
// Create the component_admin_views content type object.
$component_admin_views = new stdClass();
$component_admin_views->type_title = 'Componentbuilder Component_admin_views';
@ -4308,6 +4406,35 @@ class com_componentbuilderInstallerScript
$admin_fields_conditions_Inserted = $db->insertObject('#__content_types', $admin_fields_conditions);
}
// Create the admin_fields_relations content type object.
$admin_fields_relations = new stdClass();
$admin_fields_relations->type_title = 'Componentbuilder Admin_fields_relations';
$admin_fields_relations->type_alias = 'com_componentbuilder.admin_fields_relations';
$admin_fields_relations->table = '{"special": {"dbtable": "#__componentbuilder_admin_fields_relations","key": "id","type": "Admin_fields_relations","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
$admin_fields_relations->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}';
$admin_fields_relations->router = 'ComponentbuilderHelperRoute::getAdmin_fields_relationsRoute';
$admin_fields_relations->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_relations.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}';
// Check if admin_fields_relations type is already in content_type DB.
$admin_fields_relations_id = null;
$query = $db->getQuery(true);
$query->select($db->quoteName(array('type_id')));
$query->from($db->quoteName('#__content_types'));
$query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($admin_fields_relations->type_alias));
$db->setQuery($query);
$db->execute();
// Set the object into the content types table.
if ($db->getNumRows())
{
$admin_fields_relations->type_id = $db->loadResult();
$admin_fields_relations_Updated = $db->updateObject('#__content_types', $admin_fields_relations, 'type_id');
}
else
{
$admin_fields_relations_Inserted = $db->insertObject('#__content_types', $admin_fields_relations);
}
// Create the component_admin_views content type object.
$component_admin_views = new stdClass();
$component_admin_views->type_title = 'Componentbuilder Component_admin_views';
@ -4864,7 +4991,7 @@ class com_componentbuilderInstallerScript
echo '<a target="_blank" href="http://www.joomlacomponentbuilder.com" title="Component Builder">
<img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/>
</a>
<h3>Upgrade to Version 2.7.10 Was Successful! Let us know if anything is not working as expected.</h3>';
<h3>Upgrade to Version 2.7.11 Was Successful! Let us know if anything is not working as expected.</h3>';
}
}

View File

@ -3085,15 +3085,15 @@ abstract class ComponentbuilderHelper
}
/**
* Move File to Server
*
* @param string $localPath The local path to the file
* @param string $fileName The the actual file name
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return bool true on success
* Move File to Server
*
* @param string $localPath The local path to the file
* @param string $fileName The the actual file name
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return bool true on success
**/
public static function moveToServer($localPath, $fileName, $serverID, $protocol = null, $permission = 'core.export')
{
@ -3128,23 +3128,23 @@ abstract class ComponentbuilderHelper
}
/**
* the SFTP objects
* the SFTP objects
**/
protected static $sftp = array();
/**
* the FTP objects
* the FTP objects
**/
protected static $ftp = array();
/**
* get the server object
*
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return object on success server object
* get the server object
*
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return object on success server object
**/
public static function getServer($serverID, $protocol = null, $permission = 'core.export')
{
@ -3167,12 +3167,12 @@ abstract class ComponentbuilderHelper
}
/**
* get the sftp object
*
* @param int $serverID The server local id to use
* @param string $permission The permission validation area
*
* @return object on success with sftp power
* get the sftp object
*
* @param int $serverID The server local id to use
* @param string $permission The permission validation area
*
* @return object on success with sftp power
**/
public static function getSftp($serverID, $permission = 'core.export')
{
@ -3326,12 +3326,12 @@ abstract class ComponentbuilderHelper
}
/**
* get the JClientFtp object
*
* @param int $serverID The server local id to use
* @param string $permission The permission validation area
*
* @return object on success with ftp power
* get the JClientFtp object
*
* @param int $serverID The server local id to use
* @param string $permission The permission validation area
*
* @return object on success with ftp power
**/
public static function getFtp($serverID, $permission)
{
@ -3417,13 +3417,13 @@ abstract class ComponentbuilderHelper
}
/**
* get the server details
*
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return object on success with server details
* get the server details
*
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return object on success with server details
**/
public static function getServerDetails($serverID, $protocol = 2, $permission = 'core.export')
{