|
|
|
@ -301,35 +301,50 @@ class Template |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Sets the header visibility |
|
|
|
* return true if toolbar has to be displayed for user |
|
|
|
* @param bool true if we show the header |
|
|
|
* @return bool |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function set_header($status) |
|
|
|
public static function isToolBarDisplayedForUser() |
|
|
|
{ |
|
|
|
{ |
|
|
|
$this->show_header = $status; |
|
|
|
|
|
|
|
$this->assign('show_header', $status); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Toolbar |
|
|
|
//Toolbar |
|
|
|
$show_admin_toolbar = api_get_setting('show_admin_toolbar'); |
|
|
|
$show_admin_toolbar = api_get_setting('show_admin_toolbar'); |
|
|
|
$show_toolbar = 0; |
|
|
|
$show_toolbar = false; |
|
|
|
|
|
|
|
|
|
|
|
switch ($show_admin_toolbar) { |
|
|
|
switch ($show_admin_toolbar) { |
|
|
|
case 'do_not_show': |
|
|
|
case 'do_not_show': |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'show_to_admin': |
|
|
|
case 'show_to_admin': |
|
|
|
if (api_is_platform_admin()) { |
|
|
|
if (api_is_platform_admin()) { |
|
|
|
$show_toolbar = 1; |
|
|
|
$show_toolbar = true; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'show_to_admin_and_teachers': |
|
|
|
case 'show_to_admin_and_teachers': |
|
|
|
if (api_is_platform_admin() || api_is_allowed_to_edit()) { |
|
|
|
if (api_is_platform_admin() || api_is_allowed_to_edit()) { |
|
|
|
$show_toolbar = 1; |
|
|
|
$show_toolbar = true; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'show_to_all': |
|
|
|
case 'show_to_all': |
|
|
|
$show_toolbar = 1; |
|
|
|
$show_toolbar = true; |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return $show_toolbar; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Sets the header visibility |
|
|
|
|
|
|
|
* @param bool true if we show the header |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public function set_header($status) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$this->show_header = $status; |
|
|
|
|
|
|
|
$this->assign('show_header', $status); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$show_toolbar = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (self::isToolBarDisplayedForUser()) { |
|
|
|
|
|
|
|
$show_toolbar = 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$this->assign('show_toolbar', $show_toolbar); |
|
|
|
$this->assign('show_toolbar', $show_toolbar); |
|
|
|
|
|
|
|
|
|
|
|
//Only if course is available |
|
|
|
//Only if course is available |
|
|
|
|