Resolved gh-460 to insure that all default fields, including the access and meta fields can be overwriten/replaced with self build fields. Added the UIKIT3 Icon JS to the document where needed. Fixed the permissions implementation to insure spacer fields are not targeted with edit controll and when a view permission is set, it behave correctly.

This commit is contained in:
2019-10-11 15:41:00 +02:00
parent 773a753323
commit b8d8b8e813
64 changed files with 1396 additions and 592 deletions

View File

@ -805,6 +805,8 @@ class Get
$this->minify = (isset($config['minify']) && $config['minify'] != 2) ? $config['minify'] : $this->params->get('minify', 0);
// set the global language
$this->langTag = $this->params->get('language', $this->langTag);
// also set the helper calss langTag (for safe string)
// setup the main language array
$this->languages[$this->langTag] = array();
// check if we have Tidy enabled
@ -6491,7 +6493,14 @@ class Get
}
else
{
$form[$dynamic_field] = ComponentbuilderHelper::safeString($form[$dynamic_field]);
if ('fields_name' === $dynamic_field && strpos($form[$dynamic_field], '.') !== false)
{
$form[$dynamic_field] = $form[$dynamic_field];
}
else
{
$form[$dynamic_field] = ComponentbuilderHelper::safeString($form[$dynamic_field]);
}
}
}
// check if field is external form file

View File

