function getLocalTimezone() { date_default_timezone_set('UTC'); $iTime = time(); $arr = localtime($iTime); $arr[5] += 1900; $arr[4]++; $iTztime = gmmktime($arr[2], $arr[1], $arr[0], $arr[4], $arr[3], $arr[5]); $offset = doubleval(($iTztime - $iTime) / (60 * 60)); $zonelist = getTimezoneList(); $index = array_keys($zonelist, $offset); if (sizeof($index) != 1) { return false; } return $index[0]; }
function display() { $cd = new \Modl\ConfigDAO(); $config = $cd->get(); $l = Movim\i18n\Locale::start(); $this->view->assign('conf', $cd->get()); $this->view->assign('logs', array(0 => $this->__('log.empty'), 1 => $this->__('log.syslog'), 2 => $this->__('log.syslog_files'))); $this->view->assign('bosh_info4', $this->__('bosh.info4', '<a href="http://wiki.movim.eu/en:install">', '</a>')); $json = requestURL(MOVIM_API . 'websockets', 1); $json = json_decode($json); if (isset($json) && $json->status != 404) { $this->view->assign('websockets', $json); } $this->view->assign('timezones', getTimezoneList()); $this->view->assign('langs', $l->getList()); }
function display() { $cd = new \Modl\ConfigDAO(); $config = $cd->get(); $this->view->assign('conf', $cd->get()); $this->view->assign('logs', array(0 => $this->__('log.empty'), 1 => $this->__('log.syslog'), 2 => $this->__('log.syslog_files'))); $this->view->assign('bosh_info4', $this->__('bosh.info4', '<a href="http://wiki.movim.eu/en:install">', '</a>')); $json = requestURL(MOVIM_API . 'websockets', 1); $json = json_decode($json); if (isset($json) && $json->status != 404) { $this->view->assign('websockets', $json); } $this->view->assign('server_rewrite', false); if (isset($_SERVER['HTTP_MOD_REWRITE']) && $_SERVER['HTTP_MOD_REWRITE']) { $this->view->assign('server_rewrite', true); } $this->view->assign('timezones', getTimezoneList()); $this->view->assign('langs', loadLangArray()); }
$CONST_MODULE = 'personal details'; $CONST_PAGEID = 'My Profile'; require_once INCLUDES_PATH . 'cm_authorize.inc.php'; require_once INCLUDES_PATH . 'common_function.inc.php'; require_once INCLUDES_PATH . 'profile_function.inc.php'; //data population start $form_table_map = profile_form_table_map(); $userdetails = getUserDetailsByID($strCK_user_id, $objDataHelper); $userdetails = $userdetails[0]; $arrIndustryType = getAllIndustryType($objDataHelper); $optionIndustryType = ""; for ($cnt = 0; $cnt < count($arrIndustryType); $cnt++) { $selected = $userdetails[$form_table_map['frmCompany']['indutrytype']] == $arrIndustryType[$cnt]['industry_id'] ? "selected" : ""; $optionIndustryType .= "<option value='" . $arrIndustryType[$cnt]['industry_id'] . "' " . $selected . ">" . $arrIndustryType[$cnt]['industry_name'] . "</option>"; } $arrTimezonesType = getTimezoneList($objDataHelper); $optionTimezonesType = ""; for ($cnt = 0; $cnt < count($arrTimezonesType); $cnt++) { $optionTimezonesType .= "<option value='" . $arrTimezonesType[$cnt]['ct_id'] . "'>" . $arrTimezonesType[$cnt]['timezones'] . " - " . $arrTimezonesType[$cnt]['country_name'] . "</option>"; } $arrDistinctCountry = getDistinctCountry($objDataHelper); $optionCountry = ""; for ($cnt = 0; $cnt < count($arrDistinctCountry); $cnt++) { $selected = $userdetails[$form_table_map['frmaddress']['country']] == $arrDistinctCountry[$cnt]['country_name'] ? "selected" : ""; $optionCountry .= "<option value='" . $arrDistinctCountry[$cnt]['country_name'] . "' " . $selected . ">" . $arrDistinctCountry[$cnt]['country_name'] . " - " . $arrDistinctCountry[$cnt]['country_code'] . "</option>"; } //data population end ?> <!DOCTYPE html> <html lang="en">
//$contacts .= "<div style='float:left;width:90%;font-weight:bold;line-height:30px'>".$cValue['group_name']."</div>"; //$contacts .= "<thead class='thin-border-bottom'><tr><th colspan='3'>".$cValue['group_name']."</th></tr></thead>"; $contacts .= "<h5 class='smaller lighter green'><i class='ace-icon fa fa-users col-sm-1'></i>" . $cValue['group_name'] . "</h5>"; foreach ($cList as $cKey => $cKeyArray) { if ($cKeyArray['contact_group_name'] == $cValue['group_name']) { if ($cKeyArray['contact_email_address'] !== $strCk_user_email_address) { //$contacts .= "<div style='float:left;width:90%'>".$cKeyArray['nick_name']."</div><div style='float:left;'><input type='checkbox' name='uData' value='".$cKeyArray['contact_email_address'].":".$cKeyArray['nick_name'].":".$cKeyArray['contact_idd_code'].":".$cKeyArray['contact_mobile_number']."' id='".$cKeyArray['contact_group_name'].":".$cKeyArray['contact_email_address']."' onclick=javascript:cCounter('".urlencode($cKeyArray['contact_group_name'])."','".$cKeyArray['contact_email_address']."','con')></div>"; //$contacts .="<tr><td><i class='ace-icon fa fa-user'></i></td><td> ".$cKeyArray['nick_name']."</td><td>".$cKeyArray['contact_email_address']."</td><td><input type='checkbox' id='id-disable-check' class=''></td></tr>"; $contacts .= "<div class='input-group' style='padding-bottom: 1px;'><span class='input-group-addon'><i class='ace-icon fa fa-user'></i></span><label class='form-control'><small>" . $cKeyArray['nick_name'] . "</small></label><span class='input-group-addon'><input type='checkbox' name='uData' class='ace' value='" . $cKeyArray['contact_email_address'] . ":" . $cKeyArray['nick_name'] . ":" . $cKeyArray['contact_idd_code'] . ":" . $cKeyArray['contact_mobile_number'] . "' id='" . $cKeyArray['contact_group_name'] . ":" . $cKeyArray['contact_email_address'] . "' onclick=javascript:cCounter('" . urlencode($cKeyArray['contact_group_name']) . "','" . $cKeyArray['contact_email_address'] . "','con') /><span class='lbl'></span></span></div>"; } } } } /* For Timezone */ try { $arrTimezoneList = getTimezoneList($objDataHelper); } catch (Exception $e) { throw new Exception("index.php : getTimezoneList Failed : " . $e->getMessage(), 1128); } try { $arrUserDetailsById = getUserDetailsByID($strCK_user_id, $objDataHelper); } catch (Exception $e) { throw new Exception("index.php : getUserDetailsByID Failed : " . $e->getMessage(), 1129); } $userTz = $arrUserDetailsById[0]['country_name'] . "\$:\$" . $arrUserDetailsById[0]['timezones'] . "\$:\$" . $arrUserDetailsById[0]['gmt']; $uTimezone = $arrUserDetailsById[0]['country_name'] . " - " . $arrUserDetailsById[0]['timezones'] . ", GMT" . $arrUserDetailsById[0]['gmt']; $timezone .= "<select name='timezone' id='timezone' class='col-xs-12 col-sm-12' onChange='currentZone()'><option value=''>-- Select Timezone --</option>"; foreach ($arrTimezoneList as $tKey => $tKeyArray) { $tzVal = $tKeyArray['country_name'] . "\$:\$" . $tKeyArray['timezones'] . "\$:\$" . $tKeyArray['gmt']; if ($userTz == $tzVal) { $timezone .= "<option value='" . $tzVal . "' selected='selected'>" . $tKeyArray['country_name'] . " - " . $tKeyArray['timezones'] . " " . $tKeyArray['gmt'] . "</option>";
function getTimezoneCorrection() { $timezones = getTimezoneList(); return $timezones[date_default_timezone_get()]; }
/** * displayDefaultsForm * * @return void */ function displayDefaultsForm() { $this->displayHeader(); // Defaults Config $sql = "DESCRIBE `fcms_user_settings`"; $rows = $this->fcmsDatabase->getRows($sql); if ($rows === false) { $this->fcmsError->displayError(); $this->displayFooter(); return; } foreach ($rows as $drow) { if ($drow['Field'] == 'theme') { $default_theme = $drow['Default']; } if ($drow['Field'] == 'displayname') { $default_displayname = $drow['Default']; } if ($drow['Field'] == 'frontpage') { $default_frontpage = $drow['Default']; } if ($drow['Field'] == 'timezone') { $default_tz = $drow['Default']; } if ($drow['Field'] == 'dst') { $default_dst = $drow['Default']; } if ($drow['Field'] == 'boardsort') { $default_boardsort = $drow['Default']; } } // Themes $themes = getThemeList(); $theme_options = ''; foreach ($themes as $file) { $theme_options .= '<option value="' . $file . '"'; if ($default_theme == $file) { $theme_options .= ' selected="selected"'; } $theme_options .= ">{$file}</option>"; } // Display Name $displayname_list = array("1" => T_('First Name'), "2" => T_('First & Last Name'), "3" => T_('Username')); $displayname_options = buildHtmlSelectOptions($displayname_list, $default_displayname); // Frontpage $frontpage_list = array("1" => T_('All (by date)'), "2" => T_('Last 5 (by plugin)')); $frontpage_options = buildHtmlSelectOptions($frontpage_list, $default_frontpage); // Timezone $tz_list = getTimezoneList(); $tz_options = buildHtmlSelectOptions($tz_list, $default_tz); // DST $dst_list = array(1 => T_('On'), 0 => T_('Off')); $dst_options = buildHtmlSelectOptions($dst_list, $default_dst); // Board Sort $boardsort_list = array("ASC" => T_('New Messages at Bottom'), "DESC" => T_('New Messages at Top')); $boardsort_options = buildHtmlSelectOptions($boardsort_list, $default_boardsort); $message = ''; if (isset($_SESSION['success'])) { $message = '<div class="alert-message success">'; $message .= '<a class="close" href="#" onclick="$(this).up(\'div\').hide(); return false;">×</a>'; $message .= T_('Changes Updated Successfully') . '</div>'; unset($_SESSION['success']); } echo ' <form action="config.php?view=defaults" method="post"> ' . $message . ' <fieldset> <legend>' . T_('New Member Default Settings') . '</legend> <div class="clearfix"> <label for="theme">' . T_('Theme') . '</label> <div class="input"> <select name="theme" id="theme"> ' . $theme_options . ' </select> </div> </div> <div class="clearfix"> <label for="displayname">' . T_('Display Name') . '</label> <div class="input"> <select name="displayname" id="displayname" title="' . T_('How do you want your name to display?') . '"> ' . $displayname_options . ' </select> </div> </div> <div class="clearfix"> <label for="frontpage">' . T_('Front Page') . '</label> <div class="input"> <select name="frontpage" id="frontpage" title="' . T_('How do you want the latest information to display on the homepage?') . '"> ' . $frontpage_options . ' </select> </div> </div> <div class="clearfix"> <label for="timezone">' . T_('Time Zone') . '</label> <div class="input"> <select class="span8" name="timezone" id="timezone" title="' . T_('What time zone do you live in?') . '"> ' . $tz_options . ' </select> </div> </div> <div class="clearfix"> <label for="dst">' . T_('Daylight Savings Time') . '</label> <div class="input"> <select name="dst" id="dst"> ' . $dst_options . ' </select> </div> </div> <div class="clearfix"> <label for="boardsort">' . T_('Sort Messages') . '</label> <div class="input"> <select name="boardsort" id="boardsort" title="' . T_('How do you want messages to display on the Message Board?') . '"> ' . $boardsort_options . ' </select> </div> </div> <div class="clearfix"> <label> </label> <div class="input"> <ul class="inputs-list"> <li> <label> <input type="checkbox" name="changeAll" id="changeAll"/> <span>' . T_('Update existing users?') . '</span> </label> </li> </ul> </div> </div> <div class="actions"> <input type="submit" id="submit-defaults" name="submit-defaults" class="btn primary" value="' . T_('Save') . '"/> </div> </fieldset> </form>'; $this->displayFooter(); }
/** * displaySettings * * @return void */ function displaySettings() { $sql = "SELECT `displayname`, `language`,\n `dst`, `timezone`, `boardsort`, `frontpage`\n FROM `fcms_user_settings`\n WHERE `user` = '" . $this->fcmsUser->id . "'"; $row = $this->fcmsDatabase->getRow($sql, $this->fcmsUser->id); if ($row === false) { $this->fcmsError->displayError(); return; } // Display Name $displayname_list = array("1" => T_('First Name'), "2" => T_('First and Last Name'), "3" => T_('Username')); $displayname_options = buildHtmlSelectOptions($displayname_list, $row['displayname']); // Language $lang_dir = "language/"; $lang_options = ''; if (is_dir($lang_dir)) { if ($dh = opendir($lang_dir)) { $arr = array(); while (($file = readdir($dh)) !== false) { // Skip directories that start with a period if ($file[0] === '.') { continue; } // Skip files (messages.pot) if (!is_dir("{$lang_dir}{$file}")) { continue; } // Skip directories that don't include a messages.mo file if (!file_exists($lang_dir . $file . '/LC_MESSAGES/messages.mo')) { continue; } $arr[$file] = getLangName($file); } closedir($dh); asort($arr); foreach ($arr as $key => $val) { $sel = $row['language'] == $key ? 'selected="selected"' : ''; $lang_options .= '<option value="' . $key . '" ' . $sel . '>' . $val . '</option>'; } } } // Timezone $tz_list = getTimezoneList(); $tz_options = buildHtmlSelectOptions($tz_list, $row['timezone']); // DST $yc = $row['dst'] == 1 ? 'checked="checked"' : ''; $nc = $row['dst'] == 0 ? 'checked="checked"' : ''; $dst_options = '<input type="radio" name="dst" id="dst_on" value="on" ' . $yc . '>'; $dst_options .= '<label class="radio_label" for="dst_on">' . T_('On') . '</label> '; $dst_options .= '<input type="radio" name="dst" id="dst_off" value="off" ' . $nc . '>'; $dst_options .= '<label class="radio_label" for="dst_off">' . T_('Off') . '</label>'; // Front Page $frontpage_list = array("1" => T_('All (by date)'), "2" => T_('Last 5 (by plugin)')); $frontpage_options = buildHtmlSelectOptions($frontpage_list, $row['frontpage']); echo ' <script type="text/javascript" src="ui/js/livevalidation.js"></script> <form id="frm" action="settings.php?view=settings" method="post"> <fieldset> <legend><span>' . T_('Langugage and Time') . '</span></legend> <div class="field-row"> <div class="field-label"><label for="language"><b>' . T_('Language') . '</b></label></div> <div class="field-widget"> <select name="language" id="language" title="' . T_('What language do you speak?') . '"> ' . $lang_options . ' </select> </div> </div> <div class="field-row"> <div class="field-label"><label for="timezone"><b>' . T_('Timezone') . '</b></label></div> <div class="field-widget"> <select name="timezone" id="timezone" title="' . T_('What timezone do you live in?') . '"> ' . $tz_options . ' </select> </div> </div> <div class="field-row"> <div class="field-label"><label for="dst"><b>' . T_('Daylight Savings Time') . '</b></label></div> <div class="field-widget"> ' . $dst_options . '<br/> <small>' . T_('You will need to manually change this off and on if your City/Town makes use of DST.') . '</small> </div> </div> </fieldset> <fieldset> <legend><span>' . T_('Preferences') . '</span></legend> <div class="field-row"> <div class="field-label"><label for="displayname"><b>' . T_('Display Name') . '</b></label></div> <div class="field-widget"> <select name="displayname" id="displayname" title="' . T_('How do you want your name to display?') . '"> ' . $displayname_options . ' </select> </div> </div> <div class="field-row"> <div class="field-label"><label for="frontpage"><b>' . T_('Frontpage') . '</b></label></div> <div class="field-widget"> <select name="frontpage" id="frontpage" title="' . T_('How do you want the latest information to display on the frontpage?') . '"> ' . $frontpage_options . ' </select> </div> </div> <p><input class="sub1" type="submit" name="submit" id="submit" value="' . T_('Submit') . '"/></p> </fieldset> </form>'; }