Futher improved the redirect option to use return and stack the return path to take the user back to the original area from where they clicked away.

This commit is contained in:
Llewellyn van der Merwe 2018-08-18 14:09:17 +02:00
parent 70e198abf3
commit 103457eef7
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
37 changed files with 455 additions and 70 deletions

View File

@ -125,11 +125,11 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 14th August, 2018 + *Last Build*: 18th August, 2018
+ *Version*: 2.8.6 + *Version*: 2.8.6
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **186762** + *Line count*: **187148**
+ *Field count*: **1061** + *Field count*: **1061**
+ *File count*: **1240** + *File count*: **1240**
+ *Folder count*: **197** + *Folder count*: **197**

View File

@ -125,11 +125,11 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 14th August, 2018 + *Last Build*: 18th August, 2018
+ *Version*: 2.8.6 + *Version*: 2.8.6
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **186762** + *Line count*: **187148**
+ *Field count*: **1061** + *Field count*: **1061**
+ *File count*: **1240** + *File count*: **1240**
+ *Folder count*: **197** + *Folder count*: **197**

View File

@ -1868,7 +1868,7 @@ class Get
} }
} }
// add_php // add_php
$addArrayP = array('php_getitem', 'php_before_save', 'php_save', 'php_getform', 'php_postsavehook', 'php_getitems', 'php_getitems_after_all', 'php_getlistquery', 'php_allowedit', 'php_before_delete', 'php_after_delete', 'php_before_publish', 'php_after_publish', 'php_batchcopy', 'php_batchmove', 'php_document'); $addArrayP = array('php_getitem', 'php_before_save', 'php_save', 'php_getform', 'php_postsavehook', 'php_getitems', 'php_getitems_after_all', 'php_getlistquery', 'php_allowadd', 'php_allowedit', 'php_before_delete', 'php_after_delete', 'php_before_publish', 'php_after_publish', 'php_batchcopy', 'php_batchmove', 'php_document');
foreach ($addArrayP as $scripter) foreach ($addArrayP as $scripter)
{ {
if (isset($view->{'add_' . $scripter}) && $view->{'add_' . $scripter} == 1) if (isset($view->{'add_' . $scripter}) && $view->{'add_' . $scripter} == 1)

View File

@ -2927,7 +2927,8 @@ class Fields extends Structure
$addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " get the view name & id"; $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " get the view name & id";
$addButton[] = $this->_t(3) . "\$values = \$jinput->getArray(array("; $addButton[] = $this->_t(3) . "\$values = \$jinput->getArray(array(";
$addButton[] = $this->_t(4) . "'id' => 'int',"; $addButton[] = $this->_t(4) . "'id' => 'int',";
$addButton[] = $this->_t(4) . "'view' => 'word'"; $addButton[] = $this->_t(4) . "'view' => 'word',";
$addButton[] = $this->_t(4) . "'return' => 'base64'";
$addButton[] = $this->_t(3) . "));"; $addButton[] = $this->_t(3) . "));";
$addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " check if new item"; $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " check if new item";
$addButton[] = $this->_t(3) . "\$ref = '';"; $addButton[] = $this->_t(3) . "\$ref = '';";
@ -2939,6 +2940,12 @@ class Fields extends Structure
$addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " only load referal if not new item."; $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " only load referal if not new item.";
$addButton[] = $this->_t(4) . "\$ref = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; $addButton[] = $this->_t(4) . "\$ref = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];";
$addButton[] = $this->_t(4) . "\$refJ = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; $addButton[] = $this->_t(4) . "\$refJ = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];";
$addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " get the return value.";
$addButton[] = $this->_t(4) . "\$_uri = (string) JUri::getInstance();";
$addButton[] = $this->_t(4) . "\$_return = urlencode(base64_encode(\$_uri));";
$addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " load return value.";
$addButton[] = $this->_t(4) . "\$ref .= '&return=' . \$_return;";
$addButton[] = $this->_t(4) . "\$refJ .= '&return=' . \$_return;";
$addButton[] = $this->_t(3) . "}"; $addButton[] = $this->_t(3) . "}";
} }
else else

View File

