@owner Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
/-------------------------------------------------------------------------------------------------------/
Cost Benefit Projection Tool.
/------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// get user type
$useris = CostbenefitprojectionHelper::userIs($this->user->id);
$usergroup = CostbenefitprojectionHelper::setGroupNames($this->user->get('groups'));
// load modules if public
$login_cp = array();
$public_cp = array();
$top_cp = array();
if(!$useris)
{
jimport('joomla.application.module.helper');
// this is where you want to load your module position
$modulesl = JModuleHelper::getModules('login-cp');
foreach($modulesl as $module)
{
$login_cp[] = JModuleHelper::renderModule($module);
}
// this where you want to load you module position
$modulesp = JModuleHelper::getModules('public-cp');
foreach($modulesp as $module)
{
$public_cp[] = JModuleHelper::renderModule($module);
}
// this is where you want to load your module position
$modulest = JModuleHelper::getModules('top-cp');
foreach($modulest as $module)
{
$top_cp[] = JModuleHelper::renderModule($module);
}
}
// quick header fix function
function setHeaderString($n)
{
return CostbenefitprojectionHelper::safeString($n,'Ww');
}
// setting the published state
function setPublised($item)
{
$state = '
'.$item->published.'
';
switch($item->published)
{
case 1:
// Published
$state = '
';
break;
case 0:
// UnPublished
$state = '
';
break;
case 2:
// Archived
$state = '
';
break;
case -2:
// Trashed
$state = '
';
break;
}
return $state;
}
// set scaling factor link
function setScalingFactorLink($item)
{
$user = JFactory::getUser();
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || $item->checked_out == 0;
$userChkOut = JFactory::getUser($item->checked_out);
$canDo = CostbenefitprojectionHelper::getActions('scaling_factor',$item,'scaling_factors');
if ($canDo->get('scaling_factor.edit'))
{
if ($item->checked_out && $canCheckin)
{
$link = '