Release of v5.1.1-beta5
Completely refactors the SQL tweaks and SQL dump classes.
This commit is contained in:
@@ -7,11 +7,11 @@ This is a professional-grade [Joomla 5.x](https://extensions.joomla.org/extensio
|
||||
|
||||
> 🎥 [Original... Quick Hello World Demo](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45), yes JCB has been around for over a decade.
|
||||
|
||||
JCB generates native Joomla components, plugins, and modules for Joomla 3.x, 4.x, and 5.x — and is already prepared for Joomla 6. Every compiled project is tailored for the specific version without needing backward compatibility plugins. With integrated version-aware compiling, smart boilerplating, and Git-powered project syncing, JCB is much more than a code generator—it's a **full-stack development pipeline for Joomla extensions**.
|
||||
JCB generates native Joomla components, plugins, and modules for Joomla 3.x, 4.x, and 5.x - and is already prepared for Joomla 6. Every compiled project is tailored for the specific version without needing backward compatibility plugins. With integrated version-aware compiling, smart boilerplating, and Git-powered project syncing, JCB is much more than a code generator-it's a **full-stack development pipeline for Joomla extensions**.
|
||||
|
||||
You can install this component easily. The latest release (**5.1.1-beta4**) is available on [Releases](https://git.vdm.dev/joomla/pkg-component-builder/releases) and updated frequently with full source access.
|
||||
You can install this component easily. The latest release (**5.1.1-beta5**) is available on [Releases](https://git.vdm.dev/joomla/pkg-component-builder/releases) and updated frequently with full source access.
|
||||
|
||||
Upgrades are seamless through Joomla’s built-in extension update mechanism.
|
||||
Upgrades are seamless through Joomla's built-in extension update mechanism.
|
||||
|
||||
---
|
||||
|
||||
@@ -19,21 +19,21 @@ Upgrades are seamless through Joomla’s built-in extension update mechanism.
|
||||
|
||||
Here are just some of the key powers JCB brings:
|
||||
|
||||
* 🔁 **Bi-Directional IDE Sync** – Fetch custom logic from compiled projects and reintegrate on rebuild.
|
||||
* 🧱 **Build Joomla Components, Plugins, and Modules** – Fully native and independently compiled.
|
||||
* 🧠 **Superpowers (PHP Class Builder)** – Create namespaced abstract, interface, and trait-based PHP classes visually.
|
||||
* 🔌 **Joomla Powers** – Intelligent Joomla class referencing via dynamic placeholders (JPKs) that adapt to Joomla versions.
|
||||
* 🗃️ **Smart Boilerplating** – Start fast with 6+ curated demo blueprints for instant use or customization.
|
||||
* 🔂 **Round-Trip Development** – Add, update, and persist changes across compiled code using insert/replace tags.
|
||||
* 🔐 **Field Types Engine** – Blueprint reusable Joomla-native fields with constraints, security, DB structure, and logic.
|
||||
* 🧬 **Admin Views, Custom Admin Views & Site Views** – Fine-grained design for structured or dynamic backend/front-end UIs.
|
||||
* 🧮 **Dynamic GET Builder** – Advanced visual query designer for cross-table, filter-rich, deeply joined SQL fetches.
|
||||
* 💡 **Snippets, Layouts, Templates & Libraries** – Shareable GUI-linked modules for reusable HTML/CSS/JS integration.
|
||||
* 🧰 **Custom Code System** – Write logic once and reuse anywhere; full support for HTML & PHP placeholders and tracking.
|
||||
* 🛠️ **Multi-Version Compilation** – Compile version-specific code for J3, J4, J5 without compatibility bloat.
|
||||
* 📦 **Package Management** – Export/import blueprints, version control builds, sync with Git, and distribute clean packages.
|
||||
* 🖥️ **CLI Integration** – Build commands natively via terminal using Joomla's CLI runner.
|
||||
* 🌐 **Update Server Support** – Integrate custom update mechanisms for extensions post-deployment.
|
||||
* 🔁 **Bi-Directional IDE Sync** - Fetch custom logic from compiled projects and reintegrate on rebuild.
|
||||
* 🧱 **Build Joomla Components, Plugins, and Modules** - Fully native and independently compiled.
|
||||
* 🧠 **Superpowers (PHP Class Builder)** - Create namespaced abstract, interface, and trait-based PHP classes visually.
|
||||
* 🔌 **Joomla Powers** - Intelligent Joomla class referencing via dynamic placeholders (JPKs) that adapt to Joomla versions.
|
||||
* 🗃️ **Smart Boilerplating** - Start fast with 6+ curated demo blueprints for instant use or customization.
|
||||
* 🔂 **Round-Trip Development** - Add, update, and persist changes across compiled code using insert/replace tags.
|
||||
* 🔐 **Field Types Engine** - Blueprint reusable Joomla-native fields with constraints, security, DB structure, and logic.
|
||||
* 🧬 **Admin Views, Custom Admin Views & Site Views** - Fine-grained design for structured or dynamic backend/front-end UIs.
|
||||
* 🧮 **Dynamic GET Builder** - Advanced visual query designer for cross-table, filter-rich, deeply joined SQL fetches.
|
||||
* 💡 **Snippets, Layouts, Templates & Libraries** - Shareable GUI-linked modules for reusable HTML/CSS/JS integration.
|
||||
* 🧰 **Custom Code System** - Write logic once and reuse anywhere; full support for HTML & PHP placeholders and tracking.
|
||||
* 🛠️ **Multi-Version Compilation** - Compile version-specific code for J3, J4, J5 without compatibility bloat.
|
||||
* 📦 **Package Management** - Export/import blueprints, version control builds, sync with Git, and distribute clean packages.
|
||||
* 🖥️ **CLI Integration** - Build commands natively via terminal using Joomla's CLI runner.
|
||||
* 🌐 **Update Server Support** - Integrate custom update mechanisms for extensions post-deployment.
|
||||
|
||||
<details>
|
||||
<summary>📚 View 100+ Additional Advanced Features</summary>
|
||||
@@ -200,7 +200,7 @@ Here are just some of the key powers JCB brings:
|
||||
## 📦 Get Started Now
|
||||
|
||||
* 🔽 **Download**: [Stable Releases](https://git.vdm.dev/joomla/pkg-component-builder/releases) · [Nightly J5](https://git.vdm.dev/joomla/pkg-component-builder/archive/5.x.zip) · [Nightly J4](https://git.vdm.dev/joomla/pkg-component-builder/archive/4.x.zip)
|
||||
* 📥 **Install**: Use Joomla’s extension manager
|
||||
* 📥 **Install**: Use Joomla's extension manager
|
||||
* 🎓 **Learn**: [Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE) · [How to Install Demo Blueprints](https://vdm.bz/how-to-install-jcb-packages)
|
||||
|
||||
---
|
||||
@@ -220,7 +220,7 @@ Here are just some of the key powers JCB brings:
|
||||
|
||||
## 🌱 Why It's Free
|
||||
|
||||
JCB is developed by developers for developers. Its purpose is to democratize high-performance Joomla development by empowering everyone — from solo builders to large teams — to work with clean, scalable, maintainable, and versionable code. This isn’t a template generator — it’s a full-scale **extension engineering platform**.
|
||||
JCB is developed by developers for developers. Its purpose is to democratize high-performance Joomla development by empowering everyone — from solo builders to large teams — to work with clean, scalable, maintainable, and versionable code. This isn't a template generator — it's a full-scale **extension engineering platform**.
|
||||
|
||||
---
|
||||
|
||||
@@ -229,9 +229,9 @@ JCB is developed by developers for developers. Its purpose is to democratize hig
|
||||
* **Company:** [Vast Development Method](https://dev.vdm.io)
|
||||
* **Author:** [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
||||
* **Component:** [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||
* **Created:** 30th April, 2015 · **Last Build:** 25th June, 2025 · **Version:** 5.1.1-beta4
|
||||
* **Created:** 30th April, 2015 · **Last Build:** 25th June, 2025 · **Version:** 5.1.1-beta5
|
||||
* **License:** GNU General Public License version 2 or later; see LICENSE.txt · **Copyright:** Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* **Lines:** 1093361 · **Fields:** 2096 · **Files:** 7498 · **Folders:** 728
|
||||
* **Lines:** 1092899 · **Fields:** 2096 · **Files:** 7506 · **Folders:** 728
|
||||
|
||||
> Generated with [JCB](https://www.joomlacomponentbuilder.com) — The Smartest Way to Build Joomla Extensions.
|
||||
|
||||
|
@@ -4759,7 +4759,6 @@ COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_HINT="Value/Example Here"
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_LABEL="Value/Example"
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_MESSAGE="Error! Please add value/example here."
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_EXPERT_MODE_CUSTOM="Expert Mode - Custom"
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_FIELDS="Fields"
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPES_CATEGORIES="Fieldtypes Categories"
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_FIFTY="50"
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_FLOAT="FLOAT"
|
||||
|
@@ -1,190 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use Joomla\CMS\User\UserFactoryInterface;
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// set the defaults
|
||||
$items = $displayData->vxifields;
|
||||
$user = Factory::getApplication()->getIdentity();
|
||||
$id = $displayData->item->id;
|
||||
// set the edit URL
|
||||
$edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit";
|
||||
// set a return value
|
||||
$return = ($id) ? "index.php?option=com_componentbuilder&view=fieldtype&layout=edit&id=" . $id : "";
|
||||
// check for a return value
|
||||
$jinput = Factory::getApplication()->input;
|
||||
if ($_return = $jinput->get('return', null, 'base64'))
|
||||
{
|
||||
$return .= "&return=" . $_return;
|
||||
}
|
||||
// check if return value was set
|
||||
if (StringHelper::check($return))
|
||||
{
|
||||
// set the referral values
|
||||
$ref = ($id) ? "&ref=fieldtype&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return));
|
||||
}
|
||||
else
|
||||
{
|
||||
$ref = ($id) ? "&ref=fieldtype&refid=" . $id : "";
|
||||
}
|
||||
// set the create new URL
|
||||
$new = "index.php?option=com_componentbuilder&view=fields&task=field.add" . $ref;
|
||||
// set the create new and close URL
|
||||
$close_new = "index.php?option=com_componentbuilder&view=fields&task=field.add";
|
||||
// load the action object
|
||||
$can = ComponentbuilderHelper::getActions('field');
|
||||
|
||||
?>
|
||||
<div class="form-vertical">
|
||||
<?php if ($can->get('field.create')): ?>
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-small btn-success" href="<?php echo $new; ?>"><span class="icon-new icon-white"></span> <?php echo Text::_('COM_COMPONENTBUILDER_NEW'); ?></a>
|
||||
<a class="btn btn-small" onclick="Joomla.submitbutton('fieldtype.cancel');" href="<?php echo $close_new; ?>"><span class="icon-new"></span> <?php echo Text::_('COM_COMPONENTBUILDER_CLOSE_NEW'); ?></a>
|
||||
</div><br /><br />
|
||||
<?php endif; ?>
|
||||
<?php if (ArrayHelper::check($items)): ?>
|
||||
<table class="footable table data fields" data-show-toggle="true" data-toggle-column="first" data-sorting="true" data-paging="true" data-paging-size="20" data-filtering="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-type="html" data-sort-use="text">
|
||||
<?php echo Text::_('COM_COMPONENTBUILDER_FIELD_NAME_LABEL'); ?>
|
||||
</th>
|
||||
<th data-breakpoints="xs sm" data-type="html" data-sort-use="text">
|
||||
<?php echo Text::_('COM_COMPONENTBUILDER_FIELD_FIELDTYPE_LABEL'); ?>
|
||||
</th>
|
||||
<th data-breakpoints="xs sm" data-type="html" data-sort-use="text">
|
||||
<?php echo Text::_('COM_COMPONENTBUILDER_FIELD_DATATYPE_LABEL'); ?>
|
||||
</th>
|
||||
<th data-breakpoints="xs sm md" data-type="html" data-sort-use="text">
|
||||
<?php echo Text::_('COM_COMPONENTBUILDER_FIELD_INDEXES_LABEL'); ?>
|
||||
</th>
|
||||
<th data-breakpoints="xs sm md" data-type="html" data-sort-use="text">
|
||||
<?php echo Text::_('COM_COMPONENTBUILDER_FIELD_NULL_SWITCH_LABEL'); ?>
|
||||
</th>
|
||||
<th data-breakpoints="xs sm md" data-type="html" data-sort-use="text">
|
||||
<?php echo Text::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL'); ?>
|
||||
</th>
|
||||
<th data-breakpoints="all" data-type="html" data-sort-use="text">
|
||||
<?php echo Text::_('COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES'); ?>
|
||||
</th>
|
||||
<th width="10" data-breakpoints="xs sm md">
|
||||
<?php echo Text::_('COM_COMPONENTBUILDER_FIELD_STATUS'); ?>
|
||||
</th>
|
||||
<th width="5" data-type="number" data-breakpoints="xs sm md">
|
||||
<?php echo Text::_('COM_COMPONENTBUILDER_FIELD_ID'); ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($items as $i => $item): ?>
|
||||
<?php
|
||||
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || $item->checked_out == 0;
|
||||
$userChkOut = Factory::getContainer()->
|
||||
get(UserFactoryInterface::class)->
|
||||
loadUserById($item->checked_out ?? 0);
|
||||
$canDo = ComponentbuilderHelper::getActions('field',$item,'fields');
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php if (!$displayData->isModal && $canDo->get('field.edit')): ?>
|
||||
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?><?php echo $ref; ?>"><?php echo $displayData->escape($item->name); ?></a>
|
||||
<?php if ($item->checked_out): ?>
|
||||
<?php echo Html::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'fields.', $canCheckin); ?>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<?php if (!$displayData->isModal): ?>
|
||||
<?php echo $displayData->escape($item->name); ?>
|
||||
<?php else: ?>
|
||||
<?php
|
||||
$link = "{$edit}&id={$item->id}";
|
||||
$dataId = $item->{$displayData->getModalTitleKey()} ?? 0;
|
||||
$itemHtml = '<a href="' . $displayData->escape($link, false) . '">' . $displayData->escape($item->name, false) . '</a>';
|
||||
$attribs = 'data-content-select data-content-type="com_componentbuilder.field"'
|
||||
. ' data-id="' . $dataId . '"'
|
||||
. ' data-title="' . $displayData->escape($item->name, false) . '"'
|
||||
. ' data-uri="' . $displayData->escape($link, false) . '"'
|
||||
. ' data-html="' . $displayData->escape($itemHtml, false) . '"';
|
||||
?>
|
||||
<a class="select-link" href="javascript:void(0)" <?php echo $attribs; ?>>
|
||||
<?php echo $displayData->escape($item->name); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $displayData->escape($item->fieldtype_name); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo Text::_($item->datatype); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo Text::_($item->indexes); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo Text::_($item->null_switch); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo Text::_($item->store); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if (!$displayData->isModal && $user->authorise('core.edit', 'com_componentbuilder.field.category.' . (int)$item->catid)): ?>
|
||||
<a href="index.php?option=com_categories&task=category.edit&id=<?php echo (int)$item->catid; ?>&extension=com_componentbuilder.field"><?php echo $displayData->escape($item->category_title); ?></a>
|
||||
<?php else: ?>
|
||||
<?php echo $displayData->escape($item->category_title); ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php if ($item->published == 1): ?>
|
||||
<td class="center" data-sort-value="1">
|
||||
<span class="status-metro status-published" title="<?php echo Text::_('COM_COMPONENTBUILDER_PUBLISHED'); ?>">
|
||||
<?php echo Text::_('COM_COMPONENTBUILDER_PUBLISHED'); ?>
|
||||
</span>
|
||||
</td>
|
||||
<?php elseif ($item->published == 0): ?>
|
||||
<td class="center" data-sort-value="2">
|
||||
<span class="status-metro status-inactive" title="<?php echo Text::_('COM_COMPONENTBUILDER_INACTIVE'); ?>">
|
||||
<?php echo Text::_('COM_COMPONENTBUILDER_INACTIVE'); ?>
|
||||
</span>
|
||||
</td>
|
||||
<?php elseif ($item->published == 2): ?>
|
||||
<td class="center" data-sort-value="3">
|
||||
<span class="status-metro status-archived" title="<?php echo Text::_('COM_COMPONENTBUILDER_ARCHIVED'); ?>">
|
||||
<?php echo Text::_('COM_COMPONENTBUILDER_ARCHIVED'); ?>
|
||||
</span>
|
||||
</td>
|
||||
<?php elseif ($item->published == -2): ?>
|
||||
<td class="center" data-sort-value="4">
|
||||
<span class="status-metro status-trashed" title="<?php echo Text::_('COM_COMPONENTBUILDER_TRASHED'); ?>">
|
||||
<?php echo Text::_('COM_COMPONENTBUILDER_TRASHED'); ?>
|
||||
</span>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="nowrap center hidden-phone">
|
||||
<?php echo $item->id; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<div class="alert alert-no-items">
|
||||
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
File diff suppressed because one or more lines are too long
@@ -33,7 +33,6 @@ use VDM\Joomla\Utilities\SessionHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper;
|
||||
use VDM\Joomla\Utilities\ObjectHelper;
|
||||
use VDM\Joomla\Utilities\GuidHelper;
|
||||
use VDM\Joomla\Componentbuilder\Utilities\FilterHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
|
||||
use VDM\Joomla\Utilities\GetHelper;
|
||||
|
||||
@@ -289,253 +288,10 @@ class FieldtypeModel extends AdminModel
|
||||
$this->db->updateObject('#__componentbuilder_fieldtype', $objectUpdate, 'id');
|
||||
}
|
||||
}
|
||||
$this->fieldtypevvvv = $item->guid;
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get list data.
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getVxifields()
|
||||
{
|
||||
// Get the user object.
|
||||
$user = Factory::getApplication()->getIdentity();
|
||||
// Create a new query object.
|
||||
$db = $this->getDatabase();
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select some fields
|
||||
$query->select('a.*');
|
||||
$query->select($db->quoteName('c.title','category_title'));
|
||||
|
||||
// From the componentbuilder_field table
|
||||
$query->from($db->quoteName('#__componentbuilder_field', 'a'));
|
||||
$query->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON (' . $db->quoteName('a.catid') . ' = ' . $db->quoteName('c.id') . ')');
|
||||
|
||||
// Filtering "extension"
|
||||
$filter_extension = $this->state->get("filter.extension");
|
||||
$field_guids = [];
|
||||
$get_ids = true;
|
||||
if ($get_ids && $filter_extension !== null && !empty($filter_extension))
|
||||
{
|
||||
// column name, and id
|
||||
$type_extension = explode('__', $filter_extension);
|
||||
if (($guids = FilterHelper::linked((string) $type_extension[1], (string) $type_extension[0])) !== null)
|
||||
{
|
||||
$field_guids = $guids;
|
||||
}
|
||||
else
|
||||
{
|
||||
// there is none
|
||||
$query->where($db->quoteName('a.id') . ' = ' . 0);
|
||||
$get_ids = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Filtering "admin_view"
|
||||
$filter_admin_view = $this->state->get("filter.admin_view");
|
||||
if ($get_ids && $filter_admin_view !== null && !empty($filter_admin_view))
|
||||
{
|
||||
if (($guids = FilterHelper::linked((string) $filter_admin_view, 'admin_view')) !== null)
|
||||
{
|
||||
// view will return less fields, so we ignore the component
|
||||
$field_guids = $guids;
|
||||
}
|
||||
else
|
||||
{
|
||||
// there is none
|
||||
$query->where($db->quoteName('a.id') . ' = ' . 0);
|
||||
$get_ids = false;
|
||||
}
|
||||
}
|
||||
// now check if we have GUIDs
|
||||
if ($get_ids && UtilitiesArrayHelper::check($field_guids))
|
||||
{
|
||||
$query->where($db->quoteName('a.guid') . ' IN ("' . implode('","', $field_guids) . '")');
|
||||
}
|
||||
|
||||
// From the componentbuilder_fieldtype table.
|
||||
$query->select($db->quoteName(['g.name','g.id'],['fieldtype_name','fieldtype_id']));
|
||||
$query->join('LEFT', $db->quoteName('#__componentbuilder_fieldtype', 'g') . ' ON (' . $db->quoteName('a.fieldtype') . ' = ' . $db->quoteName('g.guid') . ')');
|
||||
|
||||
// Filter by fieldtypevvvv global.
|
||||
$fieldtypevvvv = $this->fieldtypevvvv;
|
||||
if (is_numeric($fieldtypevvvv ))
|
||||
{
|
||||
$query->where('a.fieldtype = ' . (int) $fieldtypevvvv );
|
||||
}
|
||||
elseif (is_string($fieldtypevvvv))
|
||||
{
|
||||
$query->where('a.fieldtype = ' . $db->quote($fieldtypevvvv));
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.fieldtype = -5');
|
||||
}
|
||||
|
||||
// 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.
|
||||
$_access = $this->getState('filter.access');
|
||||
if ($_access && is_numeric($_access))
|
||||
{
|
||||
$query->where('a.access = ' . (int) $_access);
|
||||
}
|
||||
elseif (UtilitiesArrayHelper::check($_access))
|
||||
{
|
||||
// Secure the array for the query
|
||||
$_access = ArrayHelper::toInteger($_access);
|
||||
// Filter by the Access Array.
|
||||
$query->where('a.access IN (' . implode(',', $_access) . ')');
|
||||
}
|
||||
// Implement View Level Access
|
||||
if (!$user->authorise('core.options', 'com_componentbuilder'))
|
||||
{
|
||||
$groups = implode(',', $user->getAuthorisedViewLevels());
|
||||
$query->where('a.access IN (' . $groups . ')');
|
||||
}
|
||||
|
||||
// Order the results by ordering
|
||||
$query->order('a.published ASC');
|
||||
$query->order('a.ordering ASC');
|
||||
|
||||
// Load the items
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// Set values to display correctly.
|
||||
if (UtilitiesArrayHelper::check($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
if (!isset($user) || !ObjectHelper::check($user))
|
||||
{
|
||||
$user = $this->getCurrentUser();
|
||||
}
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
// Remove items the user can't access.
|
||||
$access = ($user->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && $user->authorise('field.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// set selection value to a translatable value
|
||||
if (UtilitiesArrayHelper::check($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
// convert datatype
|
||||
$item->datatype = $this->selectionTranslationVxifields($item->datatype, 'datatype');
|
||||
// convert indexes
|
||||
$item->indexes = $this->selectionTranslationVxifields($item->indexes, 'indexes');
|
||||
// convert null_switch
|
||||
$item->null_switch = $this->selectionTranslationVxifields($item->null_switch, 'null_switch');
|
||||
// convert store
|
||||
$item->store = $this->selectionTranslationVxifields($item->store, 'store');
|
||||
}
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to convert selection values to translatable string.
|
||||
*
|
||||
* @return string The translatable string.
|
||||
*/
|
||||
public function selectionTranslationVxifields($value,$name)
|
||||
{
|
||||
// Array of datatype language strings
|
||||
if ($name === 'datatype')
|
||||
{
|
||||
$datatypeArray = array(
|
||||
0 => 'COM_COMPONENTBUILDER_FIELD_SELECT_AN_OPTION',
|
||||
'CHAR' => 'COM_COMPONENTBUILDER_FIELD_CHAR',
|
||||
'VARCHAR' => 'COM_COMPONENTBUILDER_FIELD_VARCHAR',
|
||||
'TEXT' => 'COM_COMPONENTBUILDER_FIELD_TEXT',
|
||||
'MEDIUMTEXT' => 'COM_COMPONENTBUILDER_FIELD_MEDIUMTEXT',
|
||||
'LONGTEXT' => 'COM_COMPONENTBUILDER_FIELD_LONGTEXT',
|
||||
'BLOB' => 'COM_COMPONENTBUILDER_FIELD_BLOB',
|
||||
'TINYBLOB' => 'COM_COMPONENTBUILDER_FIELD_TINYBLOB',
|
||||
'MEDIUMBLOB' => 'COM_COMPONENTBUILDER_FIELD_MEDIUMBLOB',
|
||||
'LONGBLOB' => 'COM_COMPONENTBUILDER_FIELD_LONGBLOB',
|
||||
'DATETIME' => 'COM_COMPONENTBUILDER_FIELD_DATETIME',
|
||||
'DATE' => 'COM_COMPONENTBUILDER_FIELD_DATE',
|
||||
'TIME' => 'COM_COMPONENTBUILDER_FIELD_TIME',
|
||||
'INT' => 'COM_COMPONENTBUILDER_FIELD_INT',
|
||||
'TINYINT' => 'COM_COMPONENTBUILDER_FIELD_TINYINT',
|
||||
'BIGINT' => 'COM_COMPONENTBUILDER_FIELD_BIGINT',
|
||||
'FLOAT' => 'COM_COMPONENTBUILDER_FIELD_FLOAT',
|
||||
'DECIMAL' => 'COM_COMPONENTBUILDER_FIELD_DECIMAL',
|
||||
'DOUBLE' => 'COM_COMPONENTBUILDER_FIELD_DOUBLE'
|
||||
);
|
||||
// Now check if value is found in this array
|
||||
if (isset($datatypeArray[$value]) && UtilitiesStringHelper::check($datatypeArray[$value]))
|
||||
{
|
||||
return $datatypeArray[$value];
|
||||
}
|
||||
}
|
||||
// Array of indexes language strings
|
||||
if ($name === 'indexes')
|
||||
{
|
||||
$indexesArray = array(
|
||||
1 => 'COM_COMPONENTBUILDER_FIELD_UNIQUE_KEY',
|
||||
2 => 'COM_COMPONENTBUILDER_FIELD_KEY',
|
||||
0 => 'COM_COMPONENTBUILDER_FIELD_NONE'
|
||||
);
|
||||
// Now check if value is found in this array
|
||||
if (isset($indexesArray[$value]) && UtilitiesStringHelper::check($indexesArray[$value]))
|
||||
{
|
||||
return $indexesArray[$value];
|
||||
}
|
||||
}
|
||||
// Array of null_switch language strings
|
||||
if ($name === 'null_switch')
|
||||
{
|
||||
$null_switchArray = array(
|
||||
'NULL' => 'COM_COMPONENTBUILDER_FIELD_NULL',
|
||||
'NOT NULL' => 'COM_COMPONENTBUILDER_FIELD_NOT_NULL'
|
||||
);
|
||||
// Now check if value is found in this array
|
||||
if (isset($null_switchArray[$value]) && UtilitiesStringHelper::check($null_switchArray[$value]))
|
||||
{
|
||||
return $null_switchArray[$value];
|
||||
}
|
||||
}
|
||||
// Array of store language strings
|
||||
if ($name === 'store')
|
||||
{
|
||||
$storeArray = array(
|
||||
0 => 'COM_COMPONENTBUILDER_FIELD_DEFAULT',
|
||||
1 => 'COM_COMPONENTBUILDER_FIELD_JSON',
|
||||
2 => 'COM_COMPONENTBUILDER_FIELD_BASE64',
|
||||
3 => 'COM_COMPONENTBUILDER_FIELD_BASIC_ENCRYPTION_LOCALDBKEY',
|
||||
5 => 'COM_COMPONENTBUILDER_FIELD_MEDIUM_ENCRYPTION_LOCALFILEKEY',
|
||||
6 => 'COM_COMPONENTBUILDER_FIELD_EXPERT_MODE_CUSTOM'
|
||||
);
|
||||
// Now check if value is found in this array
|
||||
if (isset($storeArray[$value]) && UtilitiesStringHelper::check($storeArray[$value]))
|
||||
{
|
||||
return $storeArray[$value];
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the record form.
|
||||
*
|
||||
|
@@ -181,9 +181,6 @@ class HtmlView extends BaseHtmlView
|
||||
$this->referral .= '&return=' . (string) $return;
|
||||
}
|
||||
|
||||
// Get Linked view data
|
||||
$this->vxifields = $this->get('Vxifields');
|
||||
|
||||
// Set the toolbar
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
@@ -421,16 +418,6 @@ class HtmlView extends BaseHtmlView
|
||||
}
|
||||
// Add Ajax Token
|
||||
$this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';");
|
||||
|
||||
// Add the CSS for Footable
|
||||
Html::_('stylesheet', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', ['version' => 'auto']);
|
||||
Html::_('stylesheet', 'media/com_componentbuilder/footable-v3/css/footable.standalone.min.css', ['version' => 'auto']);
|
||||
// Add the JavaScript for Footable (adding all functions)
|
||||
Html::_('script', 'media/com_componentbuilder/footable-v3/js/footable.min.js', ['version' => 'auto']);
|
||||
|
||||
$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery('.footable').footable();});});";
|
||||
$this->getDocument()->addScriptDeclaration($footable);
|
||||
|
||||
// add scripts
|
||||
foreach ($this->scripts as $script)
|
||||
{
|
||||
|
@@ -79,18 +79,6 @@ $tmpl = $tmpl ? '&tmpl=' . $tmpl : '';
|
||||
</div>
|
||||
<?php echo Html::_('uitab.endTab'); ?>
|
||||
|
||||
<?php if ($this->canDo->get('field.access')) : ?>
|
||||
<?php echo Html::_('uitab.addTab', 'fieldtypeTab', 'fields', Text::_('COM_COMPONENTBUILDER_FIELDTYPE_FIELDS', true)); ?>
|
||||
<div class="row">
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php echo LayoutHelper::render('fieldtype.fields_fullwidth', $this); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo Html::_('uitab.endTab'); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
|
||||
<?php $this->tab_name = 'fieldtypeTab'; ?>
|
||||
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
|
||||
|
Reference in New Issue
Block a user