@ -7740,20 +7740,33 @@ class Interpretation extends Fields
// LAYOUTITEMSTABLE <<<DYNAMIC>>> // LAYOUTITEMSTABLE <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single . '_' . $layoutCodeName][$this->hhh . 'LAYOUTITEMSTABLE' . $this->hhh] = $head . $body; $this->fileContentDynamic[$viewName_single . '_' . $layoutCodeName][$this->hhh . 'LAYOUTITEMSTABLE' . $this->hhh] = $head . $body;
// LAYOUTITEMSHEADER <<<DYNAMIC>>> // LAYOUTITEMSHEADER <<<DYNAMIC>>>
$headerscript = '$edit = "index.php?option=com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '&view=' . $list . '&task=' . $single . '.edit";'; $headerscript .= '//' . $this->setLine(__LINE__) . ' set the edit URL';
$headerscript .= PHP_EOL . '$edit = "index.php?option=com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '&view=' . $list . '&task=' . $single . '.edit";';
$headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) . ' set a return value';
$headerscript .= PHP_EOL . '$return = ($id) ? "index.php?option=com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '&view=' . $viewName_single . '&layout=edit&id=" . $id : "";';
$headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) . ' check for a return value';
$headerscript .= PHP_EOL . '$jinput = JFactory::getApplication()->input;';
$headerscript .= PHP_EOL . "if (\$_return = \$jinput->get('return', null, 'base64'))";
$headerscript .= PHP_EOL . '{';
$headerscript .= PHP_EOL . $this->_t(1) . '$return .= "&return=" . $_return;';
$headerscript .= PHP_EOL . '}';
$headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) . ' set the referral values';
$headerscript .= PHP_EOL . '$ref = ($id) ? "&ref=' . $viewName_single . '&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "";';
if ($addNewButon > 0) if ($addNewButon > 0)
{ {
// add the link for new // add the link for new
if ($addNewButon == 1 || $addNewButon == 2) if ($addNewButon == 1 || $addNewButon == 2)
{ {
$headerscript .= PHP_EOL . '$ref = ($id) ? "&ref=' . $viewName_single . '&refid=".$id : "";'; $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) . ' set the create new URL';
$headerscript .= PHP_EOL . '$new = "index.php?option=com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '&view=' . $single . '&layout=edit".$ref;'; $headerscript .= PHP_EOL . '$new = "index.php?option=com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '&view=' . $single . '&layout=edit".$ref;';
} }
// and the link for close and new // and the link for close and new
if ($addNewButon == 2 || $addNewButon == 3) if ($addNewButon == 2 || $addNewButon == 3)
{ {
$headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) . ' set the create new and close URL';
$headerscript .= PHP_EOL . '$close_new = "index.php?option=com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '&view=' . $single . '&layout=edit";'; $headerscript .= PHP_EOL . '$close_new = "index.php?option=com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '&view=' . $single . '&layout=edit";';
} }
$headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) . ' load the action object';
$headerscript .= PHP_EOL . '$can = ' . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::getActions(' . "'" . $single . "'" . ');'; $headerscript .= PHP_EOL . '$can = ' . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::getActions(' . "'" . $single . "'" . ');';
} }
$this->fileContentDynamic[$viewName_single . '_' . $layoutCodeName][$this->hhh . 'LAYOUTITEMSHEADER' . $this->hhh] = $headerscript; $this->fileContentDynamic[$viewName_single . '_' . $layoutCodeName][$this->hhh . 'LAYOUTITEMSHEADER' . $this->hhh] = $headerscript;
@ -7906,7 +7919,7 @@ class Interpretation extends Fields
foreach ($this->listBuilder[$viewName_list] as $item) foreach ($this->listBuilder[$viewName_list] as $item)
{ {
// set the ref // set the ref
$ref = '&ref=' . $refview . '&refid=<?php echo $id; ?>'; $ref = '<?php echo $ref; ?>';
// set some defaults // set some defaults
$customAdminViewButtons = ''; $customAdminViewButtons = '';
// set the item row // set the item row

View File

@ -3546,6 +3546,108 @@ abstract class ComponentbuilderHelper
return false; return false;
} }
/**
* Get the edit button
*
* @param int $item The item to edit
* @param string $view The type of item to edit
* @param string $views The list view controller name
* @param string $ref The return path
* @param string $headsup The message to show on click of button
*
* @return string On success the full html edit button
*
*/
public static function getEditButton(&$item, $view, $views, $ref = '', $component = 'com_componentbuilder', $headsup = 'COM_COMPONENTBUILDER_ALL_UNSAVED_WORK_ON_THIS_PAGE_WILL_BE_LOST_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE')
{
// get URL
$url = self::getEditURL($item, $view, $views, $ref, $component);
// check if we found any
if (self::checkString($url))
{
// check that we have the ID
if (self::checkObject($item) && isset($item->id))
{
// check if the checked_out is available
if (isset($item->checked_out))
{
$checked_out = (int) $item->checked_out;
}
}
elseif (self::checkArray($item) && isset($item['id']))
{
// check if the checked_out is available
if (isset($item['checked_out']))
{
$checked_out = (int) $item['checked_out'];
}
}
// set the link title
$title = self::safeString(JText::_('COM_COMPONENTBUILDER_EDIT') . ' ' . $view, 'W');
// check that there is a check message
if (self::checkString($headsup))
{
$href = 'onclick="UIkit.modal.confirm(\''.JText::_($headsup).'\', function(){ window.location.href = \'' . $url . '\' })" href="javascript:void(0)"';
}
else
{
$href = 'href="' . $url . '"';
}
// check if it is checked out
if (isset($checked_out) && $checked_out > 0)
{
// is this user the one who checked it out
if ($checked_out == JFactory::getUser()->id)
{
return ' <a ' . $href . ' class="uk-icon-lock" title="' . $title . '"></a>';
}
return ' <a href="#" disabled class="uk-icon-lock" title="' . JText::sprintf('COM_COMPONENTBUILDER__HAS_BEEN_CHECKED_OUT_BY_S', self::safeString($view, 'W'), JFactory::getUser($checked_out)->name) . '"></a>';
}
// return normal edit link
return ' <a ' . $href . ' class="uk-icon-pencil" title="' . $title . '"></a>';
}
return '';
}
/**
* Get the edit URL
*
* @param int $item The item to edit
* @param string $view The type of item to edit
* @param string $ref The return path
*
* @return string On success the edit url
*
*/
public static function getEditURL(&$item, $view, $views, $ref = '', $component = 'com_componentbuilder')
{
// check that we have the ID
if (self::checkObject($item) && isset($item->id))
{
$id = (int) $item->id;
}
elseif (self::checkArray($item) && isset($item['id']))
{
$id = (int) $item['id'];
}
elseif (is_numeric($item))
{
$id = (int) $item;
}
// check ID
if (isset($id) && $id > 0)
{
// can edit
if (JFactory::getUser()->authorise($view . '.edit', $component . '.' . $view . '.' . (int) $id))
{
// set the edit link
return JRoute::_("index.php?option=" . $component . "&view=" . $views . "&task=" . $view . ".edit&id=" . $id . $ref);
}
}
return false;
}
/** /**
* the Crypt objects * the Crypt objects
**/ **/

View File

