summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2013-12-03 16:28:37 +0100
committerPhilip Häusler <msquare@notrademark.de>2013-12-03 16:28:37 +0100
commit821e37c1b25afe9cae118c8ce185878ae8726dab (patch)
tree865508bcf829db5d943b931835113e1eedb6cfec /includes
parentf79f711e16897c3db2bf9e315f5094124af6d55f (diff)
removed faq feature
Diffstat (limited to 'includes')
-rw-r--r--includes/pages/admin_faq.php92
-rw-r--r--includes/pages/admin_user.php1
-rw-r--r--includes/pages/guest_faq.php28
-rw-r--r--includes/pages/guest_login.php4
-rw-r--r--includes/pages/user_settings.php4
-rw-r--r--includes/pages/user_shifts.php4
-rw-r--r--includes/sys_menu.php15
7 files changed, 9 insertions, 139 deletions
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 @@
-<?php
-function admin_faq_title() {
- return _("Edit FAQs");
-}
-
-function admin_faq() {
- if (! isset($_REQUEST['action'])) {
- $faqs_html = "";
- $faqs = sql_select("SELECT * FROM `FAQ`");
- foreach ($faqs as $faq) {
- $faqs_html .= sprintf('<tr><td> <dl><dt>%s</dt><dd>%s</dd></dl> </td>' . '<td> <dl><dt>%s</dt><dd>%s</dd></dl> </td>' . '<td><a href="%s&action=edit&id=%s">Edit</a></td></tr>', $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 .= "</form>";
$html .= "<hr />";
- //$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 @@
-<?php
-function faq_title() {
- return _("FAQ");
-}
-
-function guest_faq() {
- $html = "";
- $faqs = sql_select("SELECT * FROM `FAQ`");
- foreach ($faqs as $faq) {
- $html .= "<dl>";
- if ($_SESSION['locale'] == "de_DE.UTF-8") {
- $html .= sprintf(
- '<dt>%s</dt> <dd>%s</dd>',
- $faq['Frage_de'],
- $faq['Antwort_de']
- );
- } else {
- $html .= sprintf(
- '<dt>%s</dt> <dd>%s</dd>',
- $faq['Frage_en'],
- $faq['Antwort_en']
- );
- }
- $html .= "</dl>";
- }
- 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("<br>(<a href=\"https://events.ccc.de/congress/2012/wiki/Volunteers#What_kind_of_volunteers_are_needed.3F\">%s</a>)", _("Description of job types")), $angel_types, $selected_angel_types),
+ form_checkboxes('angel_types', _("What do you want to do?") . sprintf("<br>(<a href=\"%s\">%s</a>)", $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("<br>(<a href=\"https://events.ccc.de/congress/2012/wiki/Volunteers#What_kind_of_volunteers_are_needed.3F\">%s</a>)", _("Description of job types")), $angel_types, $selected_angel_types),
+ form_checkboxes('angel_types', _("What do you want to do?") . sprintf("<br>(<a href=\"%s\">%s</a>)", $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") . '<sup>1</sup>'),
'filled_select' => make_select($filled, $_SESSION['user_shifts']['filled'], "filled", _("Occupancy")),
- 'task_notice' => '<sup>1</sup>' . _("The tasks shown here are influenced by the preferences you defined in your settings!") . " <a href=\"https://events.ccc.de/congress/2013/wiki/Volunteers#What_kind_of_volunteers_are_needed.3F\">" . _("Description of the jobs.") . "</a>",
+ 'task_notice' => '<sup>1</sup>' . _("The tasks shown here are influenced by the preferences you defined in your settings!") . " <a href=\"" . $faq_url . "\">" . _("Description of the jobs.") . "</a>",
'new_style_checkbox' => '<label><input type="checkbox" name="new_style" value="1" ' . ($_SESSION['user_shifts']['new_style'] ? ' checked' : '') . '> ' . _("Use new style if possible") . '</label>',
'shifts_table' => $shifts_table,
'ical_text' => '<h2>' . _("iCal export") . '</h2><p>' . sprintf(_("Export of shown shifts. <a href=\"%s\">iCal format</a> or <a href=\"%s\">JSON format</a> available (please keep secret, otherwise <a href=\"%s\">reset the api key</a>)."), 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') . '</p>',
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 .= '<li' . ($page == $p ? ' class="selected"' : '') . '><a href="' . page_link_to($page) . '">' . $title . '</a></li>';
return '<nav><ul>' . $menu . '</ul></nav>';
@@ -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 .= '<li' . ($page == $p ? ' class="selected"' : '') . '><a href="' . page_link_to($page) . '">' . $title . '</a></li>';
if ($menu != "")