@ -537,7 +537,19 @@ class Structure extends Get
$xml .= PHP_EOL . '>';
foreach ($fields as $field_name => $fieldsets)
{
$xml .= PHP_EOL . $this->_t(1) . '<fields name="' . $field_name . '">';
// check if we have an double fields naming set
$field_name_inner = '';
$field_name_outer = $field_name;
if (strpos($field_name, '.') !== false)
{
$field_names = explode('.', $field_name);
if (count((array) $field_names) == 2)
{
$field_name_outer = $field_names[0];
$field_name_inner = $field_names[1];
}
}
$xml .= PHP_EOL . $this->_t(1) . '<fields name="' . $field_name_outer . '">';
foreach ($fieldsets as $fieldset => $field)
{
// default to the field set name
@ -559,8 +571,18 @@ class Structure extends Get
{
$xml .= PHP_EOL . $this->_t(1) . '<fieldset name="' . $fieldset . '" label="' . $label . '">';
}
// check if we have an inner field set
if (ComponentbuilderHelper::checkString($field_name_inner))
{
$xml .= PHP_EOL . $this->_t(1) . '<fields name="' . $field_name_inner . '">';
}
// add the placeholder of the fields
$xml .= $this->hhh . 'FIELDSET_' . $file.$field_name.$fieldset . $this->hhh;
// check if we have an inner field set
if (ComponentbuilderHelper::checkString($field_name_inner))
{
$xml .= PHP_EOL . $this->_t(1) . '</fields>';
}
$xml .= PHP_EOL . $this->_t(1) . '</fieldset>';
}
$xml .= PHP_EOL . $this->_t(1) . '</fields>';

View File

@ -633,29 +633,35 @@ class Fields extends Structure
if (isset($this->metadataBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view_name_single]))
{
// metakey
$fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Metakey Field. Type: Textarea (joomla) -->";
$fieldSet[] = $this->_t(2) . "<field";
$fieldSet[] = $this->_t(3) . 'name="metakey"';
$fieldSet[] = $this->_t(3) . 'type="textarea"';
$fieldSet[] = $this->_t(3) . 'label="JFIELD_META_KEYWORDS_LABEL"';
$fieldSet[] = $this->_t(3) . 'description="JFIELD_META_KEYWORDS_DESC"';
$fieldSet[] = $this->_t(3) . 'rows="3"';
$fieldSet[] = $this->_t(3) . 'cols="30"';
$fieldSet[] = $this->_t(2) . "/>";
// count the static field created
$this->fieldCount++;
if (!isset($this->fieldsNames[$view_name_single]['metakey']))
{
$fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Metakey Field. Type: Textarea (joomla) -->";
$fieldSet[] = $this->_t(2) . "<field";
$fieldSet[] = $this->_t(3) . 'name="metakey"';
$fieldSet[] = $this->_t(3) . 'type="textarea"';
$fieldSet[] = $this->_t(3) . 'label="JFIELD_META_KEYWORDS_LABEL"';
$fieldSet[] = $this->_t(3) . 'description="JFIELD_META_KEYWORDS_DESC"';
$fieldSet[] = $this->_t(3) . 'rows="3"';
$fieldSet[] = $this->_t(3) . 'cols="30"';
$fieldSet[] = $this->_t(2) . "/>";
// count the static field created
$this->fieldCount++;
}
// metadesc
$fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Metadesc Field. Type: Textarea (joomla) -->";
$fieldSet[] = $this->_t(2) . "<field";
$fieldSet[] = $this->_t(3) . 'name="metadesc"';
$fieldSet[] = $this->_t(3) . 'type="textarea"';
$fieldSet[] = $this->_t(3) . 'label="JFIELD_META_DESCRIPTION_LABEL"';
$fieldSet[] = $this->_t(3) . 'description="JFIELD_META_DESCRIPTION_DESC"';
$fieldSet[] = $this->_t(3) . 'rows="3"';
$fieldSet[] = $this->_t(3) . 'cols="30"';
$fieldSet[] = $this->_t(2) . "/>";
// count the static field created
$this->fieldCount++;
if (!isset($this->fieldsNames[$view_name_single]['metadesc']))
{
$fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Metadesc Field. Type: Textarea (joomla) -->";
$fieldSet[] = $this->_t(2) . "<field";
$fieldSet[] = $this->_t(3) . 'name="metadesc"';
$fieldSet[] = $this->_t(3) . 'type="textarea"';
$fieldSet[] = $this->_t(3) . 'label="JFIELD_META_DESCRIPTION_LABEL"';
$fieldSet[] = $this->_t(3) . 'description="JFIELD_META_DESCRIPTION_DESC"';
$fieldSet[] = $this->_t(3) . 'rows="3"';
$fieldSet[] = $this->_t(3) . 'cols="30"';
$fieldSet[] = $this->_t(2) . "/>";
// count the static field created
$this->fieldCount++;
}
}
// load the dynamic fields now
if (ComponentbuilderHelper::checkString($dynamicFields))
@ -667,43 +673,57 @@ class Fields extends Structure
// check if metadata is added to this view
if (isset($this->metadataBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view_name_single]))
{
$fieldSet[] = PHP_EOL . $this->_t(1) . "<!--" . $this->setLine(__LINE__) . " Metadata Fields. -->";
$fieldSet[] = $this->_t(1) . "<fields" . ' name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">';
$fieldSet[] = $this->_t(2) . '<fieldset name="vdmmetadata"';
$fieldSet[] = $this->_t(3) . 'label="JGLOBAL_FIELDSET_METADATA_OPTIONS">';
// robots
$fieldSet[] = $this->_t(3) . "<!--" . $this->setLine(__LINE__) . " Robots Field. Type: List (joomla) -->";
$fieldSet[] = $this->_t(3) . '<field name="robots"';
$fieldSet[] = $this->_t(4) . 'type="list"';
$fieldSet[] = $this->_t(4) . 'label="JFIELD_METADATA_ROBOTS_LABEL"';
$fieldSet[] = $this->_t(4) . 'description="JFIELD_METADATA_ROBOTS_DESC" >';
$fieldSet[] = $this->_t(4) . '<option value="">JGLOBAL_USE_GLOBAL</option>';
$fieldSet[] = $this->_t(4) . '<option value="index, follow">JGLOBAL_INDEX_FOLLOW</option>';
$fieldSet[] = $this->_t(4) . '<option value="noindex, follow">JGLOBAL_NOINDEX_FOLLOW</option>';
$fieldSet[] = $this->_t(4) . '<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>';
$fieldSet[] = $this->_t(4) . '<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>';
$fieldSet[] = $this->_t(3) . '</field>';
// count the static field created
$this->fieldCount++;
// author
$fieldSet[] = $this->_t(3) . "<!--" . $this->setLine(__LINE__) . " Author Field. Type: Text (joomla) -->";
$fieldSet[] = $this->_t(3) . '<field name="author"';
$fieldSet[] = $this->_t(4) . 'type="text"';
$fieldSet[] = $this->_t(4) . 'label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC"';
$fieldSet[] = $this->_t(4) . 'size="20"';
$fieldSet[] = $this->_t(3) . "/>";
// count the static field created
$this->fieldCount++;
// rights
$fieldSet[] = $this->_t(3) . "<!--" . $this->setLine(__LINE__) . " Rights Field. Type: Textarea (joomla) -->";
$fieldSet[] = $this->_t(3) . '<field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL"';
$fieldSet[] = $this->_t(4) . 'description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"';
$fieldSet[] = $this->_t(4) . 'cols="30" rows="2"';
$fieldSet[] = $this->_t(3) . "/>";
// count the static field created
$this->fieldCount++;
$fieldSet[] = $this->_t(2) . "</fieldset>";
$fieldSet[] = $this->_t(1) . "</fields>";
if (!isset($this->fieldsNames[$view_name_single]['robots'])
|| !isset($this->fieldsNames[$view_name_single]['rights'])
|| !isset($this->fieldsNames[$view_name_single]['author']))
{
$fieldSet[] = PHP_EOL . $this->_t(1) . "<!--" . $this->setLine(__LINE__) . " Metadata Fields. -->";
$fieldSet[] = $this->_t(1) . "<fields" . ' name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">';
$fieldSet[] = $this->_t(2) . '<fieldset name="vdmmetadata"';
$fieldSet[] = $this->_t(3) . 'label="JGLOBAL_FIELDSET_METADATA_OPTIONS">';
// robots
if (!isset($this->fieldsNames[$view_name_single]['robots']))
{
$fieldSet[] = $this->_t(3) . "<!--" . $this->setLine(__LINE__) . " Robots Field. Type: List (joomla) -->";
$fieldSet[] = $this->_t(3) . '<field name="robots"';
$fieldSet[] = $this->_t(4) . 'type="list"';
$fieldSet[] = $this->_t(4) . 'label="JFIELD_METADATA_ROBOTS_LABEL"';
$fieldSet[] = $this->_t(4) . 'description="JFIELD_METADATA_ROBOTS_DESC" >';
$fieldSet[] = $this->_t(4) . '<option value="">JGLOBAL_USE_GLOBAL</option>';
$fieldSet[] = $this->_t(4) . '<option value="index, follow">JGLOBAL_INDEX_FOLLOW</option>';
$fieldSet[] = $this->_t(4) . '<option value="noindex, follow">JGLOBAL_NOINDEX_FOLLOW</option>';
$fieldSet[] = $this->_t(4) . '<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>';
$fieldSet[] = $this->_t(4) . '<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>';
$fieldSet[] = $this->_t(3) . '</field>';
// count the static field created
$this->fieldCount++;
}
// author
if (!isset($this->fieldsNames[$view_name_single]['author']))
{
$fieldSet[] = $this->_t(3) . "<!--" . $this->setLine(__LINE__) . " Author Field. Type: Text (joomla) -->";
$fieldSet[] = $this->_t(3) . '<field name="author"';
$fieldSet[] = $this->_t(4) . 'type="text"';
$fieldSet[] = $this->_t(4) . 'label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC"';
$fieldSet[] = $this->_t(4) . 'size="20"';
$fieldSet[] = $this->_t(3) . "/>";
// count the static field created
$this->fieldCount++;
}
// rights
if (!isset($this->fieldsNames[$view_name_single]['rights']))
{
$fieldSet[] = $this->_t(3) . "<!--" . $this->setLine(__LINE__) . " Rights Field. Type: Textarea (joomla) -->";
$fieldSet[] = $this->_t(3) . '<field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL"';
$fieldSet[] = $this->_t(4) . 'description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"';
$fieldSet[] = $this->_t(4) . 'cols="30" rows="2"';
$fieldSet[] = $this->_t(3) . "/>";
// count the static field created
$this->fieldCount++;
}
$fieldSet[] = $this->_t(2) . "</fieldset>";
$fieldSet[] = $this->_t(1) . "</fields>";
}
}
// retunr the set
return implode(PHP_EOL, $fieldSet);
@ -923,28 +943,34 @@ class Fields extends Structure
if (isset($this->metadataBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view_name_single]))
{
// metakey
$attributes = array(
'name' => 'metakey',
'type' => 'textarea',
'label' => 'JFIELD_META_KEYWORDS_LABEL',
'description' => 'JFIELD_META_KEYWORDS_DESC',
'rows' => 3,
'cols' => 30
);
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metakey Field. Type: Textarea (joomla)");
$fieldXML = $fieldSetXML->addChild('field');
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
$this->fieldCount++;
if (!isset($this->fieldsNames[$view_name_single]['metakey']))
{
$attributes = array(
'name' => 'metakey',
'type' => 'textarea',
'label' => 'JFIELD_META_KEYWORDS_LABEL',
'description' => 'JFIELD_META_KEYWORDS_DESC',
'rows' => 3,
'cols' => 30
);
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metakey Field. Type: Textarea (joomla)");
$fieldXML = $fieldSetXML->addChild('field');
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
$this->fieldCount++;
}
// metadesc
$attributes['name'] = 'metadesc';
$attributes['label'] = 'JFIELD_META_DESCRIPTION_LABEL';
$attributes['description'] = 'JFIELD_META_DESCRIPTION_DESC';
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metadesc Field. Type: Textarea (joomla)");
$fieldXML = $fieldSetXML->addChild('field');
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
$this->fieldCount++;
if (!isset($this->fieldsNames[$view_name_single]['metadesc']))
{
$attributes['name'] = 'metadesc';
$attributes['label'] = 'JFIELD_META_DESCRIPTION_LABEL';
$attributes['description'] = 'JFIELD_META_DESCRIPTION_DESC';
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metadesc Field. Type: Textarea (joomla)");
$fieldXML = $fieldSetXML->addChild('field');
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
$this->fieldCount++;
}
}
// load the dynamic fields now
if (count((array) $dynamicFieldsXML))
@ -958,67 +984,81 @@ class Fields extends Structure
// check if metadata is added to this view
if (isset($this->metadataBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view_name_single]))
{
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metadata Fields");
$fieldsXML = $fieldSetXML->addChild('fields');
$fieldsXML->addAttribute('name', 'metadata');
$fieldsXML->addAttribute('label', 'JGLOBAL_FIELDSET_METADATA_OPTIONS');
$fieldsFieldSetXML = $fieldsXML->addChild('fieldset');
$fieldsFieldSetXML->addAttribute('name', 'vdmmetadata');
$fieldsFieldSetXML->addAttribute('label', 'JGLOBAL_FIELDSET_METADATA_OPTIONS');
// robots
ComponentbuilderHelper::xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Robots Field. Type: List (joomla)");
$robots = $fieldsFieldSetXML->addChild('field');
$attributes = array(
'name' => 'robots',
'type' => 'list',
'label' => 'JFIELD_METADATA_ROBOTS_LABEL',
'description' => 'JFIELD_METADATA_ROBOTS_DESC'
);
ComponentbuilderHelper::xmlAddAttributes($robots, $attributes);
// count the static field created
$this->fieldCount++;
$options = array(
'JGLOBAL_USE_GLOBAL' => '',
'JGLOBAL_INDEX_FOLLOW' => 'index, follow',
'JGLOBAL_NOINDEX_FOLLOW' => 'noindex, follow',
'JGLOBAL_INDEX_NOFOLLOW' => 'index, nofollow',
'JGLOBAL_NOINDEX_NOFOLLOW' => 'noindex, nofollow',
);
foreach ($options as $text => $value)
if (!isset($this->fieldsNames[$view_name_single]['robots'])
|| !isset($this->fieldsNames[$view_name_single]['author'])
|| !isset($this->fieldsNames[$view_name_single]['rights']))
{
$option = $robots->addChild('option');
$option->addAttribute('value', $value);
$option[] = $text;
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metadata Fields");
$fieldsXML = $fieldSetXML->addChild('fields');
$fieldsXML->addAttribute('name', 'metadata');
$fieldsXML->addAttribute('label', 'JGLOBAL_FIELDSET_METADATA_OPTIONS');
$fieldsFieldSetXML = $fieldsXML->addChild('fieldset');
$fieldsFieldSetXML->addAttribute('name', 'vdmmetadata');
$fieldsFieldSetXML->addAttribute('label', 'JGLOBAL_FIELDSET_METADATA_OPTIONS');
// robots
if (!isset($this->fieldsNames[$view_name_single]['robots']))
{
ComponentbuilderHelper::xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Robots Field. Type: List (joomla)");
$robots = $fieldsFieldSetXML->addChild('field');
$attributes = array(
'name' => 'robots',
'type' => 'list',
'label' => 'JFIELD_METADATA_ROBOTS_LABEL',
'description' => 'JFIELD_METADATA_ROBOTS_DESC'
);
ComponentbuilderHelper::xmlAddAttributes($robots, $attributes);
// count the static field created
$this->fieldCount++;
$options = array(
'JGLOBAL_USE_GLOBAL' => '',
'JGLOBAL_INDEX_FOLLOW' => 'index, follow',
'JGLOBAL_NOINDEX_FOLLOW' => 'noindex, follow',
'JGLOBAL_INDEX_NOFOLLOW' => 'index, nofollow',
'JGLOBAL_NOINDEX_NOFOLLOW' => 'noindex, nofollow',
);
foreach ($options as $text => $value)
{
$option = $robots->addChild('option');
$option->addAttribute('value', $value);
$option[] = $text;
}
}
// author
if (!isset($this->fieldsNames[$view_name_single]['author']))
{
ComponentbuilderHelper::xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Author Field. Type: Text (joomla)");
$author = $fieldsFieldSetXML->addChild('field');
$attributes = array(
'name' => 'author',
'type' => 'text',
'label' => 'JAUTHOR',
'description' => 'JFIELD_METADATA_AUTHOR_DESC',
'size' => 20
);
ComponentbuilderHelper::xmlAddAttributes($author, $attributes);
// count the static field created
$this->fieldCount++;
}
// rights
if (!isset($this->fieldsNames[$view_name_single]['rights']))
{
ComponentbuilderHelper::xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Rights Field. Type: Textarea (joomla)");
$rights = $fieldsFieldSetXML->addChild('field');
$attributes = array(
'name' => 'rights',
'type' => 'textarea',
'label' => 'JFIELD_META_RIGHTS_LABEL',
'description' => 'JFIELD_META_RIGHTS_DESC',
'required' => 'false',
'filter' => 'string',
'cols' => 30,
'rows' => 2
);
ComponentbuilderHelper::xmlAddAttributes($rights, $attributes);
// count the static field created
$this->fieldCount++;
}
}
// author
ComponentbuilderHelper::xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Author Field. Type: Text (joomla)");
$author = $fieldsFieldSetXML->addChild('field');
$attributes = array(
'name' => 'author',
'type' => 'text',
'label' => 'JAUTHOR',
'description' => 'JFIELD_METADATA_AUTHOR_DESC',
'size' => 20
);
ComponentbuilderHelper::xmlAddAttributes($author, $attributes);
// count the static field created
$this->fieldCount++;
// rights
ComponentbuilderHelper::xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Rights Field. Type: Textarea (joomla)");
$rights = $fieldsFieldSetXML->addChild('field');
$attributes = array(
'name' => 'rights',
'type' => 'textarea',
'label' => 'JFIELD_META_RIGHTS_LABEL',
'description' => 'JFIELD_META_RIGHTS_DESC',
'required' => 'false',
'filter' => 'string',
'cols' => 30,
'rows' => 2
);
ComponentbuilderHelper::xmlAddAttributes($rights, $attributes);
// count the static field created
$this->fieldCount++;
}
// return the set
return $this->xmlPrettyPrint($XML, 'fieldset');