@ -6757,6 +6757,7 @@ COM_COMPONENTBUILDER_YOU_SHOULD_ONLY_CONTINUE_THIS_IMPORT_IF_YOU_HAVE_BACKUP_YOU
COM_COMPONENTBUILDER_YOU_WILL_NEED_TO_KNOW_HOW_S_WORKS_BASIC_YOU_WILL_ALSO_NEED_A_S_ACCOUNT_AND_KNOW_HOW_TO_MAKE_A_PULL_REQUEST_ON_GITHUB="you will need to know how %s works (basic). You will also need a %s account and know how to make a pull request on github." COM_COMPONENTBUILDER_YOU_WILL_NEED_TO_KNOW_HOW_S_WORKS_BASIC_YOU_WILL_ALSO_NEED_A_S_ACCOUNT_AND_KNOW_HOW_TO_MAKE_A_PULL_REQUEST_ON_GITHUB="you will need to know how %s works (basic). You will also need a %s account and know how to make a pull request on github."
COM_COMPONENTBUILDER_ZIPPED_FILE_LOCATION="Zipped File Location" COM_COMPONENTBUILDER_ZIPPED_FILE_LOCATION="Zipped File Location"
COM_COMPONENTBUILDER__ADD_YOUR_PHP_SCRIPT_HERE="// Add your php script here" COM_COMPONENTBUILDER__ADD_YOUR_PHP_SCRIPT_HERE="// Add your php script here"
COM_COMPONENTBUILDER__HAS_BEEN_CHECKED_OUT_BY_S="% has been checked out by %s"
COM_COMPONENTBUILDER__SELECT_COMPONENT_="- Select Component -" COM_COMPONENTBUILDER__SELECT_COMPONENT_="- Select Component -"
COM_COMPONENTBUILDER__SELECT_PACKAGE_="- Select Package -" COM_COMPONENTBUILDER__SELECT_PACKAGE_="- Select Package -"
COM_COMPONENTBUILDER__SINCE_YOU_DONT_HAVE_PERMISSION_TO_CREATE_S=", since you don't have permission to create %s!" COM_COMPONENTBUILDER__SINCE_YOU_DONT_HAVE_PERMISSION_TO_CREATE_S=", since you don't have permission to create %s!"

View File

