Resolved gh-321 by adding the option te set a create menu for admin edit views that are also added to the front-end.

This commit is contained in:
Llewellyn van der Merwe 2019-04-09 23:54:54 +02:00
parent fd154a81bc
commit a817bae010
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
9 changed files with 61 additions and 14 deletions

View File

@ -150,7 +150,7 @@ TODO
+ *Version*: 2.9.15 + *Version*: 2.9.15
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 - 2019 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*: **203724** + *Line count*: **203733**
+ *Field count*: **1116** + *Field count*: **1116**
+ *File count*: **1338** + *File count*: **1338**
+ *Folder count*: **209** + *Folder count*: **209**

View File

@ -150,7 +150,7 @@ TODO
+ *Version*: 2.9.15 + *Version*: 2.9.15
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 - 2019 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*: **203724** + *Line count*: **203733**
+ *Field count*: **1116** + *Field count*: **1116**
+ *File count*: **1338** + *File count*: **1338**
+ *Folder count*: **209** + *Folder count*: **209**

View File

@ -600,6 +600,12 @@
"rename": false, "rename": false,
"type": "menu" "type": "menu"
}, },
"default.xml": {
"path": "c0mp0n3nt/site/views/VIEW/tmpl",
"rename": "new",
"newName": "edit.xml",
"type": "admin_menu"
},
"module_forms.xml": { "module_forms.xml": {
"path": "c0mp0n3nt/site/models/forms", "path": "c0mp0n3nt/site/models/forms",
"rename": "module_forms", "rename": "module_forms",

View File

@ -1162,7 +1162,7 @@ class Get
return $value; return $value;
}, $array); }, $array);
// check if we must add to site // check if we must add to site
if (isset($array['edit_create_site_view']) && $array['edit_create_site_view']) if (isset($array['edit_create_site_view']) && is_numeric($array['edit_create_site_view']) && $array['edit_create_site_view'] > 0)
{ {
$this->siteEditView[$array['adminview']] = true; $this->siteEditView[$array['adminview']] = true;
$this->lang = 'both'; $this->lang = 'both';

View File

@ -963,7 +963,7 @@ class Structure extends Get
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version); $config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'single', false, $config); $this->buildDynamique($target, 'single', false, $config);
} }
if (isset($view['edit_create_site_view']) && $view['edit_create_site_view']) if (isset($view['edit_create_site_view']) && is_numeric($view['edit_create_site_view']) && $view['edit_create_site_view'] > 0)
{ {
// setup the front site edit-view files // setup the front site edit-view files
$target = array('site' => $view['settings']->name_single); $target = array('site' => $view['settings']->name_single);

View File

@ -1470,6 +1470,32 @@ class Interpretation extends Fields
return ''; return '';
} }
public function setAdminViewMenu(&$viewName_single, &$view)
{
$xml = '';
// build the file
$target = array('site' => $viewName_single);
$done = $this->buildDynamique($target, 'admin_menu');
if ($done)
{
// set the lang
$lang = ComponentbuilderHelper::safeString('com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '_menu_' . $viewName_single, 'U');
$this->langContent['adminsys'][$lang . '_TITLE'] = 'Create ' . $view['settings']->name_single;
$this->langContent['adminsys'][$lang . '_OPTION'] = 'Create ' . $view['settings']->name_single;
$this->langContent['adminsys'][$lang . '_DESC'] = $view['settings']->short_description;
//start loading xml
$xml = '<?xml version="1.0" encoding="utf-8" ?>';
$xml .= PHP_EOL . '<metadata>';
$xml .= PHP_EOL . $this->_t(1) . '<layout title="' . $lang . '_TITLE" option="' . $lang . '_OPTION">';
$xml .= PHP_EOL . $this->_t(2) . '<message>';
$xml .= PHP_EOL . $this->_t(3) . '<![CDATA[' . $lang . '_DESC]]>';
$xml .= PHP_EOL . $this->_t(2) . '</message>';
$xml .= PHP_EOL . $this->_t(1) . '</layout>';
$xml .= PHP_EOL . '</metadata>';
}
return $xml;
}
public function setCustomViewMenu(&$view) public function setCustomViewMenu(&$view)
{ {
$xml = ''; $xml = '';

View File

@ -248,7 +248,7 @@ class Infusion extends Interpretation
$this->setViewPlaceholders($view['settings']); $this->setViewPlaceholders($view['settings']);
// set site edit view array // set site edit view array
if (isset($view['edit_create_site_view']) && $view['edit_create_site_view']) if (isset($view['edit_create_site_view']) && is_numeric($view['edit_create_site_view']) && $view['edit_create_site_view'] > 0)
{ {
$site_edit_view_array[] = $this->_t(4) . "'" . $viewName_single . "'"; $site_edit_view_array[] = $this->_t(4) . "'" . $viewName_single . "'";
$this->lang = 'both'; $this->lang = 'both';
@ -357,9 +357,15 @@ class Infusion extends Interpretation
$this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEWCSS' . $this->hhh] = $this->getCustomScriptBuilder('css_view', $viewName_single, '', null, true); $this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEWCSS' . $this->hhh] = $this->getCustomScriptBuilder('css_view', $viewName_single, '', null, true);
// add css to front end // add css to front end
if (isset($view['edit_create_site_view']) && $view['edit_create_site_view']) if (isset($view['edit_create_site_view']) && is_numeric($view['edit_create_site_view']) && $view['edit_create_site_view'] > 0)
{ {
$this->fileContentDynamic[$viewName_single][$this->hhh . 'SITE_VIEWCSS' . $this->hhh] = $this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEWCSS' . $this->hhh]; $this->fileContentDynamic[$viewName_single][$this->hhh . 'SITE_VIEWCSS' . $this->hhh] = $this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEWCSS' . $this->hhh];
// check if we should add a create menu
if ($view['edit_create_site_view'] == 2)
{
// SITE_MENU_XML <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single][$this->hhh . 'SITE_MENU_XML' . $this->hhh] = $this->setAdminViewMenu($viewName_single, $view);
}
} }
} }
// set the views names // set the views names
@ -552,7 +558,7 @@ class Infusion extends Interpretation
} }
$this->fileContentStatic[$this->hhh . 'ROUTEHELPER' . $this->hhh] .= $this->setRouterHelp($viewName_single, $viewName_list); $this->fileContentStatic[$this->hhh . 'ROUTEHELPER' . $this->hhh] .= $this->setRouterHelp($viewName_single, $viewName_list);
if (isset($view['edit_create_site_view']) && $view['edit_create_site_view']) if (isset($view['edit_create_site_view']) && is_numeric($view['edit_create_site_view']) && $view['edit_create_site_view'] > 0)
{ {
// add needed router stuff for front edit views // add needed router stuff for front edit views
$this->fileContentStatic[$this->hhh . 'ROUTER_PARSE_SWITCH' . $this->hhh] .= $this->routerParseSwitch($viewName_single, null, false); $this->fileContentStatic[$this->hhh . 'ROUTER_PARSE_SWITCH' . $this->hhh] .= $this->routerParseSwitch($viewName_single, null, false);

View File

@ -1846,9 +1846,11 @@ COM_COMPONENTBUILDER_COMPONENTS_UPDATES_N_ITEMS_UNPUBLISHED_1="%s Component Upda
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS="Component Admin Views" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS="Component Admin Views"
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ACCESS_DESCRIPTION="Select if this view<br />should use access." COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ACCESS_DESCRIPTION="Select if this view<br />should use access."
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ACCESS_LABEL="Add Access" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ACCESS_LABEL="Add Access"
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADD="Add"
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADDADMIN_VIEWS="Addadmin Views" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADDADMIN_VIEWS="Addadmin Views"
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADDADMIN_VIEWS_DESCRIPTION="Setup the admin views for this component." COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADDADMIN_VIEWS_DESCRIPTION="Setup the admin views for this component."
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADDADMIN_VIEWS_LABEL="Admin Views" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADDADMIN_VIEWS_LABEL="Admin Views"
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADDMENU="Add+Menu"
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADDRESS="Address" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADDRESS="Address"
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADMINVIEW="Adminview" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADMINVIEW="Adminview"
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADMINVIEW_DESCRIPTION="Select an admin view" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADMINVIEW_DESCRIPTION="Select an admin view"
@ -2012,6 +2014,7 @@ COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NEW="A New Component Admin Views"
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NEW_TAB="New Tab" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NEW_TAB="New Tab"
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NEW_TAB_TWO="New Tab 2" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NEW_TAB_TWO="New Tab 2"
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NEXT="Next" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NEXT="Next"
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NONE="None"
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NOTE_ON_ADMIN_VIEWS_DESCRIPTION="Do not add the same view twice it will not work. Please <a href='https://youtu.be/39vY66X7GGU?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE' target='_blank'>watch this tutorial for more help</a>." COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NOTE_ON_ADMIN_VIEWS_DESCRIPTION="Do not add the same view twice it will not work. Please <a href='https://youtu.be/39vY66X7GGU?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE' target='_blank'>watch this tutorial for more help</a>."
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NOTE_ON_ADMIN_VIEWS_LABEL="Setting Admin Views" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NOTE_ON_ADMIN_VIEWS_LABEL="Setting Admin Views"
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NOTIFICATION="Notification" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NOTIFICATION="Notification"

View File

@ -664,17 +664,23 @@
description="COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_PORT_DESCRIPTION" description="COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_PORT_DESCRIPTION"
class="inputbox" class="inputbox"
/> />
<!-- Edit_create_site_view Field. Type: Checkbox. (joomla) --> <!-- Edit_create_site_view Field. Type: List. (joomla) -->
<field <field
type="checkbox" type="list"
name="edit_create_site_view" name="edit_create_site_view"
label="COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_EDIT_CREATE_SITE_VIEW_LABEL" label="COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_EDIT_CREATE_SITE_VIEW_LABEL"
value="1"
default=""
required="false"
description="COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_EDIT_CREATE_SITE_VIEW_DESCRIPTION" description="COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_EDIT_CREATE_SITE_VIEW_DESCRIPTION"
class="inputbox" class="list_class fieldMedium"
/> multiple="false"
required="false">
<!-- Option Set. -->
<option value="">
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NONE</option>
<option value="1">
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADD</option>
<option value="2">
COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADDMENU</option>
</field>
<!-- Order Field. Type: Integer. (joomla) --> <!-- Order Field. Type: Integer. (joomla) -->
<field <field
type="integer" type="integer"