';
@@ -5993,7 +6043,7 @@ class Compiler
$this->langContent['admin'][$this->langPrefix.'_KEEP_ORIGINAL_STATE'] = "- Keep Original State -";
$this->langContent['admin'][$this->langPrefix.'_KEEP_ORIGINAL_ACCESS'] = "- Keep Original Access -";
$this->langContent['admin'][$this->langPrefix.'_KEEP_ORIGINAL_CATEGORY'] = "- Keep Original Category -";
- if ($this->componentData->add_license && $this->componentData->license_type == 2)
+ if ($this->componentData->add_license && $this->componentData->license_type == 3)
{
$this->langContent['admin']['NIE_REG_NIE'] = "
Lincense not set for ".$this->componentData->name.".
Notify your administrator!
The lincense can be obtained from ".$this->componentData->companyname.".
";
}
@@ -6615,6 +6665,13 @@ class Compiler
// set the linked view tabs
$linkedTab = array();
$keys = array();
+ // setup correct core target
+ $coreLoad = false;
+ if (isset($this->permissionCore[$viewName_single]))
+ {
+ $core = $this->permissionCore[$viewName_single];
+ $coreLoad = true;
+ }
if (isset($this->linkedAdminViews[$viewName_single]) && ComponentbuilderHelper::checkArray($this->linkedAdminViews[$viewName_single]))
{
foreach ($this->linkedAdminViews[$viewName_single] as $linkedView)
@@ -6761,6 +6818,8 @@ class Compiler
{
// set layout code name
$layoutCodeName = $tabCodeName.'_fullwidth';
+ // set identifiers
+ $linkedViewIdentifier[$linkedViewId] = $tabCodeName;
//set function name
$codeName = ComponentbuilderHelper::safeString(ComponentbuilderHelper::randomkey(3).$tabCodeName);
// set as items layout
@@ -6856,8 +6915,40 @@ class Compiler
{
$body .= "\n\n\t '".$tabCodeName."')); ?>";
}
+ // if this is a linked view set permissions
+ $closeIT = false;
+ if(in_array($tabCodeName,$linkedViewIdentifier))
+ {
+ // get view name
+ $linkedViewId = array_search($tabCodeName,$linkedViewIdentifier);
+ $linkedViewData = $this->getAdminViewData($linkedViewId);
+ $linkedCodeName = ComponentbuilderHelper::safeString($linkedViewData->name_single);
+ // setup correct core target
+ $coreLoadLinked = false;
+ if (isset($this->permissionCore[$linkedCodeName]))
+ {
+ $coreLinked = $this->permissionCore[$linkedCodeName];
+ $coreLoadLinked = true;
+ }
+ // check if the item has permissions.
+ if ($coreLoadLinked && isset($coreLinked['core.access']) && isset($this->permissionBuilder['global'][$coreLinked['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$coreLinked['core.access']]) && in_array($linkedCodeName,$this->permissionBuilder['global'][$coreLinked['core.access']]))
+ {
+ $body .= "\n\n\tcanDo->get('".$coreLinked['core.access']."')) : ?>";
+ $closeIT = true;
+ }
+ else
+ {
+ $body .= "\n";
+ }
+ // insure clear
+ unset($coreLoadLinked,$coreLinked,$linkedViewData);
+ }
+ else
+ {
+ $body .= "\n";
+ }
// start tab
- $body .= "\n\n\t";
+ $body .= "\n\t";
// add the main
$body .= "\n\t\t".'';
$body .= $main;
@@ -6870,6 +6961,10 @@ class Compiler
$body .= "\n\t\t
";
}
$body .= "\n\t";
+ if($closeIT)
+ {
+ $body .= "\n\t";
+ }
// set counter
$tabCounter++;
}
@@ -6913,8 +7008,25 @@ class Compiler
$this->setLayout($viewName_single, $tabCodeNameLeft, $items_one, 'layoutpublished');
$this->setLayout($viewName_single, $tabCodeNameRight, $items_two, 'layoutpublished');
}
+ // check if the item has permissions.
+ $publishingPer = array();
+ $allToBeChekced = array('core.delete','core.edit.created_by','core.edit.state','core.edit.created');
+ foreach ($allToBeChekced as $core_permission)
+ {
+ if ($coreLoad && isset($core[$core_permission]) && isset($this->permissionBuilder['global'][$core[$core_permission]]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core[$core_permission]]) && in_array($viewName_single,$this->permissionBuilder['global'][$core[$core_permission]]))
+ {
+ // set permissions.
+ $publishingPer[] = "\$this->canDo->get('".$core[$core_permission]."')";
+ }
+ else
+ {
+ // set permissions.
+ $publishingPer[] = "\$this->canDo->get('".$core_permission."')";
+ }
+ }
+ $body .= "\n\n\t";
// set the default publishing tab
- $body .= "\n\n\t";
+ $body .= "\n\t";
$body .= "\n\t\t".'";
$body .= "\n\t";
+ $body .= "\n\t";
// make sure we dont load it to a view with the name component
if ($viewName_single != 'component')
{
@@ -13476,19 +13589,19 @@ class Compiler
$this->configFieldSets[] = "\t\t".'label="'.$lang.'_GLOBAL_LABEL"';
$this->configFieldSets[] = "\t\t".'description="'.$lang.'_GLOBAL_DESC">';
// set application update License Key
- if ($this->componentData->add_license)
+ if ($this->componentData->add_license && 1 != $this->componentData->license_type)
{
// set licence type switch
switch ($this->componentData->license_type)
{
- case 1:
+ case 2:
// for updates
$this->langContent[$this->lang][$lang.'_LICENSE_KEY_NOTE_LABEL']= "Your License Key";
$this->langContent[$this->lang][$lang.'_LICENSE_KEY_NOTE_DESC'] = "To get updates you must add the license key here that you recieved from ".$this->componentData->companyname;
// set the field
$this->configFieldSets[] = "\t\t".'';
break;
- case 2:
+ case 3:
// with vdm to lock down ownership
$this->langContent[$this->lang][$lang.'_LICENSE_KEY_NOTE_LABEL']= "Your License Key";
$this->langContent[$this->lang][$lang.'_LICENSE_KEY_NOTE_DESC'] = "To use this component you must add the license key here that you recieved from ".$this->componentData->companyname;
@@ -14214,10 +14327,10 @@ for developing fast and powerful web interfaces. For more info visit