@ -16,15 +16,32 @@ defined('_JEXEC') or die('Restricted access');
$items = $displayData->waffields; $items = $displayData->waffields;
$user = JFactory::getUser(); $user = JFactory::getUser();
$id = $displayData->item->id; $id = $displayData->item->id;
// set the edit URL
$edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit";
$ref = ($id) ? "&ref=fieldtype&refid=".$id : ""; // set a return value
$return = ($id) ? "index.php?option=com_componentbuilder&view=fieldtype&layout=edit&id=" . $id : "";
// check for a return value
$jinput = JFactory::getApplication()->input;
if ($_return = $jinput->get('return', null, 'base64'))
{
$return .= "&return=" . $_return;
}
// set the referral values
$ref = ($id) ? "&ref=fieldtype&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "";
// set the create new URL
$new = "index.php?option=com_componentbuilder&view=field&layout=edit".$ref; $new = "index.php?option=com_componentbuilder&view=field&layout=edit".$ref;
// set the create new and close URL
$close_new = "index.php?option=com_componentbuilder&view=field&layout=edit";
// load the action object
$can = ComponentbuilderHelper::getActions('field'); $can = ComponentbuilderHelper::getActions('field');
?> ?>
<div class="form-vertical"> <div class="form-vertical">
<?php if ($can->get('field.create')): ?> <?php if ($can->get('field.create')): ?>
<a class="btn btn-small btn-success" href="<?php echo $new; ?>"><span class="icon-new icon-white"></span> <?php echo JText::_('COM_COMPONENTBUILDER_NEW'); ?></a><br /><br /> <div class="btn-group">
<a class="btn btn-small btn-success" href="<?php echo $new; ?>"><span class="icon-new icon-white"></span> <?php echo JText::_('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 JText::_('COM_COMPONENTBUILDER_CLOSE_NEW'); ?></a>
</div><br /><br />
<?php endif; ?> <?php endif; ?>
<?php if (ComponentbuilderHelper::checkArray($items)): ?> <?php if (ComponentbuilderHelper::checkArray($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"> <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">
@ -69,7 +86,7 @@ $can = ComponentbuilderHelper::getActions('field');
<tr> <tr>
<td> <td>
<?php if ($canDo->get('field.edit')): ?> <?php if ($canDo->get('field.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>&ref=fieldtype&refid=<?php echo $id; ?>"><?php echo $displayData->escape($item->name); ?></a> <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 if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'fields.', $canCheckin); ?> <?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'fields.', $canCheckin); ?>
<?php endif; ?> <?php endif; ?>

View File

@ -16,7 +16,18 @@ defined('_JEXEC') or die('Restricted access');
$items = $displayData->waplinked_components; $items = $displayData->waplinked_components;
$user = JFactory::getUser(); $user = JFactory::getUser();
$id = $displayData->item->id; $id = $displayData->item->id;
// set the edit URL
$edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit"; $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit";
// set a return value
$return = ($id) ? "index.php?option=com_componentbuilder&view=server&layout=edit&id=" . $id : "";
// check for a return value
$jinput = JFactory::getApplication()->input;
if ($_return = $jinput->get('return', null, 'base64'))
{
$return .= "&return=" . $_return;
}
// set the referral values
$ref = ($id) ? "&ref=server&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "";
?> ?>
<div class="form-vertical"> <div class="form-vertical">
@ -60,7 +71,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml
<tr> <tr>
<td> <td>
<?php if ($canDo->get('joomla_component.edit')): ?> <?php if ($canDo->get('joomla_component.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>&ref=server&refid=<?php echo $id; ?>"><?php echo $displayData->escape($item->system_name); ?></a> <a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?><?php echo $ref; ?>"><?php echo $displayData->escape($item->system_name); ?></a>
<?php if ($item->checked_out): ?> <?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?> <?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?>
<?php endif; ?> <?php endif; ?>

View File

@ -374,9 +374,14 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
} }
else else
{ {
// set the vast development method key
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'admin_view__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'admin_view__'.$id);
ComponentbuilderHelper::set('admin_view__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('admin_view__'.$id, $this->vastDevMod);
// set a return value if found
$jinput = JFactory::getApplication()->input;
$return = $jinput->get('return', null, 'base64');
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
} }
// update the fields // update the fields

View File

@ -210,6 +210,7 @@ class ComponentbuilderModelAjax extends JModelList
$vdm = $jinput->get('vdm', null, 'WORD'); $vdm = $jinput->get('vdm', null, 'WORD');
if ($vdm) if ($vdm)
{ {
// set view and id
if ($view = ComponentbuilderHelper::get($vdm)) if ($view = ComponentbuilderHelper::get($vdm))
{ {
$current = (array) explode('__', $view); $current = (array) explode('__', $view);
@ -222,6 +223,14 @@ class ComponentbuilderModelAjax extends JModelList
); );
} }
} }
// set return if found
if ($return = ComponentbuilderHelper::get($vdm . '__return'))
{
if (ComponentbuilderHelper::checkString($return))
{
$this->viewid[$call]['a_return'] = $return;
}
}
} }
} }
if (isset($this->viewid[$call])) if (isset($this->viewid[$call]))
@ -269,8 +278,14 @@ class ComponentbuilderModelAjax extends JModelList
$ref = ''; $ref = '';
if (!is_null($values['a_id']) && $values['a_id'] > 0 && strlen($values['a_view'])) if (!is_null($values['a_id']) && $values['a_id'] > 0 && strlen($values['a_view']))
{ {
// only load referal if not new item. // check if we have a return value
$ref = '&amp;ref=' . $values['a_view'] . '&amp;refid=' . $values['a_id']; $return_url = 'index.php?option=com_componentbuilder&view=' . (string) $values['a_view'] . '&layout=edit&id=' . (int) $values['a_id'];
if (isset($values['a_return']))
{
$return_url .= '&return=' . (string) $values['a_return'];
}
// only load referral if not new item.
$ref = '&amp;ref=' . $values['a_view'] . '&amp;refid=' . $values['a_id'] . '&amp;return=' . urlencode(base64_encode($return_url));
} }
// build url (A tag) // build url (A tag)
$startAtag = '<a class="btn btn-success vdm-button-new" onclick="UIkit2.modal.confirm(\''.JText::_('COM_COMPONENTBUILDER_ALL_UNSAVED_WORK_ON_THIS_PAGE_WILL_BE_LOST_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE').'\', function(){ window.location.href = \'index.php?option=com_componentbuilder&amp;view=' . $type . '&amp;layout=edit' . $ref . '\' })" href="javascript:void(0)" title="'.JText::sprintf('COM_COMPONENTBUILDER_CREATE_NEW_S', ComponentbuilderHelper::safeString($type, 'W')).'">'; $startAtag = '<a class="btn btn-success vdm-button-new" onclick="UIkit2.modal.confirm(\''.JText::_('COM_COMPONENTBUILDER_ALL_UNSAVED_WORK_ON_THIS_PAGE_WILL_BE_LOST_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE').'\', function(){ window.location.href = \'index.php?option=com_componentbuilder&amp;view=' . $type . '&amp;layout=edit' . $ref . '\' })" href="javascript:void(0)" title="'.JText::sprintf('COM_COMPONENTBUILDER_CREATE_NEW_S', ComponentbuilderHelper::safeString($type, 'W')).'">';
@ -317,8 +332,14 @@ class ComponentbuilderModelAjax extends JModelList
$ref = ''; $ref = '';
if (!is_null($values['a_id']) && $values['a_id'] > 0 && strlen($values['a_view'])) if (!is_null($values['a_id']) && $values['a_id'] > 0 && strlen($values['a_view']))
{ {
// set the return value
$return_url = 'index.php?option=com_componentbuilder&view=' . (string) $values['a_view'] . '&layout=edit&id=' . (int) $values['a_id'];
if (isset($values['a_return']))
{
$return_url .= '&return=' . (string) $values['a_return'];
}
// only load referral if not new item. // only load referral if not new item.
$ref = '&amp;ref=' . $values['a_view'] . '&amp;refid=' . $values['a_id']; $ref = '&amp;ref=' . $values['a_view'] . '&amp;refid=' . $values['a_id'] . '&amp;return=' . urlencode(base64_encode($return_url));
// get item id // get item id
if ($id = ComponentbuilderHelper::getVar($type, $values['a_id'], $values['a_view'], 'id')) if ($id = ComponentbuilderHelper::getVar($type, $values['a_id'], $values['a_view'], 'id'))
{ {
@ -658,7 +679,14 @@ class ComponentbuilderModelAjax extends JModelList
// check if we are in the correct view. // check if we are in the correct view.
if (!is_null($values['a_id']) && $values['a_id'] > 0 && strlen($values['a_view']) && in_array($values['a_view'], $this->allowedViewsArray)) if (!is_null($values['a_id']) && $values['a_id'] > 0 && strlen($values['a_view']) && in_array($values['a_view'], $this->allowedViewsArray))
{ {
$this->ref = '&ref=' . $values['a_view'] . '&refid=' . $values['a_id']; // set a return value
$return_url = 'index.php?option=com_componentbuilder&view=' . (string) $values['a_view'] . '&layout=edit&id=' . (int) $values['a_id'];
if (isset($values['a_return']))
{
$return_url .= '&return=' . (string) $values['a_return'];
}
// set the ref
$this->ref = '&ref=' . $values['a_view'] . '&refid=' . $values['a_id'] . '&return=' . urlencode(base64_encode($return_url));
// load the results // load the results
$result = array(); $result = array();
// return field table // return field table
@ -810,7 +838,7 @@ class ComponentbuilderModelAjax extends JModelList
} }
} }
// set edit link // set edit link
$link = ($edit) ? $this->addEditLink($item, $this->itemKeys[$header]['table'], $this->itemKeys[$header]['tables']) : ''; $link = ($edit) ? ComponentbuilderHelper::getEditButton($item, $this->itemKeys[$header]['table'], $this->itemKeys[$header]['tables'], $this->ref) : '';
// load item // load item
$bucket[] = $this->itemNames[$this->itemKeys[$header]['table']][$item] . $link; $bucket[] = $this->itemNames[$this->itemKeys[$header]['table']][$item] . $link;
} }
@ -836,7 +864,7 @@ class ComponentbuilderModelAjax extends JModelList
} }
} }
// set edit link // set edit link
$link = ($edit) ? $this->addEditLink($value, $this->itemKeys[$header]['table'], $this->itemKeys[$header]['tables']) : ''; $link = ($edit) ? ComponentbuilderHelper::getEditButton($value, $this->itemKeys[$header]['table'], $this->itemKeys[$header]['tables'], $this->ref) : '';
// load item // load item
$bucket[] = $this->itemNames[$this->itemKeys[$header]['table']][$value] . $link; $bucket[] = $this->itemNames[$this->itemKeys[$header]['table']][$value] . $link;
} }
@ -955,31 +983,6 @@ class ComponentbuilderModelAjax extends JModelList
return JText::_('COM_COMPONENTBUILDER_NOT_SET'); return JText::_('COM_COMPONENTBUILDER_NOT_SET');
} }
protected function addEditLink($id, $view, $views)
{
// can edit
if ($this->canEdit($id, $view))
{
$edit = "index.php?option=com_componentbuilder&view=".$views."&task=".$view.".edit&id=".$id.$this->ref;
$title = ComponentbuilderHelper::safeString(JText::_('COM_COMPONENTBUILDER_EDIT').' '.$view, 'W');
return ' <a onclick="UIkit.modal.confirm(\''.JText::_('COM_COMPONENTBUILDER_ALL_UNSAVED_WORK_ON_THIS_PAGE_WILL_BE_LOST_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE').'\', function(){ window.location.href = \''.$edit.'\' })" href="javascript:void(0)" class="uk-icon-pencil" title="'.$title.'"></a>';
}
return '';
}
protected $user;
protected function canEdit($id, $view = 'admin_fields')
{
// load field permission check
if (!ComponentbuilderHelper::checkObject($this->user)) // TODO && $this->user instanceof JUser)
{
$this->user = JFactory::getUser();
}
return $this->user->authorise($view.'.edit', 'com_componentbuilder.'.$view.'.' . (int) $id);
}
protected function setAdminBehaviour($header, $value) protected function setAdminBehaviour($header, $value)
{ {
switch ($value) switch ($value)
@ -1284,8 +1287,14 @@ class ComponentbuilderModelAjax extends JModelList
// check if we have any linked to config // check if we have any linked to config
if (isset($this->linkedKeys[$values['a_view']])) if (isset($this->linkedKeys[$values['a_view']]))
{ {
// set a return value
$return_url = 'index.php?option=com_componentbuilder&view=' . (string) $values['a_view'] . '&layout=edit&id=' . (int) $values['a_id'];
if (isset($values['a_return']))
{
$return_url .= '&return=' . (string) $values['a_return'];
}
// make sure the ref is set // make sure the ref is set
$this->ref = '&ref=' . $values['a_view'] . '&refid=' . $values['a_id']; $this->ref = '&ref=' . $values['a_view'] . '&refid=' . $values['a_id'] . '&return=' . urlencode(base64_encode($return_url));
// get the linked to // get the linked to
if ($linked = $this->getLinkedTo($values['a_view'], $values['a_id'])) if ($linked = $this->getLinkedTo($values['a_view'], $values['a_id']))
{ {
@ -1454,7 +1463,7 @@ class ComponentbuilderModelAjax extends JModelList
$type_name = ' (' . $type_name . ') '; $type_name = ' (' . $type_name . ') ';
} }
// set edit link // set edit link
$link = ($edit) ? $this->addEditLink($item->id, $search['table'], $search['tables']) : ''; $link = ($edit) ? ComponentbuilderHelper::getEditButton($item->id, $search['table'], $search['tables'], $this->ref) : '';
// build the linked // build the linked
$linked[] = JText::_($search['linked']) . $type_name . ' - ' . $linked_name . ' ' . $link; $linked[] = JText::_($search['linked']) . $type_name . ' - ' . $linked_name . ' ' . $link;
} }

View File

@ -206,9 +206,14 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
} }
else else
{ {
// set the vast development method key
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'custom_admin_view__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'custom_admin_view__'.$id);
ComponentbuilderHelper::set('custom_admin_view__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('custom_admin_view__'.$id, $this->vastDevMod);
// set a return value if found
$jinput = JFactory::getApplication()->input;
$return = $jinput->get('return', null, 'base64');
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
} }
// check what type of custom_button array we have here (should be subform... but just incase) // check what type of custom_button array we have here (should be subform... but just incase)

View File

@ -198,9 +198,14 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
} }
else else
{ {
// set the vast development method key
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'dynamic_get__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'dynamic_get__'.$id);
ComponentbuilderHelper::set('dynamic_get__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('dynamic_get__'.$id, $this->vastDevMod);
// set a return value if found
$jinput = JFactory::getApplication()->input;
$return = $jinput->get('return', null, 'base64');
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
} }
// update the fields // update the fields

View File

@ -132,9 +132,14 @@ class ComponentbuilderModelField extends JModelAdmin
} }
else else
{ {
// set the vast development method key
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'field__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'field__'.$id);
ComponentbuilderHelper::set('field__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('field__'.$id, $this->vastDevMod);
// set a return value if found
$jinput = JFactory::getApplication()->input;
$return = $jinput->get('return', null, 'base64');
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
} }
if (!empty($item->id)) if (!empty($item->id))

View File

@ -53,7 +53,8 @@ class JFormFieldComponent extends JFormFieldList
// get the view name & id // get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word',
'return' => 'base64'
)); ));
// check if new item // check if new item
$ref = ''; $ref = '';
@ -63,6 +64,12 @@ class JFormFieldComponent extends JFormFieldList
// only load referal if not new item. // only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id']; $ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id']; $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
// get the return value.
$_uri = (string) JUri::getInstance();
$_return = urlencode(base64_encode($_uri));
// load return value.
$ref .= '&amp;return=' . $_return;
$refJ .= '&return=' . $_return;
} }
$user = JFactory::getUser(); $user = JFactory::getUser();
// only add if user allowed to create joomla_component // only add if user allowed to create joomla_component

