function showTabGeneralAction() { $date_service = DevblocksPlatform::getDateService(); $tpl = DevblocksPlatform::getTemplateService(); $tpl_path = $this->_TPL_PATH; $tpl->assign('path', $tpl_path); $worker = PortSensorApplication::getActiveWorker(); $tpl->assign('worker', $worker); $assist_mode = intval(DAO_WorkerPref::get($worker->id, 'assist_mode', 1)); $tpl->assign('assist_mode', $assist_mode); $keyboard_shortcuts = intval(DAO_WorkerPref::get($worker->id, 'keyboard_shortcuts', 1)); $tpl->assign('keyboard_shortcuts', $keyboard_shortcuts); // Timezones $tpl->assign('timezones', $date_service->getTimezones()); @($server_timezone = date_default_timezone_get()); $tpl->assign('server_timezone', $server_timezone); // Languages $langs = DAO_Translation::getDefinedLangCodes(); $tpl->assign('langs', $langs); $tpl->assign('selected_language', DAO_WorkerPref::get($worker->id, 'locale', 'en_US')); $tpl->display('file:' . $tpl_path . 'preferences/tabs/general.tpl'); }
static function modifier_devblocks_date($string, $format = null, $gmt = false) { if (empty($string)) { return ''; } $date = DevblocksPlatform::getDateService(); return $date->formatTime($format, $string, $gmt); }
function showGeneralAction() { $date_service = DevblocksPlatform::getDateService(); $tpl = DevblocksPlatform::getTemplateService(); $tpl_path = $this->_TPL_PATH; $tpl->assign('path', $tpl_path); $worker = CerberusApplication::getActiveWorker(); $tpl->assign('worker', $worker); $tour_enabled = intval(DAO_WorkerPref::get($worker->id, 'assist_mode', 1)); $tpl->assign('assist_mode', $tour_enabled); $keyboard_shortcuts = intval(DAO_WorkerPref::get($worker->id, 'keyboard_shortcuts', 1)); $tpl->assign('keyboard_shortcuts', $keyboard_shortcuts); $mail_inline_comments = DAO_WorkerPref::get($worker->id, 'mail_inline_comments', 1); $tpl->assign('mail_inline_comments', $mail_inline_comments); $mail_always_show_all = DAO_WorkerPref::get($worker->id, 'mail_always_show_all', 0); $tpl->assign('mail_always_show_all', $mail_always_show_all); $addresses = DAO_AddressToWorker::getByWorker($worker->id); $tpl->assign('addresses', $addresses); // Timezones $tpl->assign('timezones', $date_service->getTimezones()); @($server_timezone = date_default_timezone_get()); $tpl->assign('server_timezone', $server_timezone); // Languages $langs = DAO_Translation::getDefinedLangCodes(); $tpl->assign('langs', $langs); $tpl->assign('selected_language', DAO_WorkerPref::get($worker->id, 'locale', 'en_US')); $tpl->display('file:' . $tpl_path . 'preferences/modules/general.tpl'); }