diff --git a/includes/pages/admin_active.php b/includes/pages/admin_active.php index f0ea9d27..b8d40025 100644 --- a/includes/pages/admin_active.php +++ b/includes/pages/admin_active.php @@ -1,4 +1,8 @@
%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; - } - } + if (! isset($_REQUEST['action'])) { + $faqs_html = ""; + $faqs = sql_select("SELECT * FROM `FAQ`"); + foreach ($faqs as $faq) { + $faqs_html .= sprintf('
%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_free.php b/includes/pages/admin_free.php index 41f6c0e9..86bd38a1 100644 --- a/includes/pages/admin_free.php +++ b/includes/pages/admin_free.php @@ -1,4 +1,8 @@ \n"; - $html .= Get_Text("pub_sprache_text1") . "

\n"; - - $html .= "" . Get_Text("pub_sprache_ShowEntry") . ""; - // ausgabe Tabellenueberschift - $html .= "\t\n\t\t"; - $html .= "\t\t"; - foreach($languages as $language => $language_name) { - $html .= ""; - $Sprachen[$language] = $language_name; - } - $html .= "\t\t"; - $html .= "\t\t"; - - if (isset ($_GET["ShowEntry"])) { - // ausgabe eintraege - $sprache_source = sql_select("SELECT * FROM `Sprache` ORDER BY `TextID`, `Sprache`"); - - $TextID_Old = $sprache_source[0]['TextID']; - foreach($sprache_source as $sprache_entry) { - $TextID_New = $sprache_entry['TextID']; - if ($TextID_Old != $TextID_New) { - $html .= ""; - $html .= "\n"; - $html .= "\t\t\n"; - - foreach ($Sprachen as $Name => $Value) { - $Value = html_entity_decode($Value, ENT_QUOTES); - $html .= "\t\t\n"; - $Sprachen[$Name] = ""; - } - - $html .= "\t\t\n"; - $html .= ""; - $html .= "\n"; - $TextID_Old = $TextID_New; - } - $Sprachen[$sprache_entry['Sprache']] = $sprache_entry['Text']; - } /*FOR*/ - } - - //fuer neu eintraege - $html .= ""; - $html .= "\n"; - $html .= "\t\t\n"; - - foreach ($Sprachen as $Name => $Value) - $html .= "\t\t\n"; - - $html .= "\t\t\n"; - $html .= ""; - $html .= "\n"; - - $html .= "
" . Get_Text("pub_sprache_TextID") . "" . - Get_Text("pub_sprache_Sprache") . " " . $language . - "" . Get_Text("pub_sprache_Edit") . "
$TextID_Old " . - "
\n"; - } /*if( !isset( $TextID ) )*/ - else { - $html .= "edit: " . $_POST["TextID"] . "

"; - foreach ($_POST as $k => $v) { - if ($k != "TextID") { - $sql_test = "SELECT * FROM `Sprache` " . - "WHERE `TextID`='" . sql_escape($_POST["TextID"]) - . "' AND `Sprache`='" - . sql_escape($k) . "'"; - - $erg_test = sql_select("SELECT * FROM `Sprache` WHERE `TextID`='" . sql_escape($_POST["TextID"]) . "' AND `Sprache`='" . sql_escape($k) . "'"); - if (count($erg_test) == 0) { - $sql_save = "INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) " . - "VALUES ('" . sql_escape($_POST["TextID"]) . "', '" - . sql_escape($k) . "', '" - . sql_escape($v) . "')"; - - $html .= $sql_save . "
"; - $Erg = sql_query($sql_save); - $html .= success("$k Save: OK
\n", true); - } else - if ($erg_test[0]['Text'] != $v) { - $sql_save = "UPDATE `Sprache` SET `Text`='" - . sql_escape($v) . "' " . - "WHERE `TextID`='" - . sql_escape($_POST["TextID"]) - . "' AND `Sprache`='" . sql_escape($k) . "' "; - - $html .= $sql_save . "
"; - $Erg = sql_query($sql_save); - $html .= success(" $k Update: OK
\n", true); - } else - $html .= "\t $k no changes
\n"; - } - } - - } - return $html; -} -?> - diff --git a/includes/pages/admin_log.php b/includes/pages/admin_log.php index ce30a246..b4a3c965 100644 --- a/includes/pages/admin_log.php +++ b/includes/pages/admin_log.php @@ -1,4 +1,8 @@ $selected_angel_types, 'accepted_angel_types' => array_merge($accepted_angel_types, $nonrestricted_angel_types)), array('accepted_angel_types' => $nonrestricted_angel_types)), - form_submit('submit_user_angeltypes', Get_Text("Save")) + form_submit('submit_user_angeltypes', _("Save")) )); $html .= "
"; @@ -325,7 +329,7 @@ function admin_user() { 'Tshirt' => '' . $angel['Tshirt'] . '', 'Size' => $angel['Size'], 'lastLogIn' => date('d.m.&\n\b\s\p;H:i', $angel['lastLogIn']), - 'edit' => img_button(page_link_to('admin_user') . '&id=' . $angel['UID'], 'pencil', 'edit'), + 'edit' => img_button(page_link_to('admin_user') . '&id=' . $angel['UID'], 'pencil', _("edit")), ); } $angels = array_map('prepare_angel_table', $angels); diff --git a/includes/pages/admin_user_angeltypes.php b/includes/pages/admin_user_angeltypes.php index dfb67781..b3fca7c0 100644 --- a/includes/pages/admin_user_angeltypes.php +++ b/includes/pages/admin_user_angeltypes.php @@ -1,5 +1,7 @@ ' . $angel_type['name'] . ' ' . img_button(page_link_to('admin_user_angeltypes') . '&confirm_all=' . $angel_type['id'], 'tick', '', 'confirm all') . ' ' . img_button(page_link_to('admin_user_angeltypes') . '&deny_all=' . $angel_type['id'], 'cross', '', 'deny all') . '' . table(array ( + $content[] = '

' . $angel_type['name'] . ' ' . img_button(page_link_to('admin_user_angeltypes') . '&confirm_all=' . $angel_type['id'], 'tick', '', _("confirm all")) . ' ' . img_button(page_link_to('admin_user_angeltypes') . '&deny_all=' . $angel_type['id'], 'cross', '', _("deny all")) . '

' . table(array ( 'name' => "Nick", 'actions' => "" ), $users); diff --git a/includes/pages/guest_faq.php b/includes/pages/guest_faq.php index e639731b..b6452f87 100644 --- a/includes/pages/guest_faq.php +++ b/includes/pages/guest_faq.php @@ -1,10 +1,14 @@ "; - if ($_SESSION['Sprache'] == "DE") { + if ($_SESSION['locale'] == "de_DE.UTF-8") { $html .= sprintf( '
%s
%s
', $faq['Frage_de'], diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php index 8c77cce0..5b34d2c8 100644 --- a/includes/pages/guest_login.php +++ b/includes/pages/guest_login.php @@ -1,10 +1,9 @@ 1) { + + if (isset($_REQUEST['nick']) && strlen(strip_request_item('nick')) > 1) { $nick = strip_request_item('nick'); if (sql_num_query("SELECT * FROM `User` WHERE `Nick`='" . sql_escape($nick) . "' LIMIT 1") > 0) { $ok = false; - $msg .= error(sprintf(Get_Text("makeuser_error_nick1") . "%s" . Get_Text("makeuser_error_nick3"), $nick), true); + $msg .= error(sprintf(_("Your nick "%s" already exists."), $nick), true); } } else { $ok = false; - $msg .= error(sprintf(Get_Text("makeuser_error_nick1") . "%s" . Get_Text("makeuser_error_nick2"), strip_request_item('nick')), true); + $msg .= error(sprintf(_("Your nick "%s" is too short (min. 2 characters)."), strip_request_item('nick')), true); } - - if (isset ($_REQUEST['mail']) && strlen(strip_request_item('mail')) > 0) { + + if (isset($_REQUEST['mail']) && strlen(strip_request_item('mail')) > 0) { $mail = strip_request_item('mail'); - if (!check_email($mail)) { + if (! check_email($mail)) { $ok = false; - $msg .= error(Get_Text("makeuser_error_mail"), true); + $msg .= error(_("E-mail address is not correct."), true); } } else { $ok = false; - $msg .= error("Please enter your e-mail.", true); + $msg .= error(_("Please enter your e-mail."), true); } - - if (isset ($_REQUEST['icq'])) + + if (isset($_REQUEST['icq'])) $icq = strip_request_item('icq'); - if (isset ($_REQUEST['jabber']) && strlen(strip_request_item('jabber')) > 0) { + if (isset($_REQUEST['jabber']) && strlen(strip_request_item('jabber')) > 0) { $jabber = strip_request_item('jabber'); - if (!check_email($jabber)) { + if (! check_email($jabber)) { $ok = false; - $msg .= error("Please check your jabber.", true); + $msg .= error(_("Please check your jabber account information."), true); } } - + if ($enable_tshirt_size) { - if (isset ($_REQUEST['tshirt_size']) && isset ($tshirt_sizes[$_REQUEST['tshirt_size']]) && $_REQUEST['tshirt_size'] != '') + if (isset($_REQUEST['tshirt_size']) && isset($tshirt_sizes[$_REQUEST['tshirt_size']]) && $_REQUEST['tshirt_size'] != '') $tshirt_size = $_REQUEST['tshirt_size']; else { $ok = false; - $msg .= error("Please select your shirt size.", true); + $msg .= error(_("Please select your shirt size."), true); } } - - if (isset ($_REQUEST['password']) && strlen($_REQUEST['password']) >= MIN_PASSWORD_LENGTH) { + + if (isset($_REQUEST['password']) && strlen($_REQUEST['password']) >= MIN_PASSWORD_LENGTH) { if ($_REQUEST['password'] != $_REQUEST['password2']) { $ok = false; - $msg .= error(Get_Text("makeuser_error_password1"), true); + $msg .= error(_("Your passwords don't match."), true); } } else { $ok = false; - $msg .= error(Get_Text("makeuser_error_password2"), true); + $msg .= error(_("Your password is to short (please use at least 6 characters)."), true); } - - $selected_angel_types = array (); + + $selected_angel_types = array(); foreach ($angel_types as $angel_type_id => $angel_type_name) - if (isset ($_REQUEST['angel_types_' . $angel_type_id])) - $selected_angel_types[] = $angel_type_id; - - // Trivia - if (isset ($_REQUEST['lastname'])) + if (isset($_REQUEST['angel_types_' . $angel_type_id])) + $selected_angel_types[] = $angel_type_id; + + // Trivia + if (isset($_REQUEST['lastname'])) $lastname = strip_request_item('lastname'); - if (isset ($_REQUEST['prename'])) + if (isset($_REQUEST['prename'])) $prename = strip_request_item('prename'); - if (isset ($_REQUEST['age']) && preg_match("/^[0-9]{0,4}$/", $_REQUEST['age'])) + if (isset($_REQUEST['age']) && preg_match("/^[0-9]{0,4}$/", $_REQUEST['age'])) $age = strip_request_item('age'); - if (isset ($_REQUEST['tel'])) + if (isset($_REQUEST['tel'])) $tel = strip_request_item('tel'); - if (isset ($_REQUEST['dect'])) + if (isset($_REQUEST['dect'])) $dect = strip_request_item('dect'); - if (isset ($_REQUEST['mobile'])) + if (isset($_REQUEST['mobile'])) $mobile = strip_request_item('mobile'); - if (isset ($_REQUEST['hometown'])) + if (isset($_REQUEST['hometown'])) $hometown = strip_request_item('hometown'); - if (isset ($_REQUEST['comment'])) + if (isset($_REQUEST['comment'])) $comment = strip_request_item_nl('comment'); - + if ($ok) { - sql_query("INSERT INTO `User` SET `Nick`='" . sql_escape($nick) . "', `Vorname`='" . sql_escape($prename) . "', `Name`='" . sql_escape($lastname) . - "', `Alter`='" . sql_escape($age) . "', `Telefon`='" . sql_escape($tel) . "', `DECT`='" . sql_escape($dect) . "', `Handy`='" . sql_escape($mobile) . - "', `email`='" . sql_escape($mail) . "', `ICQ`='" . sql_escape($icq) . "', `jabber`='" . sql_escape($jabber) . "', `Size`='" . sql_escape($tshirt_size) . - "', `Passwort`='" . sql_escape($password_hash) . "', `kommentar`='" . sql_escape($comment) . "', `Hometown`='" . sql_escape($hometown) . "', `CreateDate`=NOW(), `Sprache`='" . sql_escape($_SESSION["Sprache"]) . "'"); - + sql_query("INSERT INTO `User` SET `Nick`='" . sql_escape($nick) . "', `Vorname`='" . sql_escape($prename) . "', `Name`='" . sql_escape($lastname) . "', `Alter`='" . sql_escape($age) . "', `Telefon`='" . sql_escape($tel) . "', `DECT`='" . sql_escape($dect) . "', `Handy`='" . sql_escape($mobile) . "', `email`='" . sql_escape($mail) . "', `ICQ`='" . sql_escape($icq) . "', `jabber`='" . sql_escape($jabber) . "', `Size`='" . sql_escape($tshirt_size) . "', `Passwort`='" . sql_escape($password_hash) . "', `kommentar`='" . sql_escape($comment) . "', `Hometown`='" . sql_escape($hometown) . "', `CreateDate`=NOW(), `Sprache`='" . sql_escape($_SESSION["locale"]) . "'"); + // Assign user-group and set password $user_id = sql_id(); sql_query("INSERT INTO `UserGroups` SET `uid`=" . sql_escape($user_id) . ", `group_id`=-2"); set_password($user_id, $_REQUEST['password']); - + // Assign angel-types $user_angel_types_info = array(); foreach ($selected_angel_types as $selected_angel_type_id) { @@ -122,37 +118,37 @@ function guest_register() { $user_angel_types_info[] = $angel_types[$selected_angel_type_id]; } engelsystem_log("User " . $nick . " signed up as: " . join(", ", $user_angel_types_info)); - success(Get_Text("makeuser_writeOK4")); - //if (!isset ($_SESSION['uid'])) + success(_("Angel registration successful!")); + redirect(page_link_to('login')); } } - - return page(array ( - Get_Text("makeuser_text1"), - $msg, - msg(), - form(array ( - form_text('nick', Get_Text("makeuser_Nickname") . "*", $nick), - form_text('lastname', Get_Text("makeuser_Nachname"), $lastname), - form_text('prename', Get_Text("makeuser_Vorname"), $prename), - form_text('age', Get_Text("makeuser_Alter"), $age), - form_text('tel', Get_Text("makeuser_Telefon"), $tel), - form_text('dect', Get_Text("makeuser_DECT"), $tel), - form_text('mobile', Get_Text("makeuser_Handy"), $mobile), - form_text('mail', Get_Text("makeuser_E-Mail") . "*", $mail), - form_text('icq', "ICQ", $icq), - form_text('jabber', "Jabber", $jabber), - form_text('hometown', Get_Text("makeuser_Hometown"), $hometown), - $enable_tshirt_size ? form_select('tshirt_size', Get_Text("makeuser_T-Shirt"), $tshirt_sizes, $tshirt_size) : '', - form_textarea('comment', Get_Text("makeuser_text2"), $comment), - form_checkboxes('angel_types', "What do you want to do?
(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', Get_Text("makeuser_Passwort") . "*"), - form_password('password2', Get_Text("makeuser_Passwort2") . "*"), - info(Get_Text("makeuser_text3"), true), - form_submit('submit', Get_Text("makeuser_Anmelden")) - )) + + return page(array( + _("By completing this form you're registering as a Chaos-Angel. This script will create you an account in the angel task sheduler."), + $msg, + msg(), + form(array( + form_text('nick', _("Nick") . "*", $nick), + form_text('lastname', _("Last name"), $lastname), + form_text('prename', _("First name"), $prename), + form_text('age', _("Age"), $age), + form_text('tel', _("Phone"), $tel), + form_text('dect', _("DECT"), $tel), + form_text('mobile', _("Mobile"), $mobile), + form_text('mail', _("E-Mail") . "*", $mail), + form_text('icq', _("ICQ"), $icq), + form_text('jabber', _("Jabber"), $jabber), + 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_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") . "*"), + info("*: " . _("Entry required!"), true), + form_submit('submit', _("Register")) + )) )); } @@ -163,55 +159,55 @@ function guest_logout() { function guest_login() { global $user; - + $msg = ""; $nick = ""; - - unset ($_SESSION['uid']); - - if (isset ($_REQUEST['submit'])) { + + unset($_SESSION['uid']); + + if (isset($_REQUEST['submit'])) { $ok = true; - - if (isset ($_REQUEST['nick']) && strlen(strip_request_item('nick')) > 0) { + + if (isset($_REQUEST['nick']) && strlen(strip_request_item('nick')) > 0) { $nick = strip_request_item('nick'); $login_user = sql_select("SELECT * FROM `User` WHERE `Nick`='" . sql_escape($nick) . "'"); if (count($login_user) > 0) { $login_user = $login_user[0]; - if (isset ($_REQUEST['password'])) { - if (!verify_password($_REQUEST['password'], $login_user['Passwort'], $login_user['UID'])) { + if (isset($_REQUEST['password'])) { + if (! verify_password($_REQUEST['password'], $login_user['Passwort'], $login_user['UID'])) { $ok = false; - $msg .= error(Get_Text("pub_index_pass_no_ok"), true); + $msg .= error(_("Your password is incorrect. Please try it again."), true); } } else { $ok = false; - $msg .= error("Please enter a password.", true); + $msg .= error(_("Please enter a password."), true); } } else { $ok = false; - $msg .= error(Get_Text("pub_index_User_unset"), true); + $msg .= error(_("No user was found with that Nickname. Please try again. If you are still having problems, ask an Dispatcher."), true); } } else { $ok = false; - $msg .= error("Please enter a nickname.", true); + $msg .= error(_("Please enter a nickname."), true); } - + if ($ok) { $_SESSION['uid'] = $login_user['UID']; - $_SESSION['Sprache'] = $login_user['Sprache']; + $_SESSION['locale'] = $login_user['Sprache']; redirect(page_link_to('news')); } } - - return page(array ( - $msg, - msg(), - Get_Text("index_text1") . " " . Get_Text("index_text2") . " " . Get_Text("index_text3"), - form(array ( - form_text('nick', Get_Text("index_lang_nick"), $nick), - form_password('password', Get_Text("index_lang_pass")), - form_submit('submit', Get_Text("index_lang_send")) - )), - info(Get_Text("index_text4"), true) + + return page(array( + $msg, + msg(), + _("Resistance is futile! Your biological and physical parameters will be added to our collectiv! Assimilating angel:"), + form(array( + form_text('nick', _("Nick"), $nick), + form_password('password', _("Password")), + form_submit('submit', _("Login")) + )), + info(_("Please note: You have to activate cookies!"), true) )); } ?> diff --git a/includes/pages/user_messages.php b/includes/pages/user_messages.php index fccc6f1d..c71dea92 100644 --- a/includes/pages/user_messages.php +++ b/includes/pages/user_messages.php @@ -1,119 +1,115 @@ 0) - return sprintf('

%s %s %s


', page_link_to("user_messages"), Get_Text("pub_messages_new1"), $new_messages, Get_Text("pub_messages_new2")); + return sprintf('

%s


', page_link_to("user_messages"), sprintf(_("You have %s new messages.", $new_messages))); } - + return ""; } function user_messages() { global $user; - - if (!isset ($_REQUEST['action'])) { + + if (! isset($_REQUEST['action'])) { $users = sql_select("SELECT * FROM `User` WHERE NOT `UID`=" . sql_escape($user['UID']) . " ORDER BY `Nick`"); - - $to_select_data = array ( - "" => "Select recipient..." + + $to_select_data = array( + "" => "Select recipient..." ); - + foreach ($users as $u) $to_select_data[$u['UID']] = $u['Nick']; - + $to_select = html_select_key('to', 'to', $to_select_data, ''); - + $messages_html = ""; $messages = sql_select("SELECT * FROM `Messages` WHERE `SUID`=" . sql_escape($user['UID']) . " OR `RUID`=" . sql_escape($user['UID']) . " ORDER BY `isRead`,`Datum` DESC"); foreach ($messages as $message) { $sender_user_source = User($message['SUID']); - if($sender_user_source === false) + if ($sender_user_source === false) engelsystem_error("Unable to load user."); $receiver_user_source = User($message['RUID']); - if($receiver_user_source === false) + if ($receiver_user_source === false) engelsystem_error("Unable to load user."); - - $messages_html .= sprintf( - ' %s %s %s %s%s', - ($message['isRead'] == 'N' ? ' class="new_message"' : ''), - ($message['isRead'] == 'N' ? '•' : ''), - date("Y-m-d H:i", $message['Datum']), - User_Nick_render($sender_user_source), - User_Nick_render($receiver_user_source), - str_replace("\n", '
', $message['Text']) - ); - + + $messages_html .= sprintf(' %s %s %s %s%s', ($message['isRead'] == 'N' ? ' class="new_message"' : ''), ($message['isRead'] == 'N' ? '•' : ''), date("Y-m-d H:i", $message['Datum']), User_Nick_render($sender_user_source), User_Nick_render($receiver_user_source), str_replace("\n", '
', $message['Text'])); + $messages_html .= ''; if ($message['RUID'] == $user['UID']) { if ($message['isRead'] == 'N') - $messages_html .= '' . Get_Text("pub_messages_MarkRead") . ''; + $messages_html .= '' . _("mark as read") . ''; } else { - $messages_html .= '' . Get_Text("pub_messages_DelMsg") . ''; + $messages_html .= '' . _("delete message") . ''; } $messages_html .= ''; } - - return template_render('../templates/user_messages.html', array ( - 'link' => page_link_to("user_messages"), - 'greeting' => Get_Text("Hello") . User_Nick_render($user) . ",
\n" . Get_Text("pub_messages_text1") . "

\n", - 'messages' => $messages_html, - 'new_label' => Get_Text("pub_messages_Neu"), - 'date_label' => Get_Text("pub_messages_Datum"), - 'from_label' => Get_Text("pub_messages_Von"), - 'to_label' => Get_Text("pub_messages_An"), - 'text_label' => Get_Text("pub_messages_Text"), - 'date' => date("Y-m-d H:i"), - 'from' => User_Nick_render($user), - 'to_select' => $to_select, - 'submit_label' => Get_Text("save") + + return template_render('../templates/user_messages.html', array( + 'link' => page_link_to("user_messages"), + 'greeting' => _(sprintf("Hello %s, here can you leave messages for other angels", User_Nick_render($user))) . '

', + 'messages' => $messages_html, + 'new_label' => _("New"), + 'date_label' => _("Date"), + 'from_label' => _("Transmitted"), + 'to_label' => _("Recipient"), + 'text_label' => _("Message"), + 'date' => date("Y-m-d H:i"), + 'from' => User_Nick_render($user), + 'to_select' => $to_select, + 'submit_label' => _("Save") )); } else { switch ($_REQUEST['action']) { - case "read" : - if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) + case "read": + if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) $id = $_REQUEST['id']; else - return error("Incomplete call, missing Message ID.", true); - + return error(_("Incomplete call, missing Message ID."), true); + $message = sql_select("SELECT * FROM `Messages` WHERE `id`=" . sql_escape($id) . " LIMIT 1"); if (count($message) > 0 && $message[0]['RUID'] == $user['UID']) { sql_query("UPDATE `Messages` SET `isRead`='Y' WHERE `id`=" . sql_escape($id) . " LIMIT 1"); redirect(page_link_to("user_messages")); } else - return error("No Message found.", true); + return error(_("No Message found."), true); break; - - case "delete" : - if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) + + case "delete": + if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) $id = $_REQUEST['id']; else - return error("Incomplete call, missing Message ID.", true); - + return error(_("Incomplete call, missing Message ID."), true); + $message = sql_select("SELECT * FROM `Messages` WHERE `id`=" . sql_escape($id) . " LIMIT 1"); if (count($message) > 0 && $message[0]['SUID'] == $user['UID']) { sql_query("DELETE FROM `Messages` WHERE `id`=" . sql_escape($id) . " LIMIT 1"); redirect(page_link_to("user_messages")); } else - return error("No Message found.", true); + return error(_("No Message found."), true); break; - - case "send" : + + case "send": $text = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['text'])); $to = preg_replace("/([^0-9]{1,})/ui", '', strip_tags($_REQUEST['to'])); if ($text != "" && is_numeric($to) && sql_num_query("SELECT * FROM `User` WHERE `UID`=" . sql_escape($to) . " AND NOT `UID`=" . sql_escape($user['UID']) . " LIMIT 1") > 0) { sql_query("INSERT INTO `Messages` SET `Datum`=" . sql_escape(time()) . ", `SUID`=" . sql_escape($user['UID']) . ", `RUID`=" . sql_escape($to) . ", `Text`='" . sql_escape($text) . "'"); redirect(page_link_to("user_messages")); } else { - return error(Get_Text("pub_messages_Send_Error"), true); + return error(_("Transmitting was terminated with an Error."), true); } break; - - default : - return error("Wrong action.", true); + + default: + return error(_("Wrong action."), true); } } } diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php index 3d3a92ba..14f3685e 100644 --- a/includes/pages/user_myshifts.php +++ b/includes/pages/user_myshifts.php @@ -1,5 +1,7 @@ time() + $LETZTES_AUSTRAGEN * 3600) || in_array('user_shifts_admin', $privileges)) { sql_query("DELETE FROM `ShiftEntry` WHERE `id`=" . sql_escape($id) . " LIMIT 1"); - $msg .= success(Get_Text("pub_myshifts_signed_off"), true); + $msg .= success(_("You have been signed off from the shift."), true); } else - $msg .= error(Get_Text("pub_myshifts_too_late"), true); + $msg .= error(_("It's too late to sign yourself off the shift. If neccessary, as the dispatcher to do so."), true); } else redirect(page_link_to('user_myshifts')); } @@ -94,9 +96,9 @@ function user_myshifts() { $myshift['actions'] = ""; if ($id == $user['UID']) - $myshift['actions'] .= img_button(page_link_to('user_myshifts') . '&edit=' . $shift['id'], 'pencil', 'edit'); + $myshift['actions'] .= img_button(page_link_to('user_myshifts') . '&edit=' . $shift['id'], 'pencil', _("edit")); if (($shift['start'] > time() + $LETZTES_AUSTRAGEN * 3600) || in_array('user_shifts_admin', $privileges)) - $myshift['actions'] .= img_button(page_link_to('user_myshifts') . (($id != $user['UID'])? '&id=' . $id : '') . '&cancel=' . $shift['id'], 'cross', 'sign_off'); + $myshift['actions'] .= img_button(page_link_to('user_myshifts') . (($id != $user['UID'])? '&id=' . $id : '') . '&cancel=' . $shift['id'], 'cross', _("sign off")); $timesum += $shift['end'] - $shift['start']; $myshifts_table[] = $myshift; @@ -106,7 +108,7 @@ function user_myshifts() { return page(array( msg(), - $id == $user['UID'] ? sprintf(Get_Text('pub_myshifts_intro'), $LETZTES_AUSTRAGEN) : '', + $id == $user['UID'] ? sprintf(_('These are your shifts.
Please try to appear 15 minutes before your shift begins!
You can remove yourself from a shift up to %d hours before it starts.'), $LETZTES_AUSTRAGEN) : '', $id != $user['UID'] ? info(sprintf("You are viewing %s's shifts.", $shifts_user['Nick']), true) : '', $id != $user['UID'] ? buttons(array(button(page_link_to('admin_user') . '&id=' . $shifts_user['UID'], "Edit " . $shifts_user['Nick'], 'edit'))) : '', table(array( @@ -117,8 +119,8 @@ function user_myshifts() { 'comment' => "Kommentar", 'actions' => "Aktion" ), $myshifts_table), - $id == $user['UID'] && count($shifts) == 0 ? error(sprintf(Get_Text('pub_myshifts_goto_shifts'), page_link_to('user_shifts')), true) : '', - "

Exports

" . sprintf(Get_Text('inc_schicht_ical_text'), page_link_to_absolute('ical') . '&key=' . $shifts_user['api_key'], page_link_to_absolute('shifts_json_export') . '&key=' . $shifts_user['api_key'], page_link_to('user_myshifts') . '&reset') + $id == $user['UID'] && count($shifts) == 0 ? error(sprintf(_("Go to the shifts table to sign yourself up for some shifts."), page_link_to('user_shifts')), true) : '', + "

Exports

" . 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=' . $shifts_user['api_key'], page_link_to_absolute('shifts_json_export') . '&key=' . $shifts_user['api_key'], page_link_to('user_myshifts') . '&reset') )); } ?> diff --git a/includes/pages/user_news.php b/includes/pages/user_news.php index 481cf738..aa243ef6 100644 --- a/includes/pages/user_news.php +++ b/includes/pages/user_news.php @@ -1,4 +1,12 @@ \n\n"; $dis_rows = ceil(sql_num_query("SELECT * FROM `News` WHERE `Treffen`=1") / $DISPLAY_NEWS); - $html .= Get_Text(5); + $html .= _("Page:"); for ($i = 0; $i < $dis_rows; $i++) { if (isset($_REQUEST['page']) && $i == $_REQUEST['page']) @@ -42,7 +50,7 @@ function display_news($news) { $html .= User_Nick_render($user_source); if ($p != "news_comments") - $html .= ', Kommentare (' . sql_num_query("SELECT * FROM `news_comments` WHERE `Refid`='" . sql_escape($news['ID']) . "'") . ') »'; + $html .= ', ' . _("Comments") . ' (' . sql_num_query("SELECT * FROM `news_comments` WHERE `Refid`='" . sql_escape($news['ID']) . "'") . ') »'; $html .= ''; $html .= '

' . ($news['Treffen'] == 1 ? '[Meeting] ' : '') . ReplaceSmilies($news['Betreff']) . '

'; $html .= '

' . ReplaceSmilies(nl2br($news['Text'])) . '

'; @@ -70,7 +78,7 @@ function user_news_comments() { $html .= '« Back'; $html .= display_news($news); - $html .= '

Kommentare

'; + $html .= '

' . _("Comments") . '

'; $comments = sql_select("SELECT * FROM `news_comments` WHERE `Refid`='" . sql_escape($nid) . "' ORDER BY 'ID'"); foreach ($comments as $comment) { @@ -125,7 +133,7 @@ function user_news() { "VALUES ('" . sql_escape(time()) . "', '" . sql_escape($_POST["betreff"]) . "', '" . sql_escape($_POST["text"]) . "', '" . sql_escape($user['UID']) . "', '" . sql_escape($_POST["treffen"]) . "');"); engelsystem_log("Created news: " . $_POST["betreff"] . ", treffen: " . $_POST["treffen"]); - success(Get_Text(4)); + success(_("Entry saved.")); redirect(page_link_to('user_news')); } @@ -141,7 +149,7 @@ function user_news() { $html .= "
\n\n"; $dis_rows = ceil(sql_num_query("SELECT * FROM `News`") / $DISPLAY_NEWS); - $html .= Get_Text(5); + $html .= _("Page:"); for ($i = 0; $i < $dis_rows; $i++) { if (isset($_REQUEST['page']) && $i == $_REQUEST['page']) @@ -152,29 +160,29 @@ function user_news() { $html .= '
'; if (in_array("admin_news", $privileges)) { $html .= '

-

' . Get_Text(6) . '

+

' . _("Create news:") . '

 
- + - + '; if (in_array('admin_news', $privileges)) { $html .= ' - + '; } $html .= '
' . Get_Text(7) . '' . _("Subject") . ':
' . Get_Text(8) . '' . _("Message") . ':
' . Get_Text(9) . '' . _("Meeting") . ':

- +
'; } return $html; diff --git a/includes/pages/user_questions.php b/includes/pages/user_questions.php index 97035546..e9a9d503 100644 --- a/includes/pages/user_questions.php +++ b/includes/pages/user_questions.php @@ -1,4 +1,8 @@ 1) { + + if (isset($_REQUEST['nick']) && strlen(strip_request_item('nick')) > 1) { $nick = strip_request_item('nick'); if (sql_num_query("SELECT * FROM `User` WHERE `Nick`='" . sql_escape($nick) . "' AND NOT `UID`=" . sql_escape($user['UID']) . " LIMIT 1") > 0) { $ok = false; - $msg .= error(sprintf(Get_Text("makeuser_error_nick1") . "%s" . Get_Text("makeuser_error_nick3"), $nick), true); + $msg .= error(sprintf(_("Your nick "%s" already exists."), $nick), true); } } else { $ok = false; - $msg .= error(sprintf(Get_Text("makeuser_error_nick1") . "%s" . Get_Text("makeuser_error_nick2"), strip_request_item('nick')), true); + $msg .= error(sprintf(_("Your nick "%s" is too short (min. 2 characters)."), strip_request_item('nick')), true); } - - if (isset ($_REQUEST['mail']) && strlen(strip_request_item('mail')) > 0) { + + if (isset($_REQUEST['mail']) && strlen(strip_request_item('mail')) > 0) { $mail = strip_request_item('mail'); - if (!check_email($mail)) { + if (! check_email($mail)) { $ok = false; - $msg .= error(Get_Text("makeuser_error_mail"), true); + $msg .= error(_("E-mail address is not correct."), true); } } else { $ok = false; - $msg .= error("Please enter your e-mail.", true); + $msg .= error(_("Please enter your e-mail."), true); } - - if (isset ($_REQUEST['icq'])) + + if (isset($_REQUEST['icq'])) $icq = strip_request_item('icq'); - if (isset ($_REQUEST['jabber']) && strlen(strip_request_item('jabber')) > 0) { + if (isset($_REQUEST['jabber']) && strlen(strip_request_item('jabber')) > 0) { $jabber = strip_request_item('jabber'); - if (!check_email($jabber)) { + if (! check_email($jabber)) { $ok = false; - $msg .= error("Please check your jabber.", true); + $msg .= error(_("Please check your jabber account information."), true); } } - - if (isset ($_REQUEST['tshirt_size']) && isset ($tshirt_sizes[$_REQUEST['tshirt_size']])) + + if (isset($_REQUEST['tshirt_size']) && isset($tshirt_sizes[$_REQUEST['tshirt_size']])) $tshirt_size = $_REQUEST['tshirt_size']; - elseif($enable_tshirt_size) { + elseif ($enable_tshirt_size) { $ok = false; } - - $selected_angel_types = array (); + + $selected_angel_types = array(); foreach ($angel_types as $angel_type_id => $angel_type_name) - if (isset ($_REQUEST['angel_types_' . $angel_type_id])) - $selected_angel_types[] = $angel_type_id; - - // Trivia - if (isset ($_REQUEST['lastname'])) + if (isset($_REQUEST['angel_types_' . $angel_type_id])) + $selected_angel_types[] = $angel_type_id; + + // Trivia + if (isset($_REQUEST['lastname'])) $lastname = strip_request_item('lastname'); - if (isset ($_REQUEST['prename'])) + if (isset($_REQUEST['prename'])) $prename = strip_request_item('prename'); - if (isset ($_REQUEST['age']) && preg_match("/^[0-9]{0,4}$/", $_REQUEST['age'])) + if (isset($_REQUEST['age']) && preg_match("/^[0-9]{0,4}$/", $_REQUEST['age'])) $age = strip_request_item('age'); - if (isset ($_REQUEST['tel'])) + if (isset($_REQUEST['tel'])) $tel = strip_request_item('tel'); - if (isset ($_REQUEST['dect'])) + if (isset($_REQUEST['dect'])) $dect = strip_request_item('dect'); - if (isset ($_REQUEST['mobile'])) + if (isset($_REQUEST['mobile'])) $mobile = strip_request_item('mobile'); - if (isset ($_REQUEST['hometown'])) + if (isset($_REQUEST['hometown'])) $hometown = strip_request_item('hometown'); - + if ($ok) { - sql_query("UPDATE `User` SET `Nick`='" . sql_escape($nick) . "', `Vorname`='" . sql_escape($prename) . "', `Name`='" . sql_escape($lastname) . - "', `Alter`='" . sql_escape($age) . "', `Telefon`='" . sql_escape($tel) . "', `DECT`='" . sql_escape($dect) . "', `Handy`='" . sql_escape($mobile) . - "', `email`='" . sql_escape($mail) . "', `ICQ`='" . sql_escape($icq) . "', `jabber`='" . sql_escape($jabber) . "', `Size`='" . sql_escape($tshirt_size) . - "', `Hometown`='" . sql_escape($hometown) . "' WHERE `UID`=" . sql_escape($user['UID'])); - + sql_query("UPDATE `User` SET `Nick`='" . sql_escape($nick) . "', `Vorname`='" . sql_escape($prename) . "', `Name`='" . sql_escape($lastname) . "', `Alter`='" . sql_escape($age) . "', `Telefon`='" . sql_escape($tel) . "', `DECT`='" . sql_escape($dect) . "', `Handy`='" . sql_escape($mobile) . "', `email`='" . sql_escape($mail) . "', `ICQ`='" . sql_escape($icq) . "', `jabber`='" . sql_escape($jabber) . "', `Size`='" . sql_escape($tshirt_size) . "', `Hometown`='" . sql_escape($hometown) . "' WHERE `UID`=" . sql_escape($user['UID'])); + // Assign angel-types $user_angel_type_info = array(); sql_query("DELETE FROM `UserAngelTypes` WHERE `user_id`='" . sql_escape($user['UID']) . "' AND `angeltype_id` IN (" . implode(",", array_diff(array_keys($angel_types), $selected_angel_types)) . ")"); foreach ($angel_types_source as $angel_type) if (in_array($angel_type['id'], $selected_angel_types)) $user_angel_type_info[] = $angel_type['name']; - + foreach ($selected_angel_types as $selected_angel_type_id) { if (sql_num_query("SELECT * FROM `UserAngelTypes` WHERE `user_id`=" . sql_escape($user['UID']) . " AND `angeltype_id`=" . sql_escape($selected_angel_type_id) . " LIMIT 1") == 0) sql_query("INSERT INTO `UserAngelTypes` SET `user_id`=" . sql_escape($user['UID']) . ", `angeltype_id`=" . sql_escape($selected_angel_type_id)); } - + engelsystem_log("Own angel types set to: " . join(", ", $user_angel_type_info)); success("Settings saved."); redirect(page_link_to('user_settings')); } - } - elseif (isset ($_REQUEST['submit_password'])) { + } elseif (isset($_REQUEST['submit_password'])) { $ok = true; - - if (!isset ($_REQUEST['password']) || !verify_password($_REQUEST['password'], $user['Passwort'], $user['UID'])) - $msg .= error(Get_Text(30), true); + + if (! isset($_REQUEST['password']) || ! verify_password($_REQUEST['password'], $user['Passwort'], $user['UID'])) + $msg .= error(_("-> not OK. Please try again."), true); elseif (strlen($_REQUEST['new_password']) < MIN_PASSWORD_LENGTH) - $msg .= error(Get_Text("makeuser_error_password2")); + $msg .= error(_("Your password is to short (please use at least 6 characters)."), true); elseif ($_REQUEST['new_password'] != $_REQUEST['new_password2']) - $msg .= error(Get_Text("makeuser_error_password1"), true); - elseif(set_password($user['UID'], $_REQUEST['new_password'])) - success("Password saved."); + $msg .= error(_("Your passwords don't match."), true); + elseif (set_password($user['UID'], $_REQUEST['new_password'])) + success(_("Password saved.")); else - error("Failed setting password."); + error(_("Failed setting password.")); redirect(page_link_to('user_settings')); - } - elseif (isset ($_REQUEST['submit_theme'])) { + } elseif (isset($_REQUEST['submit_theme'])) { $ok = true; - - if (isset ($_REQUEST['theme']) && isset ($themes[$_REQUEST['theme']])) + + if (isset($_REQUEST['theme']) && isset($themes[$_REQUEST['theme']])) $selected_theme = $_REQUEST['theme']; else $ok = false; - + if ($ok) { sql_query("UPDATE `User` SET `color`='" . sql_escape($selected_theme) . "' WHERE `UID`=" . sql_escape($user['UID'])); - + success("Theme changed."); redirect(page_link_to('user_settings')); } - } - elseif (isset ($_REQUEST['submit_language'])) { + } elseif (isset($_REQUEST['submit_language'])) { $ok = true; - - if (isset ($_REQUEST['language']) && isset ($languages[$_REQUEST['language']])) + + if (isset($_REQUEST['language']) && isset($locales[$_REQUEST['language']])) $selected_language = $_REQUEST['language']; else $ok = false; - + if ($ok) { sql_query("UPDATE `User` SET `Sprache`='" . sql_escape($selected_language) . "' WHERE `UID`=" . sql_escape($user['UID'])); - $_SESSION['Sprache'] = $selected_language; - + $_SESSION['locale'] = $selected_language; + success("Language changed."); redirect(page_link_to('user_settings')); } } - - return page(array ( - sprintf(Get_Text("Hallo") . "%s,
" . Get_Text(13), User_Nick_render($user)), - $msg, - msg(), - form(array ( - form_info("", Get_Text("pub_einstellungen_Text_UserData")), - form_text('nick', Get_Text("makeuser_Nickname") . "*", $nick), - form_text('lastname', Get_Text("makeuser_Nachname"), $lastname), - form_text('prename', Get_Text("makeuser_Vorname"), $prename), - form_text('age', Get_Text("makeuser_Alter"), $age), - form_text('tel', Get_Text("makeuser_Telefon"), $tel), - form_text('dect', Get_Text("makeuser_DECT"), $dect), - form_text('mobile', Get_Text("makeuser_Handy"), $mobile), - form_text('mail', Get_Text("makeuser_E-Mail") . "*", $mail), - form_text('icq', "ICQ", $icq), - form_text('jabber', "Jabber", $jabber), - form_text('hometown', Get_Text("makeuser_Hometown"), $hometown), - $enable_tshirt_size ? form_select('tshirt_size', Get_Text("makeuser_T-Shirt"), $tshirt_sizes, $tshirt_size) : '', - form_checkboxes('angel_types', "What do you want to do?
(Description of job types)", $angel_types, $selected_angel_types), - form_submit('submit', Get_Text("save")) - )), - form(array ( - form_info("", Get_Text(14)), - form_password('password', Get_Text(15)), - form_password('new_password', Get_Text(16)), - form_password('new_password2', Get_Text(17)), - form_submit('submit_password', Get_Text("save")) - )), - form(array ( - form_info("", Get_Text(18)), - form_select('theme', Get_Text(19), $themes, $selected_theme), - form_submit('submit_theme', Get_Text("save")) - )), - form(array ( - form_info("", Get_Text(20)), - form_select('language', Get_Text(21), $languages, $selected_language), - form_submit('submit_language', Get_Text("save")) - )) + + return page(array( + sprintf(_("Hello %s, here you can change your personal settings i.e. password, color settings etc."), User_Nick_render($user)), + $msg, + msg(), + form(array( + form_info("", _("Here you can change your user details.")), + form_text('nick', _("Nick") . "*", $nick), + form_text('lastname', _("Last name"), $lastname), + form_text('prename', _("First name"), $prename), + form_text('age', _("Age"), $age), + form_text('tel', _("Phone"), $tel), + form_text('dect', _("DECT"), $tel), + form_text('mobile', _("Mobile"), $mobile), + form_text('mail', _("E-Mail") . "*", $mail), + form_text('icq', _("ICQ"), $icq), + 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_submit('submit', _("Save")) + )), + form(array( + form_info("", _("Here you can change your password.")), + form_password('password', _("Old password:")), + form_password('new_password', _("New password:")), + form_password('new_password2', _("Password confirmation:")), + form_submit('submit_password', _("Save")) + )), + form(array( + form_info("", _("Here you can choose your color settings:")), + form_select('theme', _("Color settings:"), $themes, $selected_theme), + form_submit('submit_theme', _("Save")) + )), + form(array( + form_info("", _("Here you can choose your language:")), + form_select('language', _("Language:"), $locales, $selected_language), + form_submit('submit_language', _("Save")) + )) )); } ?> diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index 069112ec..73afb911 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -1,4 +1,8 @@ '1', - 'name' => Get_Text('occupied') + 'name' => _('occupied') ), array ( 'id' => '0', - 'name' => Get_Text('free') + 'name' => _('free') ) ); @@ -479,7 +483,7 @@ function view_user_shifts() { $is_free = false; $shifts_row = $shift['name']; if (in_array('admin_shifts', $privileges)) - $shifts_row .= ' ' . img_button('?p=user_shifts&edit_shift=' . $shift['SID'], 'pencil', 'edit') . img_button('?p=user_shifts&delete_shift=' . $shift['SID'], 'bin', 'delete'); + $shifts_row .= ' ' . img_button('?p=user_shifts&edit_shift=' . $shift['SID'], 'pencil', _("edit")) . img_button('?p=user_shifts&delete_shift=' . $shift['SID'], 'bin', _("delete")); $shifts_row .= '
'; $query = "SELECT `NeededAngelTypes`.`count`, `AngelTypes`.`id`, `AngelTypes`.`restricted`, `UserAngelTypes`.`confirm_user_id`, `AngelTypes`.`name`, `UserAngelTypes`.`user_id` FROM `NeededAngelTypes` @@ -507,12 +511,12 @@ function view_user_shifts() { else $style="font-weight:normal;"; if (in_array('user_shifts_admin', $privileges)) - $entry_list[] = "" . User_Nick_render($entry) . ' ' . img_button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], 'bin', 'delete') . ''; + $entry_list[] = "" . User_Nick_render($entry) . ' ' . img_button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], 'bin', _("delete")) . ''; else $entry_list[] = "" . User_Nick_render($entry) .""; } if ($angeltype['count'] - count($entries) > 0) { - $inner_text = ($angeltype['count'] - count($entries)) . ' ' . Get_Text($angeltype['count'] - count($entries) == 1 ? 'helper' : 'helpers') . ' ' . Get_Text('needed'); + $inner_text = sprintf(ngettext("%d helper needed", "%d helpers needed", $angeltype['count'] - count($entries)), $angeltype['count'] - count($entries)); // is the shift still running or alternatively is the user shift admin? $user_may_join_shift = true; @@ -605,7 +609,7 @@ function view_user_shifts() { ); if (in_array('admin_shifts', $privileges)) - $shift_row['info'] .= ' ' . img_button('?p=user_shifts&edit_shift=' . $shift['SID'], 'pencil', 'edit') . img_button('?p=user_shifts&delete_shift=' . $shift['SID'], 'bin', 'delete'); + $shift_row['info'] .= ' ' . img_button('?p=user_shifts&edit_shift=' . $shift['SID'], 'pencil', 'edit') . img_button('?p=user_shifts&delete_shift=' . $shift['SID'], 'bin', _("delete")); $shift_row['entries'] .= '
'; $is_free = false; $shift_has_special_needs = 0 < sql_num_query("SELECT `id` FROM `NeededAngelTypes` WHERE `shift_id` = " . $shift['SID']); @@ -630,14 +634,14 @@ function view_user_shifts() { $entry_list = array (); foreach ($entries as $entry) { if (in_array('user_shifts_admin', $privileges)) - $entry_list[] = User_Nick_render($entry) . ' ' . img_button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], 'bin', 'delete'); + $entry_list[] = User_Nick_render($entry) . ' ' . img_button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], 'bin', _("delete")); else $entry_list[] = User_Nick_render($entry); } $angeltype['taken'] = count($entries); // do we need more angles of this type? if ($angeltype['count'] - count($entries) > 0) { - $inner_text = ($angeltype['count'] - count($entries)) . ' ' . Get_Text($angeltype['count'] - count($entries) == 1 ? 'helper' : 'helpers') . ' ' . Get_Text('needed'); + $inner_text = sprintf(ngettext("%d helper needed", "%d helpers needed", $angeltype['count'] - count($entries)), $angeltype['count'] - count($entries)); // is the shift still running or alternatively is the user shift admin? $user_may_join_shift = true; @@ -687,8 +691,8 @@ function view_user_shifts() { } } $shifts_table = table(array( - 'info' => ucfirst(Get_Text("time")) . "/" . ucfirst(Get_Text("room")), - 'entries' => ucfirst(Get_Text("entries")) + 'info' => _("Time") . "/" . _("Room"), + 'entries' => _("Entries") ), $shifts_table); } @@ -696,18 +700,18 @@ if ($user['api_key'] == "") User_reset_api_key($user); return msg() . template_render('../templates/user_shifts.html', array ( - 'room_select' => make_select($rooms, $_SESSION['user_shifts']['rooms'], "rooms", ucfirst(Get_Text("rooms"))), + 'room_select' => make_select($rooms, $_SESSION['user_shifts']['rooms'], "rooms", _("Rooms")), 'start_select' => html_select_key("start_day", "start_day", array_combine($days, $days), $_SESSION['user_shifts']['start_day']), 'start_time' => $_SESSION['user_shifts']['start_time'], 'end_select' => html_select_key("end_day", "end_day", array_combine($days, $days), $_SESSION['user_shifts']['end_day']), 'end_time' => $_SESSION['user_shifts']['end_time'], - 'type_select' => make_select($types, $_SESSION['user_shifts']['types'], "types", ucfirst(Get_Text("tasks")) . '1'), - 'filled_select' => make_select($filled, $_SESSION['user_shifts']['filled'], "filled", ucfirst(Get_Text("occupancy"))), - 'task_notice' => '1' . Get_Text("pub_schichtplan_tasks_notice"), + '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."), 'new_style_checkbox' => '', 'shifts_table' => $shifts_table, - 'ical_text' => sprintf(Get_Text('inc_schicht_ical_text'), htmlspecialchars(make_user_shifts_export_link('ical', $user['api_key'])), htmlspecialchars(make_user_shifts_export_link('shifts_json_export', $user['api_key'])), page_link_to('user_myshifts') . '&reset'), - 'filter' => ucfirst(Get_Text("to_filter")), + 'ical_text' => 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'), + 'filter' => _("Filter"), )); } @@ -741,8 +745,8 @@ function make_select($items, $selected, $name, $title = null) { $html .= implode("\n", $html_items); $html .= '' . "\n"; $html .= buttons(array ( - button("javascript: check_all('selection_" . $name . "')", Get_Text("all"), ""), - button("javascript: uncheck_all('selection_" . $name . "')", Get_Text("none"), "") + button("javascript: check_all('selection_" . $name . "')", _("All"), ""), + button("javascript: uncheck_all('selection_" . $name . "')", _("None"), "") )); $html .= '' . "\n"; return $html; diff --git a/includes/pages/user_wakeup.php b/includes/pages/user_wakeup.php index 63aff97c..4ac5c0b7 100644 --- a/includes/pages/user_wakeup.php +++ b/includes/pages/user_wakeup.php @@ -1,4 +1,8 @@ 0 && $wakeup[0]['UID'] == $user['UID']) { sql_query("DELETE FROM `Wecken` WHERE `ID`=" . sql_escape($id) . " LIMIT 1"); - $html .= success("Wake-up call deleted.", true); + $html .= success(_("Wake-up call deleted."), true); } else - return error("No wake-up found.", true); + return error(_("No wake-up found."), true); break; } } - $html .= "

" . Get_Text("Hello") . User_Nick_render($user) . ",
" - . Get_Text("pub_wake_beschreibung") . "

\n\n"; - $html .= Get_Text("pub_wake_beschreibung2"); + $html .= '

' . sprintf(_("Hello %s, here you can register for a wake-up call. Simply say when and where the angel should come to wake you."), User_Nick_render($user)) . '

'; + $html .= _("All ordered wake-up calls, next first."); $html .= ' - - - - + + + + '; @@ -65,22 +68,22 @@ function user_wakeup() { $html .= ''; $html .= ''; if ($wecken['UID'] == $user['UID']) - $html .= ''; + $html .= ''; else $html .= ''; $html .= ''; } - $html .= '
' . Get_Text("pub_wake_Datum") . '' . Get_Text("pub_waeckliste_Nick") . '' . Get_Text("pub_wake_Ort") . '' . Get_Text("pub_wake_Bemerkung") . '' . _("Date") . '' . _("Nick") . '' . _("Place") . '' . _("Notes") . '
' . $wecken['Ort'] . ' ' . $wecken['Bemerkung'] . ' " . Get_Text("pub_wake_del") . '" . _("delete") . '

' . Get_Text("pub_wake_Text2"); + $html .= '
' . _("Schedule a new wake-up here:"); $html .= template_render('../templates/user_wakeup.html', array ( 'wakeup_link' => page_link_to("user_wakeup"), - 'date_text' => Get_Text("pub_wake_Datum"), + 'date_text' => _("Date"), 'date_value' => date("Y-m-d H:i"), - 'place_text' => Get_Text("pub_wake_Ort"), - 'comment_text' => Get_Text("pub_wake_Bemerkung"), + 'place_text' => _("Place"), + 'comment_text' => _("Notes"), 'comment_value' => "Knock knock Leo, follow the white rabbit to the blue tent", - 'submit_text' => Get_Text("pub_wake_bouton") + 'submit_text' => _("Save") )); return $html; } diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 805888e2..3cd42539 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -40,37 +40,35 @@ function make_navigation() { $menu = ""; $specials = array( - "faq" + "faq" ); $pages = array( - "news", - "user_meetings", - "user_myshifts", - "user_shifts", - "user_messages", - "user_questions", - "user_wakeup", - "admin_arrive", - "admin_active", - "admin_user", - "admin_free", - "admin_usershifts", - "admin_questions", - "admin_angel_types", - "admin_user_angeltypes", - "admin_shifts", - "admin_rooms", - "admin_groups", - "admin_faq", - "admin_language", - "admin_import", - "admin_log" + "news" => news_title(), + "user_meetings" => meetings_title(), + "user_myshifts" => myshifts_title(), + "user_shifts" => shifts_title(), + "user_messages" => messages_title(), + "user_questions" => questions_title(), + "user_wakeup" => wakeup_title(), + "admin_arrive" => admin_arrive_title(), + "admin_active" => admin_active_title(), + "admin_user" => admin_user_title(), + "admin_free" => admin_free_title(), + "admin_questions" => admin_questions_title(), + "admin_angel_types" => admin_angel_types_title(), + "admin_user_angeltypes" => admin_user_angeltypes_title(), + "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) + foreach ($pages as $page => $title) if (in_array($page, $privileges) || in_array($page, $specials)) - $menu .= '' . Get_Text($page) . ''; + $menu .= '' . $title . ''; return ''; } diff --git a/includes/sys_template.php b/includes/sys_template.php index a7662e84..f59cff37 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -259,8 +259,7 @@ function html_select_key($id, $name, $rows, $selected) { } function img_button($link, $icon, $text, $extra_text = '') { - $translation = empty($text) ? '' : Get_Text($text); - return '' . $translation . '' . (empty($extra_text) ? '' : ' ' . $extra_text) . ''; + return '' . $text . '' . (empty($extra_text) ? '' : ' ' . $extra_text) . ''; } function ReplaceSmilies($neueckig) { diff --git a/locale/de_DE.UTF-8/LC_MESSAGES/default.mo b/locale/de_DE.UTF-8/LC_MESSAGES/default.mo index 741be3fb..8146b8b3 100644 Binary files a/locale/de_DE.UTF-8/LC_MESSAGES/default.mo and b/locale/de_DE.UTF-8/LC_MESSAGES/default.mo differ diff --git a/locale/de_DE.UTF-8/LC_MESSAGES/default.po b/locale/de_DE.UTF-8/LC_MESSAGES/default.po index aae53868..db3bb57e 100644 --- a/locale/de_DE.UTF-8/LC_MESSAGES/default.po +++ b/locale/de_DE.UTF-8/LC_MESSAGES/default.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: Engelsystem 2.0\n" -"POT-Creation-Date: 2013-11-25 19:11+0100\n" -"PO-Revision-Date: 2013-11-25 19:11+0100\n" +"POT-Creation-Date: 2013-11-25 19:30+0100\n" +"PO-Revision-Date: 2013-11-25 19:32+0100\n" "Last-Translator: msquare \n" "Language-Team: \n" "Language: de_DE\n" @@ -21,5 +21,141 @@ msgstr "" msgid "Language" msgstr "Sprache" +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_user.php:148 +msgid "Save" +msgstr "Speichern" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:36 +#, php-format +msgid "Your nick "%s" already exists." +msgstr "Der Nick "%s" existiert schon." + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:40 +#, php-format +msgid "Your nick "%s" is too short (min. 2 characters)." +msgstr "Der Nick "%s" ist zu kurz (Mindestens 2 Zeichen)." + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:47 +msgid "E-mail address is not correct." +msgstr "Die E-Mail Adresse ist nicht in Ordnung." + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:51 +msgid "Please enter your e-mail." +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:60 +msgid "Please check your jabber account information." +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:69 +msgid "Please select your shirt size." +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:76 +msgid "Your passwords don't match." +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:80 +msgid "Your password is to short (please use at least 6 characters)." +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:121 +msgid "Angel registration successful!" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:128 +msgid "" +"By completing this form you're registering as a Chaos-Angel. This script " +"will create you an account in the angel task sheduler." +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:132 +msgid "Nick" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:133 +msgid "Last name" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:134 +msgid "First name" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:135 +msgid "Age" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:136 +msgid "Phone" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:137 +msgid "DECT" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:138 +msgid "Mobile" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:139 +msgid "E-Mail" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:140 +msgid "ICQ" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:141 +msgid "Jabber" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:142 +msgid "Hometown" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:143 +msgid "Shirt size" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:144 +msgid "" +"Did you help at former CCC events and which tasks have you performed then?" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:145 +msgid "What do you want to do?" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:145 +msgid "Description of job types" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:146 +msgid "" +"Restricted angel types need will be confirmed later by an archangel. You can " +"change your selection in the options section." +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:147 +msgid "Password" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:148 +msgid "Confirm password" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:149 +msgid "Entry required!" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:150 +msgid "Register" +msgstr "" + +#: /Users/msquare/workspace/projects/engelsystem/includes/pages/user_messages.php:9 +#, php-format +msgid "You have %s new messages." +msgstr "" + #~ msgid "asdf" #~ msgstr "fdsa" diff --git a/public/index.php b/public/index.php index ddb727f8..e8b8b3a1 100644 --- a/public/index.php +++ b/public/index.php @@ -25,9 +25,26 @@ require_once ('includes/helper/error_helper.php'); require_once ('config/config.php'); require_once ('config/config_db.php'); +require_once ('includes/pages/admin_active.php'); +require_once ('includes/pages/admin_angel_types.php'); +require_once ('includes/pages/admin_arrive.php'); +require_once ('includes/pages/admin_faq.php'); +require_once ('includes/pages/admin_free.php'); +require_once ('includes/pages/admin_groups.php'); +require_once ('includes/pages/admin_import.php'); +require_once ('includes/pages/admin_log.php'); require_once ('includes/pages/admin_questions.php'); +require_once ('includes/pages/admin_rooms.php'); +require_once ('includes/pages/admin_shifts.php'); +require_once ('includes/pages/admin_user.php'); require_once ('includes/pages/admin_user_angeltypes.php'); +require_once ('includes/pages/guest_faq.php'); require_once ('includes/pages/user_messages.php'); +require_once ('includes/pages/user_myshifts.php'); +require_once ('includes/pages/user_news.php'); +require_once ('includes/pages/user_questions.php'); +require_once ('includes/pages/user_shifts.php'); +require_once ('includes/pages/user_wakeup.php'); session_start(); @@ -46,7 +63,7 @@ $p = isset($user) ? "news" : "login"; if (isset($_REQUEST['p']) && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) && ($_REQUEST['p'] == 'stats' || (sql_num_query("SELECT * FROM `Privileges` WHERE `name`='" . sql_escape($_REQUEST['p']) . "' LIMIT 1") > 0))) $p = $_REQUEST['p']; -$title = Get_Text($p); +$title = $p; $content = ""; if ($p == "ical") { @@ -64,27 +81,28 @@ if ($p == "ical") { } // Recht dafür vorhanden? elseif (in_array($p, $privileges)) { if ($p == "news") { - require_once ('includes/pages/user_news.php'); + $title = news_title(); $content = user_news(); } elseif ($p == "news_comments") { require_once ('includes/pages/user_news.php'); $content = user_news_comments(); } elseif ($p == "user_meetings") { - require_once ('includes/pages/user_news.php'); + $title = meetings_title(); $content = user_meetings(); } elseif ($p == "user_myshifts") { - require_once ('includes/pages/user_myshifts.php'); + $title = myshifts_title(); $content = user_myshifts(); } elseif ($p == "user_shifts") { - require_once ('includes/pages/user_shifts.php'); + $title = shifts_title(); $content = user_shifts(); } elseif ($p == "user_messages") { + $title = messages_title(); $content = user_messages(); } elseif ($p == "user_questions") { - require_once ('includes/pages/user_questions.php'); + $title = questions_title(); $content = user_questions(); } elseif ($p == "user_wakeup") { - require_once ('includes/pages/user_wakeup.php'); + $title = wakeup_title(); $content = user_wakeup(); } elseif ($p == "user_settings") { require_once ('includes/pages/user_settings.php'); @@ -99,48 +117,49 @@ elseif (in_array($p, $privileges)) { require_once ('includes/pages/guest_login.php'); $content = guest_logout(); } elseif ($p == "admin_questions") { + $title = admin_questions_title(); $content = admin_questions(); } elseif ($p == "admin_user") { - require_once ('includes/pages/admin_user.php'); + $title = admin_user_title(); $content = admin_user(); } elseif ($p == "admin_user_angeltypes") { - require_once ('includes/pages/admin_user_angeltypes.php'); + $title = admin_user_angeltypes_title(); $content = admin_user_angeltypes(); } elseif ($p == "admin_arrive") { - require_once ('includes/pages/admin_arrive.php'); + $title = admin_arrive_title(); $content = admin_arrive(); } elseif ($p == "admin_active") { - require_once ('includes/pages/admin_active.php'); + $title = admin_active_title(); $content = admin_active(); } elseif ($p == "admin_free") { - require_once ('includes/pages/admin_free.php'); + $title = admin_free_title(); $content = admin_free(); } elseif ($p == "admin_news") { require_once ('includes/pages/admin_news.php'); $content = admin_news(); } elseif ($p == "admin_angel_types") { - require_once ('includes/pages/admin_angel_types.php'); + $title = admin_angel_types_title(); $content = admin_angel_types(); } elseif ($p == "admin_rooms") { - require_once ('includes/pages/admin_rooms.php'); + $title = admin_rooms_title(); $content = admin_rooms(); } elseif ($p == "admin_groups") { - require_once ('includes/pages/admin_groups.php'); + $title = admin_groups_title(); $content = admin_groups(); } elseif ($p == "admin_faq") { - require_once ('includes/pages/admin_faq.php'); + $title = admin_faq_title(); $content = admin_faq(); } elseif ($p == "admin_language") { require_once ('includes/pages/admin_language.php'); $content = admin_language(); } elseif ($p == "admin_import") { - require_once ('includes/pages/admin_import.php'); + $title = admin_import_title(); $content = admin_import(); } elseif ($p == "admin_shifts") { - require_once ('includes/pages/admin_shifts.php'); + $title = admin_shifts_title(); $content = admin_shifts(); } elseif ($p == "admin_log") { - require_once ('includes/pages/admin_log.php'); + $title = admin_log_title(); $content = admin_log(); } else { require_once ('includes/pages/guest_start.php'); @@ -150,13 +169,13 @@ elseif (in_array($p, $privileges)) { require_once ('includes/pages/guest_credits.php'); $content = guest_credits(); } elseif ($p == "faq") { - require_once ('includes/pages/guest_faq.php'); + $title = faq_title(); $content = guest_faq(); } else { // Wenn schon eingeloggt, keine-Berechtigung-Seite anzeigen if (isset($user)) { - $title = Get_Text("no_access_title"); - $content = Get_Text("no_access_text"); + $title = _("No Access"); + $content = _("You don't have permission to view this page. You probably have to sign in or register in order to gain access!"); } else { // Sonst zur Loginseite leiten redirect(page_link_to("login")); @@ -169,7 +188,7 @@ if (isset($user) && $p != "user_messages") // Hinweis für Engel, die noch nicht angekommen sind if (isset($user) && $user['Gekommen'] == 0) - $content = error("You are not marked as arrived. Please go to heaven's desk, get your angel badge and/or tell them that you arrived already.", true) . $content; + $content = error(_("You are not marked as arrived. Please go to heaven's desk, get your angel badge and/or tell them that you arrived already."), true) . $content; // Erzengel Hinweis für unbeantwortete Fragen if (isset($user) && $p != "admin_questions")