25 lines
525 B
PHP
25 lines
525 B
PHP
<?php
|
|
|
|
namespace HermannTelser\Gutachten\Settings;
|
|
|
|
use HermannTelser\Gutachten\DB\DbFunction;
|
|
|
|
class ToggleHelp
|
|
{
|
|
/**
|
|
* @param mixed $id
|
|
*
|
|
* @return bool
|
|
*/
|
|
public static function toggle()
|
|
{
|
|
$help = DbFunction::get('fe_users', 'tx_help', ['uid' => $GLOBALS['TSFE']->fe_user->user['uid']]);
|
|
$help = 1 == $help ? 0 : 1;
|
|
$update_array = [];
|
|
$update_array['tx_help'] = $help;
|
|
DbFunction::secureUpdate('fe_users', $update_array, ['uid' => $GLOBALS['TSFE']->fe_user->user['uid']]);
|
|
echo $help;
|
|
exit;
|
|
}
|
|
}
|