function init_config_options() { $languages = array("" => __("Default")); foreach (get_languages() as $language) { $languages[$language] = $language; } // name, text, type, value(s) return array(array('week_start', __('Week Start'), PHPC_DROPDOWN, array(0 => __('Sunday'), 1 => __('Monday'), 6 => __('Saturday')), 0), array('hours_24', __('24 Hour Time'), PHPC_CHECK), array('title', __('Calendar Title'), PHPC_TEXT), array('subject_max', __('Maximum Subject Length'), PHPC_TEXT, 50), array('events_max', __('Events Display Daily Maximum'), PHPC_TEXT, 8), array('anon_permission', __('Public Permissions'), PHPC_DROPDOWN, array(__('Cannot read nor write events'), __('Can read but not write events'), __('Can create but not modify events'), __('Can create and modify events'))), array('timezone', __('Default Timezone'), PHPC_MULTI_DROPDOWN, get_timezone_list()), array('language', __('Default Language'), PHPC_DROPDOWN, $languages), array('date_format', __('Date Format'), PHPC_DROPDOWN, get_date_format_list()), array('theme', __('Theme'), PHPC_DROPDOWN, get_theme_list())); }
function show_author_form($tab) { global $author_session; global $prefs; // Referer not always set (bookmark, reload, etc.) // [AG] This is to preserve page's referer in 'ref' GET value during tab transitions // giving it higher priority than the actual page referer if (isset($_GET['ref'])) { $http_ref = urldecode(clean_input($_GET['ref'])); } else { $http_ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; } $http_ref_link = new Link($http_ref); echo '<form name="upd_user_profile" method="post" action="config_author.php">' . "\n"; echo '<input type="hidden" name="referer" value="' . $http_ref_link->getUrl() . '" />' . "\n"; echo '<input type="hidden" name="author_' . ($tab == 'advanced' ? 'advanced_settings' : 'ui') . '_modified" value="yes" />' . "\n"; if ($tab == 'advanced') { echo '<input type="hidden" name="tab" value="1" />' . "\n"; } echo '<table width="99%" border="0" align="center" cellpadding="5" cellspacing="0" class="tbl_usr_dtl">' . "\n"; echo "<tr>\n"; echo '<td colspan="2" align="center" valign="middle" class="heading">'; echo '<h4>' . _T('authorconf_subtitle_' . $tab) . "</h4></td>\n"; echo "</tr>\n"; switch ($tab) { // // User interface // case 'interface': if ($GLOBALS['all_langs']) { echo "\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align=\"right\" valign=\"top\">" . _T('authorconf_input_language') . "</td>\n\t\t\t\t\t<td align=\"left\" valign=\"top\">\n\t\t\t\t\t<input type='hidden' name='old_language' value='" . $GLOBALS['lcm_lang'] . "'/>\n"; echo menu_languages('sel_language'); echo "\n\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n"; } ?> <tr> <td align="right" valign="top" width="50%"><?php echo _T('authorconf_input_screen'); ?> </td> <td align="left" valign="top"> <input type="hidden" name="old_screen" id="old_screen" value="<?php echo $prefs['screen']; ?> " /> <select name="sel_screen" class="sel_frm"> <?php $screen_modes = array("wide", "narrow"); foreach ($screen_modes as $scrm) { $selected_mode = $scrm == $prefs['screen'] ? " selected='selected'" : ''; echo "<option value='" . $scrm . "'" . $selected_mode . ">" . _T('authorconf_input_screen_' . $scrm) . "</option>\n"; } ?> </select> </td> </tr> <tr> <td align="right" valign="top"><?php echo _T('authorconf_input_theme'); ?> </td> <td align="left" valign="top"> <input type="hidden" name="old_theme" id="old_theme" value="<?php echo $prefs['theme']; ?> " /> <select name="sel_theme" class="sel_frm" id="sel_theme"> <?php $themes = get_theme_list(); foreach ($themes as $t) { // If a theme has no translation, show only the file name $name = _T('authorconf_input_theme_' . $t); if ($name == 'authorconf_input_theme_' . $t) { $name = $t; } $selected = $t == $prefs['theme'] ? " selected='selected'" : ''; echo "<option value='" . $t . "'" . $selected . ">" . $name . "</option>\n"; } ?> </select> </td> </tr> <tr> <td align="right" valign="top"><?php echo _T('authorconf_input_font_size'); ?> </td> <td align="left" valign="top"> <input type="hidden" name="old_font_size" id="old_font_size" value="<?php echo $prefs['font_size']; ?> " /> <!-- <input name="inc_fnt" type="button" class="search_form_btn" id="inc_fnt" value="A -" /> <input name="dec_fnt" type="button" class="search_form_btn" id="dec_fnt" value="A +" / > (not working yet) --> <select name="font_size" class="sel_frm" onchange="setActiveStyleSheet(document.upd_user_profile.font_size.options[document.upd_user_profile.font_size.options.selectedIndex].value)"> <?php $fonts = array('small_font', 'medium_font', 'large_font'); // font_size gets default value in inc_auth.php foreach ($fonts as $f) { $sel = $f == $prefs['font_size'] ? 'selected="selected" ' : ''; echo '<option ' . $sel . 'value="' . $f . '">' . _T('authorconf_input_' . $f) . '</option>' . "\n"; } ?> </select> </td> </tr> <tr> <td align="right" valign="top"><?php echo _T('authorconf_input_results_per_page'); ?> </td> <td align="left" valign="top"> <input type="hidden" name="old_page_rows" id="old_page_rows" value="<?php echo $prefs['page_rows']; ?> " /> <input name="page_rows" type="text" class="search_form_txt" id="page_rows" size="3" value="<?php // page_rows gets default value in inc_auth.php echo $prefs['page_rows']; ?> " /> </td> </tr> </table> <?php break; // // Advanced settings // // // Advanced settings // case 'advanced': // Absolute/relative time intervals setting echo "<tr>\n"; echo '<td align="left" valign="top">' . _T('authorconf_input_ui_time') . "</td>\n"; echo '<td align="left" valign="top">' . '<input type="hidden" name="old_time_intervals" id="old_time_intervals" value="' . $prefs['time_intervals'] . '" />' . '<select name="sel_time_intervals" class="sel_frm">'; $time_intervals = array("absolute", "relative"); foreach ($time_intervals as $ti) { echo '<option value="' . $ti . '"' . isSelected($ti == $prefs['time_intervals']) . '>' . _T('authorconf_input_time_interval_' . $ti) . "</option>\n"; } echo "</select>\n"; echo "</td>\n"; echo "</tr>\n"; // Relative time intervals notation setting (hours only / float days,hours,minutes / float days, float hours, minutes) echo "<tr>\n"; echo '<td align="left" valign="top">' . _T('authorconf_input_time_intervals_notation') . "</td>\n"; echo '<td align="left" valign="top">' . '<input type="hidden" name="old_time_intervals_notation" id="old_time_intervals_notation" value="' . $prefs['time_intervals_notation'] . '" />' . '<select name="sel_time_intervals_notation" class="sel_frm">'; $time_intervals_notation = array("hours_only", "floatdays_hours_minutes"); foreach ($time_intervals_notation as $tin) { echo "<option value='" . $tin . "'" . isSelected($tin == $prefs['time_intervals_notation']) . ">" . _T('authorconf_input_time_intervals_notation_' . $tin) . "</option>\n"; } echo "</select>\n"; echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; break; } // Submit button echo '<p align="' . $GLOBALS['lcm_lang_left'] . '">'; echo '<input name="validate" type="submit" class="search_form_btn" id="submit" value="' . _T('authorconf_button_update_preferences') . '" />'; echo "</p>\n"; echo "</form>\n"; }
<form method="post" name="te"> <INPUT TYPE="hidden" NAME="action" VALUE="theme_list"> <SELECT class="unit_button" NAME="theme" class="comment">'; /* chdir(TE_DIR.'/themes'); $d = @opendir("."); if (!$d) return; while (($e=readdir($d)) !== false) { if ($e=='.' || $e=='..') continue; if (!@is_dir($e)) continue; $theme_list[$e] = $e; flush(); } closedir($d); chdir(".."); */ $theme_list = get_theme_list(); foreach ($theme_list as $theme) { echo '<OPTION VALUE="' . $theme . '">'; echo $theme; } echo '</SELECT> <input name="change_theme" value="Активировать" type="submit" class="unit_button" /> </form>'; ##### Редактор -> $file_list = get_file_list($t); if (@$_REQUEST['act'] == "edit") { if (isset($file_list[$_REQUEST['file']])) { $file = htmlspecialchars(file_get_contents(TE_DIR . '/themes/' . $t . '/' . $_REQUEST['file'])); $thFchmod = '<span class="mes"> Права доступа: ' . decoct(0777 & fileperms(TE_DIR . '/themes/' . $t . '/' . $file_list[$_REQUEST['file']])) . '</span> <a target="_blank" href="' . $help['chmod'] . '">[Что это?]</a>'; }