View File

@ -53,7 +53,8 @@ class JFormFieldDynamicget extends JFormFieldList
// get the view name & id // get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word',
'return' => 'base64'
)); ));
// check if new item // check if new item
$ref = ''; $ref = '';
@ -63,6 +64,12 @@ class JFormFieldDynamicget extends JFormFieldList
// only load referal if not new item. // only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id']; $ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id']; $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
// get the return value.
$_uri = (string) JUri::getInstance();
$_return = urlencode(base64_encode($_uri));
// load return value.
$ref .= '&amp;return=' . $_return;
$refJ .= '&return=' . $_return;
} }
$user = JFactory::getUser(); $user = JFactory::getUser();
// only add if user allowed to create dynamic_get // only add if user allowed to create dynamic_get

View File

@ -53,7 +53,8 @@ class JFormFieldFieldtypes extends JFormFieldList
// get the view name & id // get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word',
'return' => 'base64'
)); ));
// check if new item // check if new item
$ref = ''; $ref = '';
@ -63,6 +64,12 @@ class JFormFieldFieldtypes extends JFormFieldList
// only load referal if not new item. // only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id']; $ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id']; $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
// get the return value.
$_uri = (string) JUri::getInstance();
$_return = urlencode(base64_encode($_uri));
// load return value.
$ref .= '&amp;return=' . $_return;
$refJ .= '&return=' . $_return;
} }
$user = JFactory::getUser(); $user = JFactory::getUser();
// only add if user allowed to create fieldtype // only add if user allowed to create fieldtype