View File

@ -177,7 +177,7 @@ class Interpretation extends Fields
*
* @var array
*/
protected $permissionFields = array();
public $permissionFields = array();
/**
* Custom Admin View List Link
@ -4313,6 +4313,7 @@ class Interpretation extends Fields
$setter .= PHP_EOL . $tabV . $this->_t(2) . "if ((!\$HeaderCheck->js_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)";
$setter .= PHP_EOL . $tabV . $this->_t(2) . "{";
$setter .= PHP_EOL . $tabV . $this->_t(3) . "\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->componentCodeName . "/uikit-v3/js/uikit'.\$size.'.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');";
$setter .= PHP_EOL . $tabV . $this->_t(3) . "\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->componentCodeName . "/uikit-v3/js/uikit-icons'.\$size.'.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');";
$setter .= PHP_EOL . $tabV . $this->_t(2) . "}";
if (2 == $this->uikit)
{
@ -6066,6 +6067,19 @@ class Interpretation extends Fields
$fixUniqe[] = $this->_t(4) . "}";
$fixUniqe[] = $this->_t(3) . "}";
$fixUniqe[] = $this->_t(2) . "}";
// $fixUniqe[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Update alias if still empty at this point";
// $fixUniqe[] = $this->_t(2) . "if (\$data['" . $alias . "'] == null || empty(\$data['" . $alias . "']))";
// $fixUniqe[] = $this->_t(2) . "{";
// $fixUniqe[] = $this->_t(3) . "if (JFactory::getConfig()->get('unicodeslugs') == 1)";
// $fixUniqe[] = $this->_t(3) . "{";
// $fixUniqe[] = $this->_t(4) . "\$data['" . $alias . "'] = JFilterOutput::stringURLUnicodeSlug(" . implode(' . " " . ', $titleData) . ");";
// $fixUniqe[] = $this->_t(3) . "}";
// $fixUniqe[] = $this->_t(3) . "else";
// $fixUniqe[] = $this->_t(3) . "{";
// $fixUniqe[] = $this->_t(4) . "\$data['" . $alias . "'] = JFilterOutput::stringURLSafe(" . implode(' . " " . ', $titleData) . ");";
// $fixUniqe[] = $this->_t(3) . "}";
// $fixUniqe[] = $this->_t(2) . "}";
}
// handel other uniqe fields
$fixUniqe[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Alter the uniqe field for save as copy";
@ -6385,7 +6399,7 @@ class Interpretation extends Fields
$db_ .= PHP_EOL . $this->_t(1) . "`hits` INT(10) unsigned NOT NULL DEFAULT 0,";
}
// check if view has access
if (isset($this->accessBuilder[$view]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view]))
if (isset($this->accessBuilder[$view]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view]) && !isset($this->fieldsNames[$view]['access']))
{
$db_ .= PHP_EOL . $this->_t(1) . "`access` INT(10) unsigned NOT NULL DEFAULT 0,";
}
@ -6397,50 +6411,67 @@ class Interpretation extends Fields
// check if metadata is added to this view
if (isset($this->metadataBuilder[$view]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view]))
{
$db_ .= PHP_EOL . $this->_t(1) . "`metakey` TEXT NOT NULL,";
$db_ .= PHP_EOL . $this->_t(1) . "`metadesc` TEXT NOT NULL,";
$db_ .= PHP_EOL . $this->_t(1) . "`metadata` TEXT NOT NULL,";
// check if default field was over written
if (!isset($this->fieldsNames[$view]['metakey']))
{
$db_ .= PHP_EOL . $this->_t(1) . "`metakey` TEXT NOT NULL,";
}
// check if default field was over written
if (!isset($this->fieldsNames[$view]['metadesc']))
{
$db_ .= PHP_EOL . $this->_t(1) . "`metadesc` TEXT NOT NULL,";
}
// check if default field was over written
if (!isset($this->fieldsNames[$view]['metadata']))
{
$db_ .= PHP_EOL . $this->_t(1) . "`metadata` TEXT NOT NULL,";
}
}
// TODO (we may want this to be dynamicly set)
$db_ .= PHP_EOL . $this->_t(1) . "PRIMARY KEY (`id`)";
// check if a key was set for any of the default fields then we should not set it again
$check_keys_set = array();
if (isset($this->dbUniqueKeys[$view]) && ComponentbuilderHelper::checkArray($this->dbUniqueKeys[$view]))
{
foreach ($this->dbUniqueKeys[$view] as $nr => $key)
{
$db_ .= "," . PHP_EOL . $this->_t(1) . "UNIQUE KEY `idx_" . $key . "` (`" . $key . "`)";
$check_keys_set[$key] = $key;
}
}
// check if view has access
if (isset($this->accessBuilder[$view]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view]))
{
$db_ .= "," . PHP_EOL . $this->_t(1) . "KEY `idx_access` (`access`)";
}
// check if default field was over written
if (!isset($this->fieldsNames[$view]['checked_out']))
{
$db_ .= "," . PHP_EOL . $this->_t(1) . "KEY `idx_checkout` (`checked_out`)";
}
// check if default field was over written
if (!isset($this->fieldsNames[$view]['created_by']))
{
$db_ .= "," . PHP_EOL . $this->_t(1) . "KEY `idx_createdby` (`created_by`)";
}
// check if default field was over written
if (!isset($this->fieldsNames[$view]['modified_by']))
{
$db_ .= "," . PHP_EOL . $this->_t(1) . "KEY `idx_modifiedby` (`modified_by`)";
}
// check if default field was over written
if (!isset($this->fieldsNames[$view]['published']))
{
$db_ .= "," . PHP_EOL . $this->_t(1) . "KEY `idx_state` (`published`)";
}
if (isset($this->dbKeys[$view]) && ComponentbuilderHelper::checkArray($this->dbKeys[$view]))
{
foreach ($this->dbKeys[$view] as $nr => $key)
{
$db_ .= "," . PHP_EOL . $this->_t(1) . "KEY `idx_" . $key . "` (`" . $key . "`)";
$check_keys_set[$key] = $key;
}
}
// check if view has access
if (!isset($check_keys_set['access']) && isset($this->accessBuilder[$view]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view]))
{
$db_ .= "," . PHP_EOL . $this->_t(1) . "KEY `idx_access` (`access`)";
}
// check if default field was over written
if (!isset($check_keys_set['checked_out']))
{
$db_ .= "," . PHP_EOL . $this->_t(1) . "KEY `idx_checkout` (`checked_out`)";
}
// check if default field was over written
if (!isset($check_keys_set['created_by']))
{
$db_ .= "," . PHP_EOL . $this->_t(1) . "KEY `idx_createdby` (`created_by`)";
}
// check if default field was over written
if (!isset($check_keys_set['modified_by']))
{
$db_ .= "," . PHP_EOL . $this->_t(1) . "KEY `idx_modifiedby` (`modified_by`)";
}
// check if default field was over written
if (!isset($check_keys_set['published']))
{
$db_ .= "," . PHP_EOL . $this->_t(1) . "KEY `idx_state` (`published`)";
}
// easy bucket
$easy = array();
// get the mysql table settings
@ -11561,17 +11592,31 @@ class Interpretation extends Fields
// set component name
$component = $this->componentCodeName;
// allways load these
$allow = array();
$allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the form.";
$allow[] = $this->_t(2) . "\$form = \$this->loadForm('com_" . $component . "." . $viewName_single . "', '" . $viewName_single . "', \$options);";
$allow[] = PHP_EOL . $this->_t(2) . "if (empty(\$form))";
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "return false;";
$allow[] = $this->_t(2) . "}";
$getForm = array();
$getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " // check if xpath was set in options";
$getForm[] = $this->_t(2) . "\$xpath = false;";
$getForm[] = $this->_t(2) . "if (isset(\$options['xpath']))";
$getForm[] = $this->_t(2) . "{";
$getForm[] = $this->_t(3) . "\$xpath = \$options['xpath'];";
$getForm[] = $this->_t(3) . "unset(\$options['xpath']);";
$getForm[] = $this->_t(2) . "}";
$getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " // check if clear form was set in options";
$getForm[] = $this->_t(2) . "\$clear = false;";
$getForm[] = $this->_t(2) . "if (isset(\$options['clear']))";
$getForm[] = $this->_t(2) . "{";
$getForm[] = $this->_t(3) . "\$clear = \$options['clear'];";
$getForm[] = $this->_t(3) . "unset(\$options['clear']);";
$getForm[] = $this->_t(2) . "}";
$getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the form.";
$getForm[] = $this->_t(2) . "\$form = \$this->loadForm('com_" . $component . "." . $viewName_single . "', '" . $viewName_single . "', \$options, \$clear, \$xpath);";
$getForm[] = PHP_EOL . $this->_t(2) . "if (empty(\$form))";
$getForm[] = $this->_t(2) . "{";
$getForm[] = $this->_t(3) . "return false;";
$getForm[] = $this->_t(2) . "}";
// load license locker
if ($this->componentData->add_license && $this->componentData->license_type == 3 && isset($this->fileContentDynamic[$viewName_single][$this->hhh . 'BOOLMETHOD' . $this->hhh]))
{
$allow[] = $this->checkStatmentLicenseLocked($this->fileContentDynamic[$viewName_single][$this->hhh . 'BOOLMETHOD' . $this->hhh]);
$getForm[] = $this->checkStatmentLicenseLocked($this->fileContentDynamic[$viewName_single][$this->hhh . 'BOOLMETHOD' . $this->hhh]);
}
// setup correct core target
$coreLoad = false;
@ -11594,152 +11639,152 @@ class Interpretation extends Fields
$otherView = $viewName_single;
}
// setup the category script
$allow[] = PHP_EOL . $this->_t(2) . "\$jinput = JFactory::getApplication()->input;";
$allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.";
$allow[] = $this->_t(2) . "if (\$jinput->get('a_id'))";
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "\$id = \$jinput->get('a_id', 0, 'INT');";
$allow[] = $this->_t(2) . "}";
$allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " The back end uses id so we use that the rest of the time and set it to 0 by default.";
$allow[] = $this->_t(2) . "else";
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "\$id = \$jinput->get('id', 0, 'INT');";
$allow[] = $this->_t(2) . "}";
$allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Determine correct permissions to check.";
$allow[] = $this->_t(2) . "if (\$this->getState('" . $viewName_single . ".id'))";
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "\$id = \$this->getState('" . $viewName_single . ".id');";
$allow[] = PHP_EOL . $this->_t(3) . "\$catid = 0;";
$allow[] = $this->_t(3) . "if (isset(\$this->getItem(\$id)->catid))";
$allow[] = $this->_t(3) . "{";
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " set category id";
$allow[] = $this->_t(4) . "\$catid = \$this->getItem(\$id)->catid;";
$allow[] = PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Existing record. Can only edit in selected categories.";
$allow[] = $this->_t(4) . "\$form->setFieldAttribute('catid', 'action', 'core.edit');";
$allow[] = PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Existing record. Can only edit own items in selected categories.";
$allow[] = $this->_t(4) . "\$form->setFieldAttribute('catid', 'action', 'core.edit.own');";
$allow[] = $this->_t(3) . "}";
$allow[] = $this->_t(2) . "}";
$allow[] = $this->_t(2) . "else";
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " New record. Can only create in selected categories.";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('catid', 'action', 'core.create');";
$allow[] = $this->_t(2) . "}";
$allow[] = PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();";
$allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check for existing item.";
$allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit State access controls.";
$getForm[] = PHP_EOL . $this->_t(2) . "\$jinput = JFactory::getApplication()->input;";
$getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.";
$getForm[] = $this->_t(2) . "if (\$jinput->get('a_id'))";
$getForm[] = $this->_t(2) . "{";
$getForm[] = $this->_t(3) . "\$id = \$jinput->get('a_id', 0, 'INT');";
$getForm[] = $this->_t(2) . "}";
$getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " The back end uses id so we use that the rest of the time and set it to 0 by default.";
$getForm[] = $this->_t(2) . "else";
$getForm[] = $this->_t(2) . "{";
$getForm[] = $this->_t(3) . "\$id = \$jinput->get('id', 0, 'INT');";
$getForm[] = $this->_t(2) . "}";
$getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Determine correct permissions to check.";
$getForm[] = $this->_t(2) . "if (\$this->getState('" . $viewName_single . ".id'))";
$getForm[] = $this->_t(2) . "{";
$getForm[] = $this->_t(3) . "\$id = \$this->getState('" . $viewName_single . ".id');";
$getForm[] = PHP_EOL . $this->_t(3) . "\$catid = 0;";
$getForm[] = $this->_t(3) . "if (isset(\$this->getItem(\$id)->catid))";
$getForm[] = $this->_t(3) . "{";
$getForm[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " set category id";
$getForm[] = $this->_t(4) . "\$catid = \$this->getItem(\$id)->catid;";
$getForm[] = PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Existing record. Can only edit in selected categories.";
$getForm[] = $this->_t(4) . "\$form->setFieldAttribute('catid', 'action', 'core.edit');";
$getForm[] = PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Existing record. Can only edit own items in selected categories.";
$getForm[] = $this->_t(4) . "\$form->setFieldAttribute('catid', 'action', 'core.edit.own');";
$getForm[] = $this->_t(3) . "}";
$getForm[] = $this->_t(2) . "}";
$getForm[] = $this->_t(2) . "else";
$getForm[] = $this->_t(2) . "{";
$getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " New record. Can only create in selected categories.";
$getForm[] = $this->_t(3) . "\$form->setFieldAttribute('catid', 'action', 'core.create');";
$getForm[] = $this->_t(2) . "}";
$getForm[] = PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();";
$getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check for existing item.";
$getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit State access controls.";
// check if the item has permissions.
if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.state']]))
{
$allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$allow[] = $this->_t(3) . "|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_list . ".category.' . (int) \$catid))";
$allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "')))";
$getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$getForm[] = $this->_t(3) . "|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_list . ".category.' . (int) \$catid))";
$getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "')))";
}
else
{
$allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$allow[] = $this->_t(3) . "|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_list . ".category.' . (int) \$catid))";
$allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "')))";
$getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$getForm[] = $this->_t(3) . "|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_list . ".category.' . (int) \$catid))";
$getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "')))";
}
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display.";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('ordering', 'disabled', 'true');";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('published', 'disabled', 'true');";
$allow[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving.";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('ordering', 'filter', 'unset');";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('published', 'filter', 'unset');";
$allow[] = $this->_t(2) . "}";
$getForm[] = $this->_t(2) . "{";
$getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display.";
$getForm[] = $this->_t(3) . "\$form->setFieldAttribute('ordering', 'disabled', 'true');";
$getForm[] = $this->_t(3) . "\$form->setFieldAttribute('published', 'disabled', 'true');";
$getForm[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving.";
$getForm[] = $this->_t(3) . "\$form->setFieldAttribute('ordering', 'filter', 'unset');";
$getForm[] = $this->_t(3) . "\$form->setFieldAttribute('published', 'filter', 'unset');";
$getForm[] = $this->_t(2) . "}";
}
else
{
$allow[] = PHP_EOL . $this->_t(2) . "\$jinput = JFactory::getApplication()->input;";
$allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.";
$allow[] = $this->_t(2) . "if (\$jinput->get('a_id'))";
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "\$id = \$jinput->get('a_id', 0, 'INT');";
$allow[] = $this->_t(2) . "}";
$allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " The back end uses id so we use that the rest of the time and set it to 0 by default.";
$allow[] = $this->_t(2) . "else";
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "\$id = \$jinput->get('id', 0, 'INT');";
$allow[] = $this->_t(2) . "}";
$allow[] = PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();";
$allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check for existing item.";
$allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit State access controls.";
$getForm[] = PHP_EOL . $this->_t(2) . "\$jinput = JFactory::getApplication()->input;";
$getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.";
$getForm[] = $this->_t(2) . "if (\$jinput->get('a_id'))";
$getForm[] = $this->_t(2) . "{";
$getForm[] = $this->_t(3) . "\$id = \$jinput->get('a_id', 0, 'INT');";
$getForm[] = $this->_t(2) . "}";
$getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " The back end uses id so we use that the rest of the time and set it to 0 by default.";
$getForm[] = $this->_t(2) . "else";
$getForm[] = $this->_t(2) . "{";
$getForm[] = $this->_t(3) . "\$id = \$jinput->get('id', 0, 'INT');";
$getForm[] = $this->_t(2) . "}";
$getForm[] = PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();";
$getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check for existing item.";
$getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit State access controls.";
// check if the item has permissions.
if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.state']]))
{
$allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "')))";
$getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "')))";
}
else
{
$allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "')))";
$getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "')))";
}
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display.";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('ordering', 'disabled', 'true');";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('published', 'disabled', 'true');";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving.";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('ordering', 'filter', 'unset');";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('published', 'filter', 'unset');";
$allow[] = $this->_t(2) . "}";
$getForm[] = $this->_t(2) . "{";
$getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display.";
$getForm[] = $this->_t(3) . "\$form->setFieldAttribute('ordering', 'disabled', 'true');";
$getForm[] = $this->_t(3) . "\$form->setFieldAttribute('published', 'disabled', 'true');";
$getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving.";
$getForm[] = $this->_t(3) . "\$form->setFieldAttribute('ordering', 'filter', 'unset');";
$getForm[] = $this->_t(3) . "\$form->setFieldAttribute('published', 'filter', 'unset');";
$getForm[] = $this->_t(2) . "}";
}
$allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " If this is a new item insure the greated by is set.";
$allow[] = $this->_t(2) . "if (0 == \$id)";
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set the created_by to this user";
$allow[] = $this->_t(3) . "\$form->setValue('created_by', null, \$user->id);";
$allow[] = $this->_t(2) . "}";
$allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit Creaded By access controls.";
$getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " If this is a new item insure the greated by is set.";
$getForm[] = $this->_t(2) . "if (0 == \$id)";
$getForm[] = $this->_t(2) . "{";
$getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set the created_by to this user";
$getForm[] = $this->_t(3) . "\$form->setValue('created_by', null, \$user->id);";
$getForm[] = $this->_t(2) . "}";
$getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit Creaded By access controls.";
// check if the item has permissions.
if ($coreLoad && isset($core['core.edit.created_by']) && isset($this->permissionBuilder[$core['core.edit.created_by']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.created_by']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.created_by']]))
{
$allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.created_by'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.created_by'] . "', 'com_" . $component . "')))";
$getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.created_by'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.created_by'] . "', 'com_" . $component . "')))";
}
else
{
$allow[] = $this->_t(2) . "if (!\$user->authorise('core.edit.created_by', 'com_" . $component . "'))";
$getForm[] = $this->_t(2) . "if (!\$user->authorise('core.edit.created_by', 'com_" . $component . "'))";
}
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display.";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('created_by', 'disabled', 'true');";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display.";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('created_by', 'readonly', 'true');";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving.";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('created_by', 'filter', 'unset');";
$allow[] = $this->_t(2) . "}";
$allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit Creaded Date access controls.";
$getForm[] = $this->_t(2) . "{";
$getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display.";
$getForm[] = $this->_t(3) . "\$form->setFieldAttribute('created_by', 'disabled', 'true');";
$getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display.";
$getForm[] = $this->_t(3) . "\$form->setFieldAttribute('created_by', 'readonly', 'true');";
$getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving.";
$getForm[] = $this->_t(3) . "\$form->setFieldAttribute('created_by', 'filter', 'unset');";
$getForm[] = $this->_t(2) . "}";
$getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit Creaded Date access controls.";
// check if the item has permissions.
if ($coreLoad && isset($core['core.edit.created']) && isset($this->permissionBuilder[$core['core.edit.created']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.created']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.created']]))
{
$allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.created'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.created'] . "', 'com_" . $component . "')))";
$getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.created'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.created'] . "', 'com_" . $component . "')))";
}
else
{
$allow[] = $this->_t(2) . "if (!\$user->authorise('core.edit.created', 'com_" . $component . "'))";
$getForm[] = $this->_t(2) . "if (!\$user->authorise('core.edit.created', 'com_" . $component . "'))";
}
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display.";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('created', 'disabled', 'true');";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving.";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('created', 'filter', 'unset');";
$allow[] = $this->_t(2) . "}";
$getForm[] = $this->_t(2) . "{";
$getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display.";
$getForm[] = $this->_t(3) . "\$form->setFieldAttribute('created', 'disabled', 'true');";
$getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving.";
$getForm[] = $this->_t(3) . "\$form->setFieldAttribute('created', 'filter', 'unset');";
$getForm[] = $this->_t(2) . "}";
// check if the item has access permissions.
if ($coreLoad && isset($core['core.edit.access']) && isset($this->permissionBuilder[$core['core.edit.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.access']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.access']]))
{
$allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit Access 'access' controls.";
$allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.access'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.access'] . "', 'com_" . $component . "')))";
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display.";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('access', 'disabled', 'true');";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving.";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('access', 'filter', 'unset');";
$allow[] = $this->_t(2) . "}";
$getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit Access 'access' controls.";
$getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.access'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.access'] . "', 'com_" . $component . "')))";
$getForm[] = $this->_t(2) . "{";
$getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display.";
$getForm[] = $this->_t(3) . "\$form->setFieldAttribute('access', 'disabled', 'true');";
$getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving.";
$getForm[] = $this->_t(3) . "\$form->setFieldAttribute('access', 'filter', 'unset');";
$getForm[] = $this->_t(2) . "}";
}
// handel the fields permissions
if (isset($this->permissionFields[$viewName_single]) && ComponentbuilderHelper::checkArray($this->permissionFields[$viewName_single]))
@ -11751,13 +11796,13 @@ class Interpretation extends Fields
switch ($permission_option)
{
case 'edit':
$this->setPermissionEditFields($allow, $viewName_single, $fieldName, $fieldType, $component);
$this->setPermissionEditFields($getForm, $viewName_single, $fieldName, $fieldType, $component);
break;
case 'access':
$this->setPermissionAccessFields($allow, $viewName_single, $fieldName, $fieldType, $component);
$this->setPermissionAccessFields($getForm, $viewName_single, $fieldName, $fieldType, $component);
break;
case 'view':
$this->setPermissionViewFields($allow, $viewName_single, $fieldName, $fieldType, $component);
$this->setPermissionViewFields($getForm, $viewName_single, $fieldName, $fieldType, $component);
break;
case 'edit.own':
case 'access.own':
@ -11768,55 +11813,59 @@ class Interpretation extends Fields
}
}
// add the redirect trick to set the field of origin
$allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Only load these values if no id is found";
$allow[] = $this->_t(2) . "if (0 == \$id)";
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set redirected view name";
$allow[] = $this->_t(3) . "\$redirectedView = \$jinput->get('ref', null, 'STRING');";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set field name (or fall back to view name)";
$allow[] = $this->_t(3) . "\$redirectedField = \$jinput->get('field', \$redirectedView, 'STRING');";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set redirected view id";
$allow[] = $this->_t(3) . "\$redirectedId = \$jinput->get('refid', 0, 'INT');";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set field id (or fall back to redirected view id)";
$allow[] = $this->_t(3) . "\$redirectedValue = \$jinput->get('field_id', \$redirectedId, 'INT');";
$allow[] = $this->_t(3) . "if (0 != \$redirectedValue && \$redirectedField)";
$allow[] = $this->_t(3) . "{";
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Now set the local-redirected field default value";
$allow[] = $this->_t(4) . "\$form->setValue(\$redirectedField, null, \$redirectedValue);";
$allow[] = $this->_t(3) . "}";
$getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Only load these values if no id is found";
$getForm[] = $this->_t(2) . "if (0 == \$id)";
$getForm[] = $this->_t(2) . "{";
$getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set redirected view name";
$getForm[] = $this->_t(3) . "\$redirectedView = \$jinput->get('ref', null, 'STRING');";
$getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set field name (or fall back to view name)";
$getForm[] = $this->_t(3) . "\$redirectedField = \$jinput->get('field', \$redirectedView, 'STRING');";
$getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set redirected view id";
$getForm[] = $this->_t(3) . "\$redirectedId = \$jinput->get('refid', 0, 'INT');";
$getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set field id (or fall back to redirected view id)";
$getForm[] = $this->_t(3) . "\$redirectedValue = \$jinput->get('field_id', \$redirectedId, 'INT');";
$getForm[] = $this->_t(3) . "if (0 != \$redirectedValue && \$redirectedField)";
$getForm[] = $this->_t(3) . "{";
$getForm[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Now set the local-redirected field default value";
$getForm[] = $this->_t(4) . "\$form->setValue(\$redirectedField, null, \$redirectedValue);";
$getForm[] = $this->_t(3) . "}";
// load custom script if found
$allow[] = $this->_t(2) . "}" . $this->getCustomScriptBuilder('php_getform', $viewName_single, PHP_EOL);
$getForm[] = $this->_t(2) . "}" . $this->getCustomScriptBuilder('php_getform', $viewName_single, PHP_EOL);
// setup the default script
$allow[] = $this->_t(2) . "return \$form;";
$getForm[] = $this->_t(2) . "return \$form;";
return implode(PHP_EOL, $allow);
return implode(PHP_EOL, $getForm);
}
protected function setPermissionEditFields(&$allow, $viewName_single, $fieldName, $fieldType, $component)
{
$allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit " . ComponentbuilderHelper::safeString($fieldName, 'W') . " access controls.";
$allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $viewName_single . ".edit." . $fieldName . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $viewName_single . ".edit." . $fieldName . "', 'com_" . $component . "')))";
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display.";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'disabled', 'true');";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display.";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'readonly', 'true');";
if ('radio' === $fieldType || 'repeatable' === $fieldType)
// only for fields that can be edited
if (!ComponentbuilderHelper::fieldCheck($fieldType, 'spacer'))
{
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable radio button for display.";
$allow[] = $this->_t(3) . "\$class = \$form->getFieldAttribute('" . $fieldName . "', 'class', '');";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'class', \$class.' disabled no-click');";
$allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit " . ComponentbuilderHelper::safeString($fieldName, 'W') . " access controls.";
$allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $viewName_single . ".edit." . $fieldName . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $viewName_single . ".edit." . $fieldName . "', 'com_" . $component . "')))";
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display.";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'disabled', 'true');";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display.";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'readonly', 'true');";
if ('radio' === $fieldType || 'repeatable' === $fieldType)
{
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable radio button for display.";
$allow[] = $this->_t(3) . "\$class = \$form->getFieldAttribute('" . $fieldName . "', 'class', '');";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'class', \$class.' disabled no-click');";
}
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " If there is no value continue.";
$allow[] = $this->_t(3) . "if (!\$form->getValue('" . $fieldName . "'))";
$allow[] = $this->_t(3) . "{";
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Disable fields while saving.";
$allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName . "', 'filter', 'unset');";
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Disable fields while saving.";
$allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName . "', 'required', 'false');";
$allow[] = $this->_t(3) . "}";
$allow[] = $this->_t(2) . "}";
}
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " If there is no value continue.";
$allow[] = $this->_t(3) . "if (!\$form->getValue('" . $fieldName . "'))";
$allow[] = $this->_t(3) . "{";
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Disable fields while saving.";
$allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName . "', 'filter', 'unset');";
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Disable fields while saving.";
$allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName . "', 'required', 'false');";
$allow[] = $this->_t(3) . "}";
$allow[] = $this->_t(2) . "}";
}
protected function setPermissionAccessFields(&$allow, $viewName_single, $fieldName, $fieldType, $component)
@ -11832,30 +11881,43 @@ class Interpretation extends Fields
protected function setPermissionViewFields(&$allow, $viewName_single, $fieldName, $fieldType, $component)
{
$allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on View " . ComponentbuilderHelper::safeString($fieldName, 'W') . " access controls.";
$allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $viewName_single . ".view." . $fieldName . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $viewName_single . ".view." . $fieldName . "', 'com_" . $component . "')))";
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Make the field hidded.";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'type', 'hidden');";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " If there is no value continue.";
$allow[] = $this->_t(3) . "if (!(\$val = \$form->getValue('" . $fieldName . "')))";
$allow[] = $this->_t(3) . "{";
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Disable fields while saving.";
$allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName . "', 'filter', 'unset');";
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Disable fields while saving.";
$allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName . "', 'required', 'false');";
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Make sure";
$allow[] = $this->_t(4) . "\$form->setValue('" . $fieldName . "', null, '');";
$allow[] = $this->_t(3) . "}";
$allow[] = $this->_t(3) . "elseif (" . ucfirst($component) . "Helper::checkArray(\$val))";
$allow[] = $this->_t(3) . "{";
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " We have to unset then (TODO)";
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Hiddend field can not handel array value";
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Even if we convert to json we get an error";
$allow[] = $this->_t(4) . "\$form->removeField('" . $fieldName . "');";
$allow[] = $this->_t(3) . "}";
$allow[] = $this->_t(2) . "}";
if (ComponentbuilderHelper::fieldCheck($fieldType, 'spacer'))
{
$allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on View " . ComponentbuilderHelper::safeString($fieldName, 'W') . " access controls.";
$allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $viewName_single . ".view." . $fieldName . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $viewName_single . ".view." . $fieldName . "', 'com_" . $component . "')))";
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Remove the field";
$allow[] = $this->_t(3) . "\$form->removeField('" . $fieldName . "');";
$allow[] = $this->_t(2) . "}";
}
else
{
$allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on View " . ComponentbuilderHelper::safeString($fieldName, 'W') . " access controls.";
$allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $viewName_single . ".view." . $fieldName . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
$allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $viewName_single . ".view." . $fieldName . "', 'com_" . $component . "')))";
$allow[] = $this->_t(2) . "{";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Make the field hidded.";
$allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'type', 'hidden');";
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " If there is no value continue.";
$allow[] = $this->_t(3) . "if (!(\$val = \$form->getValue('" . $fieldName . "')))";
$allow[] = $this->_t(3) . "{";
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Disable fields while saving.";
$allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName . "', 'filter', 'unset');";
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Disable fields while saving.";
$allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName . "', 'required', 'false');";
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Make sure";
$allow[] = $this->_t(4) . "\$form->setValue('" . $fieldName . "', null, '');";
$allow[] = $this->_t(3) . "}";
$allow[] = $this->_t(3) . "elseif (" . ucfirst($component) . "Helper::checkArray(\$val))";
$allow[] = $this->_t(3) . "{";
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " We have to unset then (TODO)";
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Hiddend field can not handel array value";
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Even if we convert to json we get an error";
$allow[] = $this->_t(4) . "\$form->removeField('" . $fieldName . "');";
$allow[] = $this->_t(3) . "}";
$allow[] = $this->_t(2) . "}";
}
}
public function setJmodelAdminAllowEdit($viewName_single, $viewName_list)
@ -13796,9 +13858,9 @@ class Interpretation extends Fields
{
if (!isset($this->customAdminAdded[$menu['settings']->code]))
{
if ($custom = $this->setCustomAdminSubMenu($view, $codeName, $lang, $nr, $menu, 'customView'))
if (($_custom = $this->setCustomAdminSubMenu($view, $codeName, $lang, $nr, $menu, 'customView')) !== false)
{
break;
$custom .= $_custom;
}
}
}
@ -13807,10 +13869,9 @@ class Interpretation extends Fields
{
foreach ($this->componentData->custommenus as $nr => $menu)
{
if ($custom2 = $this->setCustomAdminSubMenu($view, $codeName, $lang, $nr, $menu, 'customMenu'))
if (($_custom = $this->setCustomAdminSubMenu($view, $codeName, $lang, $nr, $menu, 'customMenu')) !== false)
{
$custom = $custom . $custom2;
break;
$custom .= $_custom;
}
}
}
@ -13833,7 +13894,6 @@ class Interpretation extends Fields
$nameList = $menu['settings']->code;
$nameUpper = $menu['settings']->CODE;
}
if (isset($menu['submenu']) && $menu['submenu'] == 1 && $view['adminview'] == $menu['before'])
{
// setup access defaults