Fixed the edit-view for front-end to insure ajax also gets moved to site ajax. Also updated the UIkit notify to target uikit2 convention.

This commit is contained in:
Llewellyn van der Merwe 2018-03-30 03:29:24 +02:00
parent 4e740f568e
commit 65e0a19dee
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
5 changed files with 20 additions and 15 deletions

View File

@ -126,7 +126,7 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](http://joomlacomponentbuilder.com) + *Name*: [Component Builder](http://joomlacomponentbuilder.com)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 28th March, 2018 + *Last Build*: 30th March, 2018
+ *Version*: 2.7.1 + *Version*: 2.7.1
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -126,7 +126,7 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](http://joomlacomponentbuilder.com) + *Name*: [Component Builder](http://joomlacomponentbuilder.com)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 28th March, 2018 + *Last Build*: 30th March, 2018
+ *Version*: 2.7.1 + *Version*: 2.7.1
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

View File

@ -926,17 +926,19 @@ class Get
// build the admin_views settings // build the admin_views settings
$component->admin_views = array_map(function($array) $component->admin_views = array_map(function($array)
{ {
$array = array_map(function($value) $array = array_map(function($value) {
{
if (!ComponentbuilderHelper::checkArray($value) && !ComponentbuilderHelper::checkObject($value) && strval($value) === strval(intval($value))) if (!ComponentbuilderHelper::checkArray($value) && !ComponentbuilderHelper::checkObject($value) && strval($value) === strval(intval($value)))
{ {
return (int) $value; return (int) $value;
} }
return $value; return $value;
}, $array); }, $array);
// has become a lacacy issue, can't remove this // check if we must add to site
$array['view'] = $array['adminview']; if (isset($array['edit_create_site_view']) && $array['edit_create_site_view'])
$array['settings'] = $this->getAdminViewData($array['view']); {
$this->siteEditView[$array['adminview']] = true;
$this->lang = 'both';
}
if (isset($array['port']) && $array['port'] && !$this->addEximport) if (isset($array['port']) && $array['port'] && !$this->addEximport)
{ {
$this->addEximport = true; $this->addEximport = true;
@ -945,14 +947,13 @@ class Get
{ {
$this->setTagHistory = true; $this->setTagHistory = true;
} }
if (isset($array['edit_create_site_view']) && $array['edit_create_site_view']) // has become a lacacy issue, can't remove this
{ $array['view'] = $array['adminview'];
$this->siteEditView[$array['adminview']] = true; // get the admin settings/data
} $array['settings'] = $this->getAdminViewData($array['view']);
return $array; return $array;
}, array_values($component->addadmin_views)); }, array_values($component->addadmin_views));
} }
// set the site_view data // set the site_view data
$component->addsite_views = (isset($component->addsite_views) && ComponentbuilderHelper::checkJson($component->addsite_views)) ? json_decode($component->addsite_views, true) : null; $component->addsite_views = (isset($component->addsite_views) && ComponentbuilderHelper::checkJson($component->addsite_views)) ? json_decode($component->addsite_views, true) : null;
if (ComponentbuilderHelper::checkArray($component->addsite_views)) if (ComponentbuilderHelper::checkArray($component->addsite_views))
@ -1617,6 +1618,10 @@ class Get
unset($view->addlinked_views); unset($view->addlinked_views);
// set the lang target // set the lang target
$this->lang = 'admin'; $this->lang = 'admin';
if (isset($this->siteEditView[$id]))
{
$this->lang = 'both';
}
// add_javascript // add_javascript
$addArrayJ = array('javascript_view_file', 'javascript_view_footer', 'javascript_views_file', 'javascript_views_footer'); $addArrayJ = array('javascript_view_file', 'javascript_view_footer', 'javascript_views_file', 'javascript_views_footer');
foreach ($addArrayJ as $scripter) foreach ($addArrayJ as $scripter)

View File

@ -246,7 +246,7 @@ class ComponentbuilderModelAjax extends JModelList
$ref = '&ref=' . $values['a_view'] . '&refid=' . $values['a_id']; $ref = '&ref=' . $values['a_view'] . '&refid=' . $values['a_id'];
} }
// build url (A tag) // build url (A tag)
$startAtag = '<a class="btn btn-success vdm-button-new" 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 = \'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')).'">';
// build the smaller button // build the smaller button
if (2 == $size) if (2 == $size)
{ {
@ -317,7 +317,7 @@ class ComponentbuilderModelAjax extends JModelList
$button[] = '</div>'; $button[] = '</div>';
$button[] = '<div class="controls">'; $button[] = '<div class="controls">';
} }
$button[] = '<a class="btn btn-success vdm-button-new" 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 = \''.$editThis.$ref.'\' })" href="javascript:void(0)" title="'.$buttonText.'">'; $button[] = '<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 = \''.$editThis.$ref.'\' })" href="javascript:void(0)" title="'.$buttonText.'">';
if (1 == $size) if (1 == $size)
{ {
$button[] = '<span class="'.$icon.' icon-white"></span>'; $button[] = '<span class="'.$icon.' icon-white"></span>';

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>28th March, 2018</creationDate> <creationDate>30th March, 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://joomlacomponentbuilder.com</authorUrl> <authorUrl>http://joomlacomponentbuilder.com</authorUrl>