Files
Component-Builder/admin/tmpl/snippets/default_body.php
T
Robot bb9b155f00 Release of v6.2.0
Add a dedicated Extrusion view for importing existing Joomla components and PHP libraries into JCB. Unify component-folder and SQL-dump extrusion through a single engine. Add PHP class harvesting into JCB Powers, including automatic class matching and dependency linking. Add import pairing with Create, Update, and Skip controls, dry runs, and per-record change previews. Improve SQL schema reconstruction to preserve column types, defaults, keys, indexes, and table configuration. Improve field imports to preserve XML settings, options, GUID relationships, and storage formats without double-encoding subform data. Reuse shared field definitions across views and preserve existing customizations during repeated imports. Detect unchanged records and avoid unnecessary writes during repeated Extrusion runs. Restore language strings and compiler placeholders in imported code, field XML, view markup, and SQL. Improve Site View and Custom Admin View discovery, template recovery, and Dynamic Get relationships. Fix Power namespace reconstruction to correctly preserve custom aliases and apply NamespacePrefix and ComponentNamespace placeholders. Fix duplicate Compile button submissions that could start concurrent builds and cause intermittent folder creation or deletion errors. #1318. Add Repair Existing Power Namespaces with automatic matching and namespace-only updates that preserve class code, GUIDs, and settings. Improve Power discovery performance with component-scoped matching, dependency indexes, and reusable parsing. Protect Extrusion imports against ambiguous matches, conflicting compiler paths, and stale change previews. Improve Extrusion error reporting and recovery after interrupted import requests. Improve the Extrusion interface with folder pickers, grouped filtering, bulk selection, responsive layouts, and a dedicated dashboard icon. Fix Extrusion self-compilation by preserving runtime marker literals and align import authorization with native view-access permissions. Replace execution of imported SQL with static parsing and validate source paths without executing imported PHP. Complete JSON:API generation for API-enabled Admin Views, including CRUD operations, relationships, filtering, pagination, and field-level permissions. Include generated API files in component manifests so they are installed with compiled components. Add API_ROUTES and API_ROUTES_METHOD placeholders for linked webservices plugins, supporting routes by record ID, GUID, and unique fields. Add read-only API resources for supported Site Views and Custom Admin Views using their existing Dynamic Gets. Fix API record creation when IDs and GUIDs are omitted, generate record keys on the server, and preserve existing GUIDs during updates. Fix API item and list model selection, including resource names with irregular plural forms. Fix API read permissions to support read-only users and return native JSON:API access-denied responses instead of administrator redirects. Fix cross-site scripting risks in generated views through corrected text sanitization, Joomla-native HTML escaping, and field escape settings. Fix edit-own permission bypasses by checking stored record ownership and applying field permissions to the record being saved. Strengthen file upload and deletion permissions with ownership and component permission checks. Fix subform updates that could overwrite or reassign records belonging to another parent. Block unsafe URL schemes in Markdown links and images. Use cryptographically secure randomness for generated passwords and upload names, and sanitize uploaded filenames. Fix generated IIS library access configuration and add missing index.html files to compiled folders. Complete extraction of generated-code logic from the legacy Fields, Interpretation, and Infusion helpers into dedicated compiler services. Consolidate shared compiler logic across Joomla versions while retaining version-specific generation where required. Refactor the Power parser to use PHP's native lexer for reliable handling of modern syntax, multiline declarations, and complex types. Fix JCB Search to prevent matching records from being skipped when processing successive batches. Fix compilation of database-aware Joomla 4 modules caused by a missing utility class import. Fix CLI repository resolution to report unresolved repository GUIDs without triggering a fatal error. Fix PHP warnings when the compiler's placeholder report contains no results. Fix toolbar generation when descriptions are missing or null. Preserve original source line endings when compiler processing leaves the content unchanged.
2026-10-08 15:36:26 +00:00

134 lines
5.0 KiB
PHP

<?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\Componentbuilder\Utilities\Permitted\Actions;
use Joomla\CMS\User\UserFactoryInterface;
// No direct access to this file
defined('_JEXEC') or die;
$edit = "index.php?option=com_componentbuilder&view=snippets&task=snippet.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 = Factory::getContainer()->
get(UserFactoryInterface::class)->
loadUserById((int) ($item->checked_out ?? 0));
$canDo = Actions::get('snippet', $item, 'snippets');
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="order nowrap center hidden-phone">
<?php if (!$this->isModal && $canDo->get('core.edit.state')): ?>
<?php
$iconClass = '';
if (!$this->saveOrder)
{
$iconClass = ' inactive tip-top" hasTooltip" title="' . Html::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 (!$this->isModal && $canDo->get('core.edit')): ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo Html::_('grid.id', $i, $item->id); ?>
<?php else: ?>
&#9633;
<?php endif; ?>
<?php else: ?>
<?php echo Html::_('grid.id', $i, $item->id); ?>
<?php endif; ?>
<?php else: ?>
&#9633;
<?php endif; ?>
</td>
<td class="nowrap">
<div class="name">
<?php if (!$this->isModal && $canDo->get('core.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $this->sanitize($item->name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo Html::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'snippets.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<?php if (!$this->isModal): ?>
<?php echo $this->sanitize($item->name); ?>
<?php else: ?>
<?php
$link = "{$edit}&id={$item->id}";
$dataId = $item->{$this->getModalTitleKey()} ?? 0;
$itemHtml = '<a href="' . $this->sanitize($link, false) . '">' . $this->sanitize($item->name, false) . '</a>';
$attribs = 'data-content-select data-content-type="com_componentbuilder.snippet"'
. ' data-id="' . $this->sanitize($dataId, false) . '"'
. ' data-title="' . $this->sanitize($item->name, false) . '"'
. ' data-uri="' . $this->sanitize($link, false) . '"'
. ' data-html="' . $this->sanitize($itemHtml, false) . '"';
?>
<a class="select-link" href="javascript:void(0)" <?php echo $attribs; ?>>
<?php echo $this->sanitize($item->name); ?>
</a>
<?php endif; ?>
<?php endif; ?>
</div>
</td>
<td class="hidden-phone">
<?php echo $this->sanitize($item->url); ?>
</td>
<td class="hidden-phone">
<?php echo $this->sanitize($item->type_name); ?>
</td>
<td class="hidden-phone">
<?php echo $this->sanitize($item->heading); ?>
</td>
<td class="nowrap">
<div class="name">
<?php if (!$this->isModal && $this->user->authorise('library.edit', 'com_componentbuilder.library.' . (int) ($item->library_id ?? 0))): ?>
<a href="index.php?option=com_componentbuilder&view=libraries&task=library.edit&id=<?php echo $item->library_id; ?>&return=<?php echo $this->return_here; ?>"><?php echo $this->sanitize($item->library_name); ?></a>
<?php else: ?>
<?php echo $this->sanitize($item->library_name); ?>
<?php endif; ?>
</div>
</td>
<td class="center">
<?php if (!$this->isModal && $canDo->get('core.edit.state')) : ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'snippets.', true, 'cb'); ?>
<?php else: ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'snippets.', false, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'snippets.', true, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'snippets.', false, 'cb'); ?>
<?php endif; ?>
</td>
<td class="nowrap center hidden-phone">
<?php echo $item->id; ?>
</td>
</tr>
<?php endforeach; ?>