Continued formatting of JCB code
This commit is contained in:
@ -37,11 +37,11 @@ class ComponentbuilderModelComponentbuilder extends JModelList
|
||||
{
|
||||
public function getIcons()
|
||||
{
|
||||
// load user for access menus
|
||||
$user = JFactory::getUser();
|
||||
// reset icon array
|
||||
// load user for access menus
|
||||
$user = JFactory::getUser();
|
||||
// reset icon array
|
||||
$icons = array();
|
||||
// view groups array
|
||||
// view groups array
|
||||
$viewGroups = array(
|
||||
'main' => array('png.compiler', 'png.joomla_component.add', 'png.joomla_components', 'png.admin_view.add', 'png.admin_views', 'png.custom_admin_view.add', 'png.custom_admin_views', 'png.site_view.add', 'png.site_views', 'png.template.add', 'png.templates', 'png.layout.add', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.libraries', 'png.snippet.add', 'png.snippets', 'png.field.add', 'png.fields', 'png.fields.catid', 'png.fieldtype.add', 'png.fieldtypes', 'png.fieldtypes.catid', 'png.language_translations', 'png.ftps', 'png.help_document.add', 'png.help_documents')
|
||||
);
|
||||
@ -177,92 +177,92 @@ class ComponentbuilderModelComponentbuilder extends JModelList
|
||||
'libraries_files_folders_urls.access' => 'library_files_folders_urls.access',
|
||||
'library_files_folders_urls.access' => 'library_files_folders_urls.access');
|
||||
foreach($viewGroups as $group => $views)
|
||||
{
|
||||
{
|
||||
$i = 0;
|
||||
if (ComponentbuilderHelper::checkArray($views))
|
||||
{
|
||||
{
|
||||
foreach($views as $view)
|
||||
{
|
||||
$add = false;
|
||||
if (strpos($view,'.') !== false)
|
||||
{
|
||||
$dwd = explode('.', $view);
|
||||
if (count($dwd) == 3)
|
||||
{
|
||||
list($type, $name, $action) = $dwd;
|
||||
}
|
||||
elseif (count($dwd) == 2)
|
||||
{
|
||||
list($type, $name) = $dwd;
|
||||
$action = false;
|
||||
}
|
||||
if ($action)
|
||||
{
|
||||
$viewName = $name;
|
||||
switch($action)
|
||||
{
|
||||
case 'add':
|
||||
$url ='index.php?option=com_componentbuilder&view='.$name.'&layout=edit';
|
||||
$image = $name.'_'.$action.'.'.$type;
|
||||
$alt = $name.' '.$action;
|
||||
$name = 'COM_COMPONENTBUILDER_DASHBOARD_'.ComponentbuilderHelper::safeString($name,'U').'_ADD';
|
||||
$add = true;
|
||||
break;
|
||||
default:
|
||||
$url = 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.'.$name;
|
||||
$image = $name.'_'.$action.'.'.$type;
|
||||
$alt = $name.' '.$action;
|
||||
$name = 'COM_COMPONENTBUILDER_DASHBOARD_'.ComponentbuilderHelper::safeString($name,'U').'_'.ComponentbuilderHelper::safeString($action,'U');
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$viewName = $name;
|
||||
$alt = $name;
|
||||
$url = 'index.php?option=com_componentbuilder&view='.$name;
|
||||
$image = $name.'.'.$type;
|
||||
$name = 'COM_COMPONENTBUILDER_DASHBOARD_'.ComponentbuilderHelper::safeString($name,'U');
|
||||
$hover = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$viewName = $view;
|
||||
$alt = $view;
|
||||
$url = 'index.php?option=com_componentbuilder&view='.$view;
|
||||
$image = $view.'.png';
|
||||
$name = ucwords($view).'<br /><br />';
|
||||
$hover = false;
|
||||
}
|
||||
// first make sure the view access is set
|
||||
if (ComponentbuilderHelper::checkArray($viewAccess))
|
||||
{
|
||||
{
|
||||
$dwd = explode('.', $view);
|
||||
if (count($dwd) == 3)
|
||||
{
|
||||
list($type, $name, $action) = $dwd;
|
||||
}
|
||||
elseif (count($dwd) == 2)
|
||||
{
|
||||
list($type, $name) = $dwd;
|
||||
$action = false;
|
||||
}
|
||||
if ($action)
|
||||
{
|
||||
$viewName = $name;
|
||||
switch($action)
|
||||
{
|
||||
case 'add':
|
||||
$url ='index.php?option=com_componentbuilder&view='.$name.'&layout=edit';
|
||||
$image = $name.'_'.$action.'.'.$type;
|
||||
$alt = $name.' '.$action;
|
||||
$name = 'COM_COMPONENTBUILDER_DASHBOARD_'.ComponentbuilderHelper::safeString($name,'U').'_ADD';
|
||||
$add = true;
|
||||
break;
|
||||
default:
|
||||
$url = 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.'.$name;
|
||||
$image = $name.'_'.$action.'.'.$type;
|
||||
$alt = $name.' '.$action;
|
||||
$name = 'COM_COMPONENTBUILDER_DASHBOARD_'.ComponentbuilderHelper::safeString($name,'U').'_'.ComponentbuilderHelper::safeString($action,'U');
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$viewName = $name;
|
||||
$alt = $name;
|
||||
$url = 'index.php?option=com_componentbuilder&view='.$name;
|
||||
$image = $name.'.'.$type;
|
||||
$name = 'COM_COMPONENTBUILDER_DASHBOARD_'.ComponentbuilderHelper::safeString($name,'U');
|
||||
$hover = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$viewName = $view;
|
||||
$alt = $view;
|
||||
$url = 'index.php?option=com_componentbuilder&view='.$view;
|
||||
$image = $view.'.png';
|
||||
$name = ucwords($view).'<br /><br />';
|
||||
$hover = false;
|
||||
}
|
||||
// first make sure the view access is set
|
||||
if (ComponentbuilderHelper::checkArray($viewAccess))
|
||||
{
|
||||
// setup some defaults
|
||||
$dashboard_add = false;
|
||||
$dashboard_list = false;
|
||||
$accessTo = '';
|
||||
$accessAdd = '';
|
||||
// acces checking start
|
||||
$accessCreate = (isset($viewAccess[$viewName.'.create'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.create']):false;
|
||||
$accessAccess = (isset($viewAccess[$viewName.'.access'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.access']):false;
|
||||
$accessTo = '';
|
||||
$accessAdd = '';
|
||||
// acces checking start
|
||||
$accessCreate = (isset($viewAccess[$viewName.'.create'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.create']):false;
|
||||
$accessAccess = (isset($viewAccess[$viewName.'.access'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.access']):false;
|
||||
// set main controllers
|
||||
$accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.dashboard_add']):false;
|
||||
$accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.dashboard_list']):false;
|
||||
// check for adding access
|
||||
if ($add && $accessCreate)
|
||||
{
|
||||
$accessAdd = $viewAccess[$viewName.'.create'];
|
||||
}
|
||||
elseif ($add)
|
||||
{
|
||||
$accessAdd = 'core.create';
|
||||
}
|
||||
// check if acces to view is set
|
||||
if ($accessAccess)
|
||||
{
|
||||
$accessTo = $viewAccess[$viewName.'.access'];
|
||||
}
|
||||
// check for adding access
|
||||
if ($add && $accessCreate)
|
||||
{
|
||||
$accessAdd = $viewAccess[$viewName.'.create'];
|
||||
}
|
||||
elseif ($add)
|
||||
{
|
||||
$accessAdd = 'core.create';
|
||||
}
|
||||
// check if acces to view is set
|
||||
if ($accessAccess)
|
||||
{
|
||||
$accessTo = $viewAccess[$viewName.'.access'];
|
||||
}
|
||||
// set main access controllers
|
||||
if ($accessDashboard_add)
|
||||
{
|
||||
@ -272,65 +272,65 @@ class ComponentbuilderModelComponentbuilder extends JModelList
|
||||
{
|
||||
$dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_componentbuilder');
|
||||
}
|
||||
if (ComponentbuilderHelper::checkString($accessAdd) && ComponentbuilderHelper::checkString($accessTo))
|
||||
{
|
||||
// check access
|
||||
if($user->authorise($accessAdd, 'com_componentbuilder') && $user->authorise($accessTo, 'com_componentbuilder') && $dashboard_add)
|
||||
{
|
||||
$icons[$group][$i] = new StdClass;
|
||||
$icons[$group][$i]->url = $url;
|
||||
$icons[$group][$i]->name = $name;
|
||||
$icons[$group][$i]->image = $image;
|
||||
$icons[$group][$i]->alt = $alt;
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($accessTo))
|
||||
{
|
||||
// check access
|
||||
if($user->authorise($accessTo, 'com_componentbuilder') && $dashboard_list)
|
||||
{
|
||||
$icons[$group][$i] = new StdClass;
|
||||
$icons[$group][$i]->url = $url;
|
||||
$icons[$group][$i]->name = $name;
|
||||
$icons[$group][$i]->image = $image;
|
||||
$icons[$group][$i]->alt = $alt;
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($accessAdd))
|
||||
{
|
||||
// check access
|
||||
if($user->authorise($accessAdd, 'com_componentbuilder') && $dashboard_add)
|
||||
{
|
||||
$icons[$group][$i] = new StdClass;
|
||||
$icons[$group][$i]->url = $url;
|
||||
$icons[$group][$i]->name = $name;
|
||||
$icons[$group][$i]->image = $image;
|
||||
$icons[$group][$i]->alt = $alt;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$icons[$group][$i] = new StdClass;
|
||||
$icons[$group][$i]->url = $url;
|
||||
$icons[$group][$i]->name = $name;
|
||||
$icons[$group][$i]->image = $image;
|
||||
$icons[$group][$i]->alt = $alt;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$icons[$group][$i] = new StdClass;
|
||||
$icons[$group][$i]->url = $url;
|
||||
$icons[$group][$i]->name = $name;
|
||||
$icons[$group][$i]->image = $image;
|
||||
$icons[$group][$i]->alt = $alt;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$icons[$group][$i] = false;
|
||||
if (ComponentbuilderHelper::checkString($accessAdd) && ComponentbuilderHelper::checkString($accessTo))
|
||||
{
|
||||
// check access
|
||||
if($user->authorise($accessAdd, 'com_componentbuilder') && $user->authorise($accessTo, 'com_componentbuilder') && $dashboard_add)
|
||||
{
|
||||
$icons[$group][$i] = new StdClass;
|
||||
$icons[$group][$i]->url = $url;
|
||||
$icons[$group][$i]->name = $name;
|
||||
$icons[$group][$i]->image = $image;
|
||||
$icons[$group][$i]->alt = $alt;
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($accessTo))
|
||||
{
|
||||
// check access
|
||||
if($user->authorise($accessTo, 'com_componentbuilder') && $dashboard_list)
|
||||
{
|
||||
$icons[$group][$i] = new StdClass;
|
||||
$icons[$group][$i]->url = $url;
|
||||
$icons[$group][$i]->name = $name;
|
||||
$icons[$group][$i]->image = $image;
|
||||
$icons[$group][$i]->alt = $alt;
|
||||
}
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkString($accessAdd))
|
||||
{
|
||||
// check access
|
||||
if($user->authorise($accessAdd, 'com_componentbuilder') && $dashboard_add)
|
||||
{
|
||||
$icons[$group][$i] = new StdClass;
|
||||
$icons[$group][$i]->url = $url;
|
||||
$icons[$group][$i]->name = $name;
|
||||
$icons[$group][$i]->image = $image;
|
||||
$icons[$group][$i]->alt = $alt;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$icons[$group][$i] = new StdClass;
|
||||
$icons[$group][$i]->url = $url;
|
||||
$icons[$group][$i]->name = $name;
|
||||
$icons[$group][$i]->image = $image;
|
||||
$icons[$group][$i]->alt = $alt;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$icons[$group][$i] = new StdClass;
|
||||
$icons[$group][$i]->url = $url;
|
||||
$icons[$group][$i]->name = $name;
|
||||
$icons[$group][$i]->image = $image;
|
||||
$icons[$group][$i]->alt = $alt;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$icons[$group][$i] = false;
|
||||
}
|
||||
}
|
||||
return $icons;
|
||||
|
Reference in New Issue
Block a user