Fixed the Categories link on the dashboard to follow the new single list view naming convention.

This commit is contained in:
2020-08-13 03:03:56 +02:00
parent 3ca4c3c3d6
commit 861347318d
10 changed files with 85 additions and 59 deletions

View File

@ -4038,7 +4038,7 @@ class Get
{
$field['permission'] = array($field['permission']);
}
// set unigue name keeper
// set unique name keeper
if ($listViewName)
{
$this->setUniqueNameCounter(
@ -4176,7 +4176,7 @@ class Get
);
// set the name of the field
$name = ComponentbuilderHelper::safeFieldName($field['settings']->name);
// check that we have the poperties
// check that we have the properties
if (ComponentbuilderHelper::checkArray($field['settings']->properties))
{
foreach ($field['settings']->properties as $property)

View File

@ -4438,7 +4438,7 @@ class Fields extends Structure
}
else
{
// set lang (just incase)
// set lang (just in case)
$listLangName = $langView . '_'
. ComponentbuilderHelper::safeFieldName($name, true);
// add to lang array
@ -4654,7 +4654,7 @@ class Fields extends Structure
$this->app->enqueueMessage(
JText::sprintf(
'<hr /><h3>Category targeting view mismatch</h3>
<a>The <a href="index.php?option=com_componentbuilder&view=fields&task=field.edit&id=%s" target="_blank" title="open field">
<p>The <a href="index.php?option=com_componentbuilder&view=fields&task=field.edit&id=%s" target="_blank" title="open field">
category field</a> in <b>(%s) admin view</b> has a mismatching target view.
<br />To correct the mismatch, the <b>extension</b> value <code>%s</code> in the <a href="index.php?option=com_componentbuilder&view=fields&task=field.edit&id=%s" target="_blank" title="open category field">
field</a> must be changed to <code>%s</code>
@ -5080,7 +5080,7 @@ class Fields extends Structure
{
// reset the php bucket
$phpBucket = '';
// only set if avaliable
// only set if available
if (isset($data['custom']['php' . $x])
&& ComponentbuilderHelper::checkArray(
$data['custom']['php' . $x]

View File

@ -21165,6 +21165,7 @@ class Interpretation extends Fields
$this->setLangContent($this->lang, $langKey, $langName);
$counter++;
}
// dashboard link to category on dashboard is build here
if (isset($this->categoryBuilder[$name_list])
&& ComponentbuilderHelper::checkArray(
$this->categoryBuilder[$name_list]
@ -21194,8 +21195,13 @@ class Interpretation extends Fields
$otherViews, 'W'
);
}
// only load this category once
if (!in_array($otherViews, $catArray))
{
// set the extension key string, new convention (more stable)
$_key_extension = str_replace('.', '_po0O0oq_',
$this->categoryBuilder[$name_list]['extension']);
// add to lang
$langKey = $this->langPrefix . '_DASHBOARD_'
. ComponentbuilderHelper::safeString(
@ -21223,12 +21229,12 @@ class Interpretation extends Fields
if ($counter == 0)
{
$icons .= "'" . $type . $otherViews . "." . $catCode
. "'";
. '_qpo0O0oqp_' . $_key_extension . "'";
}
else
{
$icons .= ", '" . $type . $otherViews . "."
. $catCode . "'";
. $catCode . '_qpo0O0oqp_' . $_key_extension . "'";
}
$counter++;
// make sure we add a category only once
@ -21770,14 +21776,14 @@ class Interpretation extends Fields
)
&& !in_array($otherViews, $catArray))
{
// get the extention array
$_extetion_array = (array) explode(
// get the extension array
$_extension_array = (array) explode(
'.', $this->categoryBuilder[$nameList]['extension']
);
// set the meny selection
if (isset($_extetion_array[1]))
// set the menu selection
if (isset($_extension_array[1]))
{
$_menu = "categories." . trim($_extetion_array[1]);
$_menu = "categories." . trim($_extension_array[1]);
}
else
{