View File

@ -53,7 +53,8 @@ class JFormFieldLibraries extends JFormFieldList
// get the view name & id // get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word',
'return' => 'base64'
)); ));
// check if new item // check if new item
$ref = ''; $ref = '';
@ -63,6 +64,12 @@ class JFormFieldLibraries extends JFormFieldList
// only load referal if not new item. // only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id']; $ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id']; $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
// get the return value.
$_uri = (string) JUri::getInstance();
$_return = urlencode(base64_encode($_uri));
// load return value.
$ref .= '&amp;return=' . $_return;
$refJ .= '&return=' . $_return;
} }
$user = JFactory::getUser(); $user = JFactory::getUser();
// only add if user allowed to create library // only add if user allowed to create library

View File

@ -53,7 +53,8 @@ class JFormFieldLibrariesx extends JFormFieldList
// get the view name & id // get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word',
'return' => 'base64'
)); ));
// check if new item // check if new item
$ref = ''; $ref = '';
@ -63,6 +64,12 @@ class JFormFieldLibrariesx extends JFormFieldList
// only load referal if not new item. // only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id']; $ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id']; $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
// get the return value.
$_uri = (string) JUri::getInstance();
$_return = urlencode(base64_encode($_uri));
// load return value.
$ref .= '&amp;return=' . $_return;
$refJ .= '&return=' . $_return;
} }
$user = JFactory::getUser(); $user = JFactory::getUser();
// only add if user allowed to create library // only add if user allowed to create library

View File

@ -53,7 +53,8 @@ class JFormFieldLibrary extends JFormFieldList
// get the view name & id // get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word',
'return' => 'base64'
)); ));
// check if new item // check if new item
$ref = ''; $ref = '';
@ -63,6 +64,12 @@ class JFormFieldLibrary extends JFormFieldList
// only load referal if not new item. // only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id']; $ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id']; $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
// get the return value.
$_uri = (string) JUri::getInstance();
$_return = urlencode(base64_encode($_uri));
// load return value.
$ref .= '&amp;return=' . $_return;
$refJ .= '&return=' . $_return;
} }
$user = JFactory::getUser(); $user = JFactory::getUser();
// only add if user allowed to create library // only add if user allowed to create library

View File

@ -53,7 +53,8 @@ class JFormFieldMaingets extends JFormFieldList
// get the view name & id // get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word',
'return' => 'base64'
)); ));
// check if new item // check if new item
$ref = ''; $ref = '';
@ -63,6 +64,12 @@ class JFormFieldMaingets extends JFormFieldList
// only load referal if not new item. // only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id']; $ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id']; $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
// get the return value.
$_uri = (string) JUri::getInstance();
$_return = urlencode(base64_encode($_uri));
// load return value.
$ref .= '&amp;return=' . $_return;
$refJ .= '&return=' . $_return;
} }
$user = JFactory::getUser(); $user = JFactory::getUser();
// only add if user allowed to create dynamic_get // only add if user allowed to create dynamic_get

View File

@ -53,7 +53,8 @@ class JFormFieldServers extends JFormFieldList
// get the view name & id // get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word',
'return' => 'base64'
)); ));
// check if new item // check if new item
$ref = ''; $ref = '';
@ -63,6 +64,12 @@ class JFormFieldServers extends JFormFieldList
// only load referal if not new item. // only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id']; $ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id']; $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
// get the return value.
$_uri = (string) JUri::getInstance();
$_return = urlencode(base64_encode($_uri));
// load return value.
$ref .= '&amp;return=' . $_return;
$refJ .= '&return=' . $_return;
} }
$user = JFactory::getUser(); $user = JFactory::getUser();
// only add if user allowed to create server // only add if user allowed to create server

View File

@ -53,7 +53,8 @@ class JFormFieldSnippets extends JFormFieldList
// get the view name & id // get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word',
'return' => 'base64'
)); ));
// check if new item // check if new item
$ref = ''; $ref = '';
@ -63,6 +64,12 @@ class JFormFieldSnippets extends JFormFieldList
// only load referal if not new item. // only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id']; $ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id']; $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
// get the return value.
$_uri = (string) JUri::getInstance();
$_return = urlencode(base64_encode($_uri));
// load return value.
$ref .= '&amp;return=' . $_return;
$refJ .= '&return=' . $_return;
} }
$user = JFactory::getUser(); $user = JFactory::getUser();
// only add if user allowed to create snippet // only add if user allowed to create snippet

View File

@ -731,6 +731,8 @@
directory="administrator/components/com_componentbuilder/compiler" directory="administrator/components/com_componentbuilder/compiler"
default="default.txt" default="default.txt"
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BOM_DESCRIPTION" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BOM_DESCRIPTION"
filter="\.txt"
hide_none="true"
hide_default="true" hide_default="true"
/> />
<!-- Update_server_target Field. Type: Radio. (joomla) --> <!-- Update_server_target Field. Type: Radio. (joomla) -->

View File

