} if (isset($HTTP_POST_VARS['submit'])) { if ($sql = set_config($config_name, str_replace("\\'", "''", $new[$config_name]))) { message_die(GENERAL_ERROR, "Failed to update general configuration for {$config_name}", "", __LINE__, __FILE__, $sql); } } } if (isset($HTTP_POST_VARS['submit'])) { $message = $lang['Config_updated'] . "<br /><br\t/>" . sprintf($lang['Click_return_config'], "<a\thref=\"" . append_sid("admin_board.{$phpEx}") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.{$phpEx}?pane=right") . "\">", "</a>"); message_die(GENERAL_MESSAGE, $message); } } $style_select = style_select($new['default_style'], 'default_style', "../templates"); $lang_select = language_select($new['default_lang'], 'default_lang', "language"); $timezone_select = tz_select($new['board_timezone'], 'board_timezone'); $auth_mode_select = auth_select($new['auth_mode'], 'auth_mode'); $disable_board_yes = $new['board_disable'] ? "checked=\"checked\"" : ""; $disable_board_no = !$new['board_disable'] ? "checked=\"checked\"" : ""; $disable_board_adminview_yes = $new['board_disable_adminview'] ? "checked=\"checked\"" : ""; $disable_board_adminview_no = !$new['board_disable_adminview'] ? "checked=\"checked\"" : ""; $disable_reg_yes = $new['disable_reg'] ? "checked=\"checked\"" : ""; $disable_reg_no = !$new['disable_reg'] ? "checked=\"checked\"" : ""; $cookie_secure_yes = $new['cookie_secure'] ? "checked=\"checked\"" : ""; $cookie_secure_no = !$new['cookie_secure'] ? "checked=\"checked\"" : ""; $html_tags = $new['allow_html_tags']; $override_user_style_yes = $new['override_user_style'] ? "checked=\"checked\"" : ""; $override_user_style_no = !$new['override_user_style'] ? "checked=\"checked\"" : ""; $html_yes = $new['allow_html'] ? "checked=\"checked\"" : ""; $html_no = !$new['allow_html'] ? "checked=\"checked\"" : ""; $bbcode_yes = $new['allow_bbcode'] ? "checked=\"checked\"" : ""; $bbcode_no = !$new['allow_bbcode'] ? "checked=\"checked\"" : "";
function manage_layout($is_layout_special) { global $db, $template, $class_form, $lang; if ($this->action == 'edit') { $l_info = $this->get_layout_info(); $this->s_hidden_fields .= '<input type="hidden" name="filename_old" value="' . $l_info['filename'] . '" />'; } if (!$is_layout_special) { if (file_exists('testing_write_access_permissions.test')) { @unlink('testing_write_access_permissions.test'); } $write_test = @copy('index_empty.' . PHP_EXT, 'testing_write_access_permissions.test'); if (file_exists('testing_write_access_permissions.test')) { @chmod('testing_write_access_permissions.test', 0777); @unlink('testing_write_access_permissions.test'); } if ($write_test) { $file_creation_auth = $lang['CMS_Filename_Explain_OK']; } else { $file_creation_auth = $lang['CMS_Filename_Explain_NO']; } $l_info['page_id'] = ''; $template_name = 'default'; $template_dir = IP_ROOT_PATH . '/templates/' . $template_name . '/layout'; $layout_details = $this->get_layouts_details($l_info, $template_dir, '.tpl', 'template'); for ($i = 0; $i < sizeof($layout_details); $i++) { $template->assign_block_vars('layouts', array('LAYOUT_IMG' => $layout_details[$i]['img'], 'LAYOUT_RADIO' => $layout_details[$i]['file'])); } $select_name = 'view'; $default = empty($l_info['view']) ? 0 : $l_info['view']; $options_array = array(0, 1, 2, 3, 4, 8); $options_langs_array = array($lang['B_ALL'], $lang['B_GUESTS'], $lang['B_REG'], $lang['B_MOD'], $lang['B_ADMIN'], $lang['B_ALL_NO_BOTS']); $select_js = ''; $view = $class_form->build_select_box($select_name, $default, $options_array, $options_langs_array, $select_js); $group = get_all_usergroups($l_info['groups']); if (empty($group)) { $group = ' ' . $lang['None']; } } else { if ($this->action == 'edit' && $l_info['locked']) { message_die(GENERAL_ERROR, $lang['Not_Authorized']); } $group = ''; $default = empty($l_info['view']) ? 0 : $l_info['view']; $view = auth_select('view', $default); } $template->assign_vars(array('NAME' => empty($l_info['name']) ? '' : $l_info['name'], 'FILENAME' => empty($l_info['filename']) ? '' : $l_info['filename'], 'PAGE_ID' => empty($l_info['page_id']) ? '' : $l_info['page_id'], 'TEMPLATE' => $layout_details, 'VIEW' => $view, 'U_EDIT_AUTH' => append_sid($this->root . '?mode=auth&pmode=setting_cms_user_local&id_type=' . ($is_layout_special ? 'layout_special' : 'layout') . '&forum_id[]=' . ($is_layout_special ? $l_info['lsid'] : $l_info['lid'])), 'GROUPS' => $group, 'GLOBAL_BLOCKS' => !empty($l_info['global_blocks']) && $l_info['global_blocks'] ? 'checked="checked"' : '', 'NOT_GLOBAL_BLOCKS' => empty($l_info['global_blocks']) ? 'checked="checked"' : '', 'PAGE_NAV' => !empty($l_info['page_nav']) && $l_info['page_nav'] ? 'checked="checked"' : '', 'NOT_PAGE_NAV' => empty($l_info['page_nav']) ? 'checked="checked"' : '', 'S_LAYOUT_SPECIAL' => $is_layout_special, 'S_LAYOUT_ACTION' => append_sid($this->root . $this->s_append_url), 'S_HIDDEN_FIELDS' => $this->s_hidden_fields)); return true; }