Adapted the custom buttons and layout in the components, admins and libraries views. Fixed a bug in the JCB package import that missed custom code imports when code is changed inside the custom code.

This commit is contained in:
2018-08-19 22:15:43 +02:00
parent 103457eef7
commit 2a6be54317
37 changed files with 1414 additions and 764 deletions

View File

@ -61,26 +61,47 @@ $edit = "index.php?option=com_componentbuilder&view=libraries&task=library.edit"
<?php endif; ?>
</td>
<td class="nowrap">
<div class="name">
<?php if ($canDo->get('library.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $this->escape($item->name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'libraries.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<?php echo $this->escape($item->name); ?>
<div>
<?php if ($canDo->get('library.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $this->escape($item->name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'libraries.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<?php echo $this->escape($item->name); ?>
<?php endif; ?>
</div>
<?php // setup the return path
if (!isset($returnpath))
{
$returnpath = urlencode(base64_encode((string) JUri::getInstance()));
}
// setup the buttons
if (!isset($_buttons) || !ComponentbuilderHelper::checkArray($_buttons))
{
$_buttons = array(
array(
'view' => 'library_config',
'views' => 'libraries_config',
'title' => JText::_('COM_COMPONENTBUILDER_THE_LIBRARY_CONFIG_FIELDS'),
'icon' => 'options'),
array(
'view' => 'library_files_folders_urls',
'views' => 'libraries_files_folders_urls',
'title' => JText::_('COM_COMPONENTBUILDER_THE_LIBRARY_FILES_FOLDERS_URLS'),
'icon' => 'briefcase')
);
}
?>
<div class="btn-group" style="margin: 5px 0 0 0;">
<?php foreach ($_buttons as $_button): ?>
<?php if ($canDo->get($_button['view'].'.edit') && ($id = ComponentbuilderHelper::getVar($_button['view'], $item->id, 'library', 'id')) !== false): ?>
<a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=<?php echo $_button['views'] ?>&task=<?php echo $_button['view'] ?>.edit&id=<?php echo $id; ?>&return=<?php echo $returnpath; ?>" title="<?php echo $_button['title']; ?>" ><span class="icon-<?php echo $_button['icon']; ?>"></span></a>
<?php elseif ($canDo->get($_button['view'].'.create')): ?>
<a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=<?php echo $_button['views'] ?>&task=<?php echo $_button['view'] ?>.edit&ref=library&refid=<?php echo $item->id; ?>&return=<?php echo $returnpath; ?>" title="<?php echo $_button['title']; ?>" ><span class="icon-<?php echo $_button['icon']; ?>"></span></a>
<?php endif; ?>
<?php endforeach; ?>
</div>
<div class="btn-group" style="margin: 5px 0 0 0;">
<?php if ($canDo->get('library_config.edit') && $library_config_id = ComponentbuilderHelper::getVar('library_config', $item->id, 'library', 'id')): ?>
<a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=libraries_config&task=library_config.edit&id=<?php echo $library_config_id; ?>&ref=libraries" title="<?php echo JText::_('COM_COMPONENTBUILDER_THE_LIBRARY_CONFIG_FIELDS'); ?>" ><span class="icon-options"></span></a>
<?php endif; ?>
<?php if ($canDo->get('library_files_folders_urls.edit') && $library_files_folders_urls_id = ComponentbuilderHelper::getVar('library_files_folders_urls', $item->id, 'library', 'id')): ?>
<a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=libraries_files_folders_urls&task=library_files_folders_urls.edit&id=<?php echo $library_files_folders_urls_id; ?>&ref=libraries" title="<?php echo JText::_('COM_COMPONENTBUILDER_THE_LIBRARY_FILES_FOLDERS_URLS'); ?>" ><span class="icon-briefcase"></span></a>
<?php endif; ?>
</div>
</td>
<td class="hidden-phone">
<?php echo $this->escape($item->description); ?>