@ -229,9 +229,14 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
} }
else else
{ {
// set the vast development method key
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'joomla_component__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'joomla_component__'.$id);
ComponentbuilderHelper::set('joomla_component__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('joomla_component__'.$id, $this->vastDevMod);
// set a return value if found
$jinput = JFactory::getApplication()->input;
$return = $jinput->get('return', null, 'base64');
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
} }
// update the fields // update the fields

View File

@ -116,9 +116,14 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
} }
else else
{ {
// set the vast development method key
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'language_translation__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'language_translation__'.$id);
ComponentbuilderHelper::set('language_translation__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('language_translation__'.$id, $this->vastDevMod);
// set a return value if found
$jinput = JFactory::getApplication()->input;
$return = $jinput->get('return', null, 'base64');
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
} }
if (!empty($item->id)) if (!empty($item->id))

View File

@ -122,9 +122,14 @@ class ComponentbuilderModelLayout extends JModelAdmin
} }
else else
{ {
// set the vast development method key
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'layout__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'layout__'.$id);
ComponentbuilderHelper::set('layout__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('layout__'.$id, $this->vastDevMod);
// set a return value if found
$jinput = JFactory::getApplication()->input;
$return = $jinput->get('return', null, 'base64');
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
} }
if (!empty($item->id)) if (!empty($item->id))

View File

@ -124,9 +124,14 @@ class ComponentbuilderModelLibrary extends JModelAdmin
} }
else else
{ {
// set the vast development method key
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'library__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'library__'.$id);
ComponentbuilderHelper::set('library__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('library__'.$id, $this->vastDevMod);
// set a return value if found
$jinput = JFactory::getApplication()->input;
$return = $jinput->get('return', null, 'base64');
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
} }
if (!empty($item->id)) if (!empty($item->id))

View File

@ -206,9 +206,14 @@ class ComponentbuilderModelSite_view extends JModelAdmin
} }
else else
{ {
// set the vast development method key
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'site_view__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'site_view__'.$id);
ComponentbuilderHelper::set('site_view__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('site_view__'.$id, $this->vastDevMod);
// set a return value if found
$jinput = JFactory::getApplication()->input;
$return = $jinput->get('return', null, 'base64');
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
} }
// update the fields // update the fields

View File

@ -122,9 +122,14 @@ class ComponentbuilderModelTemplate extends JModelAdmin
} }
else else
{ {
// set the vast development method key
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'template__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'template__'.$id);
ComponentbuilderHelper::set('template__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('template__'.$id, $this->vastDevMod);
// set a return value if found
$jinput = JFactory::getApplication()->input;
$return = $jinput->get('return', null, 'base64');
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
} }
if (!empty($item->id)) if (!empty($item->id))

View File

@ -108,9 +108,14 @@ class ComponentbuilderModelValidation_rule extends JModelAdmin
} }
else else
{ {
// set the vast development method key
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'validation_rule__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'validation_rule__'.$id);
ComponentbuilderHelper::set('validation_rule__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('validation_rule__'.$id, $this->vastDevMod);
// set a return value if found
$jinput = JFactory::getApplication()->input;
$return = $jinput->get('return', null, 'base64');
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
} }
if (!empty($item->id)) if (!empty($item->id))

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade"> <extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name> <name>COM_COMPONENTBUILDER</name>
<creationDate>14th August, 2018</creationDate> <creationDate>18th August, 2018</creationDate>
<author>Llewellyn van der Merwe</author> <author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail> <authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl> <authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>

View File

@ -449,7 +449,7 @@
<version>2.8.6</version> <version>2.8.6</version>
<infourl title="Component Builder!">http://www.joomlacomponentbuilder.com</infourl> <infourl title="Component Builder!">http://www.joomlacomponentbuilder.com</infourl>
<downloads> <downloads>
<downloadurl type="full" format="zip">http://domain.com/demo.zip</downloadurl> <downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.8.6/JCB_v2.8.6.zip</downloadurl>
</downloads> </downloads>
<tags> <tags>
<tag>stable</tag> <tag>stable</tag>

View File

@ -3546,6 +3546,108 @@ abstract class ComponentbuilderHelper
return false; return false;
} }
/**
* Get the edit button
*
* @param int $item The item to edit
* @param string $view The type of item to edit
* @param string $views The list view controller name
* @param string $ref The return path
* @param string $headsup The message to show on click of button
*
* @return string On success the full html edit button
*
*/
public static function getEditButton(&$item, $view, $views, $ref = '', $component = 'com_componentbuilder', $headsup = 'COM_COMPONENTBUILDER_ALL_UNSAVED_WORK_ON_THIS_PAGE_WILL_BE_LOST_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE')
{
// get URL
$url = self::getEditURL($item, $view, $views, $ref, $component);
// check if we found any
if (self::checkString($url))
{
// check that we have the ID
if (self::checkObject($item) && isset($item->id))
{
// check if the checked_out is available
if (isset($item->checked_out))
{
$checked_out = (int) $item->checked_out;
}
}
elseif (self::checkArray($item) && isset($item['id']))
{
// check if the checked_out is available
if (isset($item['checked_out']))
{
$checked_out = (int) $item['checked_out'];
}
}
// set the link title
$title = self::safeString(JText::_('COM_COMPONENTBUILDER_EDIT') . ' ' . $view, 'W');
// check that there is a check message
if (self::checkString($headsup))
{
$href = 'onclick="UIkit.modal.confirm(\''.JText::_($headsup).'\', function(){ window.location.href = \'' . $url . '\' })" href="javascript:void(0)"';
}
else
{
$href = 'href="' . $url . '"';
}
// check if it is checked out
if (isset($checked_out) && $checked_out > 0)
{
// is this user the one who checked it out
if ($checked_out == JFactory::getUser()->id)
{
return ' <a ' . $href . ' class="uk-icon-lock" title="' . $title . '"></a>';
}
return ' <a href="#" disabled class="uk-icon-lock" title="' . JText::sprintf('COM_COMPONENTBUILDER__HAS_BEEN_CHECKED_OUT_BY_S', self::safeString($view, 'W'), JFactory::getUser($checked_out)->name) . '"></a>';
}
// return normal edit link
return ' <a ' . $href . ' class="uk-icon-pencil" title="' . $title . '"></a>';
}
return '';
}
/**
* Get the edit URL
*
* @param int $item The item to edit
* @param string $view The type of item to edit
* @param string $ref The return path
*
* @return string On success the edit url
*
*/
public static function getEditURL(&$item, $view, $views, $ref = '', $component = 'com_componentbuilder')
{
// check that we have the ID
if (self::checkObject($item) && isset($item->id))
{
$id = (int) $item->id;
}
elseif (self::checkArray($item) && isset($item['id']))
{
$id = (int) $item['id'];
}
elseif (is_numeric($item))
{
$id = (int) $item;
}
// check ID
if (isset($id) && $id > 0)
{
// can edit
if (JFactory::getUser()->authorise($view . '.edit', $component . '.' . $view . '.' . (int) $id))
{
// set the edit link
return JRoute::_("index.php?option=" . $component . "&view=" . $views . "&task=" . $view . ".edit&id=" . $id . $ref);
}
}
return false;
}
/** /**
* the Crypt objects * the Crypt objects
**/ **/

