if (($target_ = $this->component->get($targets[$t])) !== null
&& ArrayHelper::check($target_))
{
// search the target views
$dashboard = (array) array_filter(
$target_,
function ($view) use ($id, $t, $types) {
if (isset($view[$types[$t]])
&& $id == $view[$types[$t]])
{
return true;
}
return false;
}
);
// set dashboard
if (ArrayHelper::check($dashboard))
{
$dashboard = array_values($dashboard)[0];
}
// check if view was found (this should be true)
if (isset($dashboard['settings'])
&& isset($dashboard['settings']->{$keys[$t]}))
{
$this->registry->set('build.dashboard',
StringHelper::safe(
$dashboard['settings']->{$keys[$t]}
)
);
$this->registry->set('build.dashboard.type',
$targets[$t]
);
}
else
{
// set massage that something is wrong
$this->app->enqueueMessage(
Text::_('<hr /><h3>Dashboard Error</h3>'),
'Error'
);
$this->app->enqueueMessage(
Text::sprintf('The <b>%s</b> (<b>%s</b>) is not available in your component! Please insure to only used %s, for a dynamic dashboard, that are still linked to your component.',
Text::sprintf('The <b>%s</b> (<b>%s</b>) is not available in your component! Please insure to only used %s, for a dynamic dashboard, that are still linked to your component.',