From 821e37c1b25afe9cae118c8ce185878ae8726dab Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Tue, 3 Dec 2013 16:28:37 +0100 Subject: removed faq feature --- includes/pages/admin_faq.php | 92 ---------------------------------------- includes/pages/admin_user.php | 1 - includes/pages/guest_faq.php | 28 ------------ includes/pages/guest_login.php | 4 +- includes/pages/user_settings.php | 4 +- includes/pages/user_shifts.php | 4 +- includes/sys_menu.php | 15 ++----- 7 files changed, 9 insertions(+), 139 deletions(-) delete mode 100644 includes/pages/admin_faq.php delete mode 100644 includes/pages/guest_faq.php (limited to 'includes') diff --git a/includes/pages/admin_faq.php b/includes/pages/admin_faq.php deleted file mode 100644 index 1b2ea92b..00000000 --- a/includes/pages/admin_faq.php +++ /dev/null @@ -1,92 +0,0 @@ -
%s
%s
' . '
%s
%s
' . 'Edit', $faq['Frage_de'], $faq['Antwort_de'], $faq['Frage_en'], $faq['Antwort_en'], page_link_to('admin_faq'), $faq['FID']); - } - return template_render('../templates/admin_faq.html', array( - 'link' => page_link_to("admin_faq"), - 'faqs' => $faqs_html - )); - } else { - switch ($_REQUEST['action']) { - case 'create': - $frage = strip_request_item_nl('frage'); - $antwort = strip_request_item_nl('antwort'); - $question = strip_request_item_nl('question'); - $answer = strip_request_item_nl('answer'); - - sql_query("INSERT INTO `FAQ` SET `Frage_de`='" . sql_escape($frage) . "', `Frage_en`='" . sql_escape($question) . "', `Antwort_de`='" . sql_escape($antwort) . "', `Antwort_en`='" . sql_escape($answer) . "'"); - - redirect(page_link_to("admin_faq")); - break; - - case 'save': - if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) - $id = $_REQUEST['id']; - else - return error("Incomplete call, missing FAQ ID.", true); - - $faq = sql_select("SELECT * FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1"); - if (count($faq) > 0) { - list($faq) = $faq; - - $frage = strip_request_item_nl('frage'); - $antwort = strip_request_item_nl('antwort'); - $question = strip_request_item_nl('question'); - $answer = strip_request_item_nl('answer'); - - sql_query("UPDATE `FAQ` SET `Frage_de`='" . sql_escape($frage) . "', `Frage_en`='" . sql_escape($question) . "', `Antwort_de`='" . sql_escape($antwort) . "', `Antwort_en`='" . sql_escape($answer) . "' WHERE `FID`=" . sql_escape($id) . " LIMIT 1"); - - redirect(page_link_to("admin_faq")); - } else - return error("No FAQ found.", true); - break; - - case 'edit': - if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) - $id = $_REQUEST['id']; - else - return error("Incomplete call, missing FAQ ID.", true); - - $faq = sql_select("SELECT * FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1"); - if (count($faq) > 0) { - list($faq) = $faq; - - return template_render('../templates/admin_faq_edit_form.html', array( - 'link' => page_link_to("admin_faq"), - 'id' => $id, - 'frage' => $faq['Frage_de'], - 'antwort' => $faq['Antwort_de'], - 'question' => $faq['Frage_en'], - 'answer' => $faq['Antwort_en'] - )); - } else - return error("No FAQ found.", true); - break; - - case 'delete': - if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) - $id = $_REQUEST['id']; - else - return error("Incomplete call, missing FAQ ID.", true); - - $faq = sql_select("SELECT * FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1"); - if (count($faq) > 0) { - list($faq) = $faq; - - sql_query("DELETE FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1"); - redirect(page_link_to("admin_faq")); - } else - return error("No FAQ found.", true); - break; - } - } -} -?> diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php index ba7f17ff..2da454cf 100644 --- a/includes/pages/admin_user.php +++ b/includes/pages/admin_user.php @@ -196,7 +196,6 @@ function admin_user() { $html .= ""; $html .= "
"; - //$html .= funktion_db_element_list_2row("Freeloader Shifts", "SELECT `Remove_Time`, `Length`, `Comment` FROM `ShiftFreeloader` WHERE UID=" . $_REQUEST['id']); } else { switch ($_REQUEST['action']) { case 'save_groups' : diff --git a/includes/pages/guest_faq.php b/includes/pages/guest_faq.php deleted file mode 100644 index b6452f87..00000000 --- a/includes/pages/guest_faq.php +++ /dev/null @@ -1,28 +0,0 @@ -"; - if ($_SESSION['locale'] == "de_DE.UTF-8") { - $html .= sprintf( - '
%s
%s
', - $faq['Frage_de'], - $faq['Antwort_de'] - ); - } else { - $html .= sprintf( - '
%s
%s
', - $faq['Frage_en'], - $faq['Antwort_en'] - ); - } - $html .= ""; - } - return $html; -} -?> diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php index 037cd213..f072e411 100644 --- a/includes/pages/guest_login.php +++ b/includes/pages/guest_login.php @@ -13,7 +13,7 @@ function logout_title() { // Engel registrieren function guest_register() { - global $tshirt_sizes, $enable_tshirt_size, $default_theme; + global $tshirt_sizes, $enable_tshirt_size, $default_theme, $faq_url; $msg = ""; $nick = ""; @@ -153,7 +153,7 @@ function guest_register() { form_text('hometown', _("Hometown"), $hometown), $enable_tshirt_size ? form_select('tshirt_size', _("Shirt size"), $tshirt_sizes, $tshirt_size) : '', // form_textarea('comment', _("Did you help at former CCC events and which tasks have you performed then?"), $comment), - form_checkboxes('angel_types', _("What do you want to do?") . sprintf("
(%s)", _("Description of job types")), $angel_types, $selected_angel_types), + form_checkboxes('angel_types', _("What do you want to do?") . sprintf("
(%s)", $faq_url, _("Description of job types")), $angel_types, $selected_angel_types), form_info("", _("Restricted angel types need will be confirmed later by an archangel. You can change your selection in the options section.")), form_password('password', _("Password") . "*"), form_password('password2', _("Confirm password") . "*"), diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php index 81977c71..0edacd48 100644 --- a/includes/pages/user_settings.php +++ b/includes/pages/user_settings.php @@ -4,7 +4,7 @@ function settings_title() { } function user_settings() { - global $enable_tshirt_size, $tshirt_sizes, $themes, $locales; + global $enable_tshirt_size, $tshirt_sizes, $themes, $locales, $faq_url; global $user; $msg = ""; @@ -180,7 +180,7 @@ function user_settings() { form_text('jabber', _("Jabber"), $jabber), form_text('hometown', _("Hometown"), $hometown), $enable_tshirt_size ? form_select('tshirt_size', _("Shirt size"), $tshirt_sizes, $tshirt_size) : '', - form_checkboxes('angel_types', _("What do you want to do?") . sprintf("
(%s)", _("Description of job types")), $angel_types, $selected_angel_types), + form_checkboxes('angel_types', _("What do you want to do?") . sprintf("
(%s)", $faq_url, _("Description of job types")), $angel_types, $selected_angel_types), form_submit('submit', _("Save")) )), form(array( diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index 29ed6626..3dae2007 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -275,7 +275,7 @@ function user_shifts() { function view_user_shifts() { global $user, $privileges; - global $ical_shifts; + global $ical_shifts, $faq_url; $ical_shifts = array(); $days = sql_select_single_col("SELECT DISTINCT DATE(FROM_UNIXTIME(`start`)) AS `id`, DATE(FROM_UNIXTIME(`start`)) AS `name` FROM `Shifts` ORDER BY `start`"); @@ -697,7 +697,7 @@ function view_user_shifts() { 'end_time' => $_SESSION['user_shifts']['end_time'], 'type_select' => make_select($types, $_SESSION['user_shifts']['types'], "types", _("Tasks") . '1'), 'filled_select' => make_select($filled, $_SESSION['user_shifts']['filled'], "filled", _("Occupancy")), - 'task_notice' => '1' . _("The tasks shown here are influenced by the preferences you defined in your settings!") . " " . _("Description of the jobs.") . "", + 'task_notice' => '1' . _("The tasks shown here are influenced by the preferences you defined in your settings!") . " " . _("Description of the jobs.") . "", 'new_style_checkbox' => '', 'shifts_table' => $shifts_table, 'ical_text' => '

' . _("iCal export") . '

' . sprintf(_("Export of shown shifts. iCal format or JSON format available (please keep secret, otherwise reset the api key)."), page_link_to_absolute('ical') . '&key=' . $user['api_key'], page_link_to_absolute('shifts_json_export') . '&key=' . $user['api_key'], page_link_to('user_myshifts') . '&reset') . '

', diff --git a/includes/sys_menu.php b/includes/sys_menu.php index e65f1d36..d4620753 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -39,10 +39,6 @@ function make_navigation() { global $privileges; $menu = ""; - $specials = array( - "faq" - ); - $pages = array( "news" => news_title(), "user_meetings" => meetings_title(), @@ -61,13 +57,12 @@ function make_navigation() { "admin_shifts" => admin_shifts_title(), "admin_rooms" => admin_rooms_title(), "admin_groups" => admin_groups_title(), - "admin_faq" => admin_faq_title(), "admin_import" => admin_import_title(), "admin_log" => admin_log_title() ); foreach ($pages as $page => $title) - if (in_array($page, $privileges) || in_array($page, $specials)) + if (in_array($page, $privileges)) $menu .= '' . $title . ''; return ''; @@ -75,14 +70,10 @@ function make_navigation() { function make_navigation_for($name, $pages) { global $privileges, $p; - - $specials = array( - "faq" - ); - + $menu = ""; foreach ($pages as $page) - if (in_array($page, $privileges) || in_array($page, $specials)) + if (in_array($page, $privileges)) $menu .= '' . $title . ''; if ($menu != "") -- cgit v1.2.3-54-g00ecf