View File

@ -1,5 +1,6 @@
COM_COMPONENTBUILDER="Component Builder" COM_COMPONENTBUILDER="Component Builder"
COM_COMPONENTBUILDER_ACCESS_DENIED="Access denied!" COM_COMPONENTBUILDER_ACCESS_DENIED="Access denied!"
COM_COMPONENTBUILDER_ALL_UNSAVED_WORK_ON_THIS_PAGE_WILL_BE_LOST_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE="All unsaved work on this page will be lost, are you sure you want to continue?"
COM_COMPONENTBUILDER_API="Api" COM_COMPONENTBUILDER_API="Api"
COM_COMPONENTBUILDER_API_DESC="Sync Portal API" COM_COMPONENTBUILDER_API_DESC="Sync Portal API"
COM_COMPONENTBUILDER_BACKUP_FAILED_PLEASE_TRY_AGAIN_IF_THE_ERROR_CONTINUE_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR="Backup failed, please try again. If the error continue, please contact your system administrator." COM_COMPONENTBUILDER_BACKUP_FAILED_PLEASE_TRY_AGAIN_IF_THE_ERROR_CONTINUE_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR="Backup failed, please try again. If the error continue, please contact your system administrator."
@ -21,6 +22,7 @@ COM_COMPONENTBUILDER_DTEMAILDTDDSDD="<dt>Email</dt><dd>%s</dd>"
COM_COMPONENTBUILDER_DTLICENSEDTDDSDD="<dt>License</dt><dd>%s</dd>" COM_COMPONENTBUILDER_DTLICENSEDTDDSDD="<dt>License</dt><dd>%s</dd>"
COM_COMPONENTBUILDER_DTOWNERDTDDSDD="<dt>Owner</dt><dd>%s</dd>" COM_COMPONENTBUILDER_DTOWNERDTDDSDD="<dt>Owner</dt><dd>%s</dd>"
COM_COMPONENTBUILDER_DTWEBSITEDTDDSDD="<dt>Website</dt><dd>%s</dd>" COM_COMPONENTBUILDER_DTWEBSITEDTDDSDD="<dt>Website</dt><dd>%s</dd>"
COM_COMPONENTBUILDER_EDIT="Edit"
COM_COMPONENTBUILDER_EDIT_S="Edit %s" COM_COMPONENTBUILDER_EDIT_S="Edit %s"
COM_COMPONENTBUILDER_EMAIL_S="Email: %s" COM_COMPONENTBUILDER_EMAIL_S="Email: %s"
COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SEND="Email with the new key was send" COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SEND="Email with the new key was send"
@ -87,6 +89,7 @@ COM_COMPONENTBUILDER_WEBSITE_S="Website: %s"
COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY_WITHOUT_THIS_KEY_IT_WILL_TAKE_THE_CURRENT_TECHNOLOGY_WITH_A_BRUTE_FORCE_ATTACK_METHOD_MORE_THEN_A_HREFHTTPRANDOMIZECOMHOWLONGTOHACKPASS_TARGET_BLANK_TITLEHOW_LONG_TO_HACK_PASSSEVEN_HUNDRED_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZEROA_YEARS_TO_CRACK_THEORETICALLY_UNLESS_THEY_HAVE_THIS_KEY_ABOVE_SO_DO_KEEP_IT_SAFE="Your data is encrypted with a AES 128 bit encryption using the above 32 character key. Without this key it will take the current technology with a brute force attack method more then <a href="http://random-ize.com/how-long-to-hack-pass/" target="_blank" title="How long to hack pass">700 000 000 000 000 000 000 000 000 000 000</a> years to crack theoretically. Unless they have this key above, so do keep it safe." COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY_WITHOUT_THIS_KEY_IT_WILL_TAKE_THE_CURRENT_TECHNOLOGY_WITH_A_BRUTE_FORCE_ATTACK_METHOD_MORE_THEN_A_HREFHTTPRANDOMIZECOMHOWLONGTOHACKPASS_TARGET_BLANK_TITLEHOW_LONG_TO_HACK_PASSSEVEN_HUNDRED_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZEROA_YEARS_TO_CRACK_THEORETICALLY_UNLESS_THEY_HAVE_THIS_KEY_ABOVE_SO_DO_KEEP_IT_SAFE="Your data is encrypted with a AES 128 bit encryption using the above 32 character key. Without this key it will take the current technology with a brute force attack method more then <a href="http://random-ize.com/how-long-to-hack-pass/" target="_blank" title="How long to hack pass">700 000 000 000 000 000 000 000 000 000 000</a> years to crack theoretically. Unless they have this key above, so do keep it safe."
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_ACCESS_THE_SERVER_DETAILS_BS_DENIEDB_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="You do not have permission to access the server details (<b>%s - denied</b>), please contact your system administrator for more info." COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_ACCESS_THE_SERVER_DETAILS_BS_DENIEDB_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="You do not have permission to access the server details (<b>%s - denied</b>), please contact your system administrator for more info."
COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS="You should add the correct owner details." COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS="You should add the correct owner details."
COM_COMPONENTBUILDER__HAS_BEEN_CHECKED_OUT_BY_S="% has been checked out by %s"
COM_CONTENT_FIELD_MODIFIED_DESC="The last date this item was modified." COM_CONTENT_FIELD_MODIFIED_DESC="The last date this item was modified."
JGLOBAL_FIELD_ID_DESC="Record number in the database." JGLOBAL_FIELD_ID_DESC="Record number in the database."
JGLOBAL_FIELD_ID_LABEL="ID" JGLOBAL_FIELD_ID_LABEL="ID"