admin language / translation

This commit is contained in:
Philip Häusler 2011-06-03 14:38:12 +02:00
parent 28ac46aa4e
commit e7a25448f2
6 changed files with 137 additions and 24 deletions

View File

@ -3,7 +3,7 @@
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 03. Juni 2011 um 06:12
-- Erstellungszeit: 03. Juni 2011 um 12:37
-- Server Version: 5.1.44
-- PHP-Version: 5.3.1
@ -71,25 +71,26 @@ CREATE TABLE IF NOT EXISTS `Counter` (
--
INSERT INTO `Counter` (`URL`, `Anz`) VALUES
('news', 193),
('login', 28),
('logout', 14),
('start', 27),
('news', 198),
('login', 34),
('logout', 15),
('start', 28),
('faq', 19),
('credits', 3),
('credits', 7),
('register', 10),
('admin_rooms', 89),
('admin_rooms', 90),
('admin_angel_types', 71),
('user_settings', 134),
('user_messages', 113),
('admin_groups', 130),
('admin_groups', 135),
('user_questions', 55),
('admin_questions', 43),
('admin_faq', 55),
('admin_news', 33),
('news_comments', 151),
('admin_user', 196),
('user_meetings', 5);
('admin_user', 206),
('user_meetings', 5),
('admin_language', 22);
-- --------------------------------------------------------
@ -135,7 +136,7 @@ CREATE TABLE IF NOT EXISTS `GroupPrivileges` (
`privilege_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `group_id` (`group_id`,`privilege_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=71 ;
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=73 ;
--
-- Daten für Tabelle `GroupPrivileges`
@ -151,14 +152,15 @@ INSERT INTO `GroupPrivileges` (`id`, `group_id`, `privilege_id`) VALUES
(61, -4, 6),
(66, -2, 15),
(65, -2, 3),
(12, -5, 10),
(71, -5, 10),
(60, -4, 12),
(59, -4, 14),
(64, -2, 4),
(58, -4, 13),
(57, -4, 7),
(63, -4, 5),
(70, -2, 8);
(70, -2, 8),
(72, -5, 18);
-- --------------------------------------------------------
@ -272,7 +274,7 @@ CREATE TABLE IF NOT EXISTS `Privileges` (
`desc` varchar(1024) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=18 ;
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=19 ;
--
-- Daten für Tabelle `Privileges`
@ -295,7 +297,8 @@ INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES
(14, 'admin_news', 'Administrate the news section'),
(15, 'news_comments', 'User can comment news'),
(16, 'admin_user', 'Administrate the angels'),
(17, 'user_meetings', 'Lists meetings (news)');
(17, 'user_meetings', 'Lists meetings (news)'),
(18, 'admin_language', 'Translate the system');
-- --------------------------------------------------------
@ -1040,7 +1043,9 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES
('admin_news', 'DE', 'News verwalten'),
('admin_news', 'EN', 'Manage news'),
('user_meetings', 'DE', 'Treffen'),
('user_meetings', 'EN', 'Meetings');
('user_meetings', 'EN', 'Meetings'),
('admin_language', 'DE', 'Übersetzung'),
('admin_language', 'EN', 'Translation');
-- --------------------------------------------------------
@ -1083,8 +1088,8 @@ CREATE TABLE IF NOT EXISTS `User` (
--
INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Size`, `Passwort`, `Gekommen`, `Aktiv`, `Tshirt`, `color`, `Sprache`, `Avatar`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`) VALUES
(1, 'admin', 'Gates', 'Bill', 42, '', '', '', '', '', '', '', '4297f44b13955235245b2497399d7a93', 1, 1, 0, 10, 'DE', 115, 'L', 1307081238, '0000-00-00 00:00:00', '', '', ''),
(148, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', '', '4297f44b13955235245b2497399d7a93', 0, 1, 1, 10, 'DE', 0, 'L', 1307081543, '2011-06-03 07:55:24', 'AudioEngel', '', '');
(1, 'admin', 'Gates', 'Bill', 42, '', '', '', '', '', '', '', '4297f44b13955235245b2497399d7a93', 1, 1, 0, 10, 'DE', 115, 'L', 1307104634, '0000-00-00 00:00:00', '', '', ''),
(148, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', '', '4297f44b13955235245b2497399d7a93', 0, 1, 1, 10, 'DE', 0, 'L', 1307082872, '2011-06-03 07:55:24', 'AudioEngel', '', '');
-- --------------------------------------------------------
@ -1174,7 +1179,7 @@ CREATE TABLE IF NOT EXISTS `UserGroups` (
`group_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `uid` (`uid`,`group_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ;
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ;
--
-- Daten für Tabelle `UserGroups`
@ -1185,9 +1190,7 @@ INSERT INTO `UserGroups` (`id`, `uid`, `group_id`) VALUES
(2, 1, -3),
(3, 1, -5),
(4, 1, -4),
(8, 148, -2),
(9, 148, -3),
(10, 148, -4);
(11, 148, -2);
-- --------------------------------------------------------

View File

@ -0,0 +1,100 @@
<?php
function admin_language() {
global $user;
$html = "";
if (!isset ($_POST["TextID"])) {
$html .= Get_Text("Hello") . $user['Nick'] . ", <br />\n";
$html .= Get_Text("pub_sprache_text1") . "<br /><br />\n";
$html .= "<a href=\"" . page_link_to("admin_language") . "&ShowEntry=y\">" . Get_Text("pub_sprache_ShowEntry") . "</a>";
// ausgabe Tabellenueberschift
$SQL_Sprachen = "SELECT `Sprache` FROM `Sprache` GROUP BY `Sprache`;";
$erg_Sprachen = sql_query($SQL_Sprachen);
for ($i = 0; $i < mysql_num_rows($erg_Sprachen); $i++)
$Sprachen[mysql_result($erg_Sprachen, $i, "Sprache")] = $i;
$html .= "\t<table border=\"0\" class=\"border\" cellpadding=\"2\" cellspacing=\"1\">\n\t\t<tr>";
$html .= "\t\t<td class=\"contenttopic\"><b>" . Get_Text("pub_sprache_TextID") . "</b></td>";
foreach ($Sprachen as $Name => $Value)
$html .= "<td class=\"contenttopic\"><b>" .
Get_Text("pub_sprache_Sprache") . " " . $Name .
"</b></td>";
$html .= "\t\t<td class=\"contenttopic\"><b>" . Get_Text("pub_sprache_Edit") . "</b></td>";
$html .= "\t\t</tr>";
if (isset ($_GET["ShowEntry"])) {
// ausgabe eintraege
$SQL = "SELECT * FROM `Sprache` ORDER BY `TextID`;";
$erg = sql_query($SQL);
$TextID_Old = mysql_result($erg, 0, "TextID");
for ($i = 0; $i < mysql_num_rows($erg); $i++) {
$TextID_New = mysql_result($erg, $i, "TextID");
if ($TextID_Old != $TextID_New) {
$html .= "<form action=\"" . page_link_to("admin_language") . "\" method=\"post\">";
$html .= "<tr class=\"content\">\n";
$html .= "\t\t<td>$TextID_Old " .
"<input name=\"TextID\" type=\"hidden\" value=\"$TextID_Old\"> </td>\n";
foreach ($Sprachen as $Name => $Value) {
$Value = html_entity_decode($Value, ENT_QUOTES);
$html .= "\t\t<td><textarea name=\"$Name\" cols=\"22\" rows=\"8\">$Value</textarea></td>\n";
$Sprachen[$Name] = "";
}
$html .= "\t\t<td><input type=\"submit\" value=\"Save\"></td>\n";
$html .= "</tr>";
$html .= "</form>\n";
$TextID_Old = $TextID_New;
}
$Sprachen[mysql_result($erg, $i, "Sprache")] = mysql_result($erg, $i, "Text");
} /*FOR*/
}
//fuer neu eintraege
$html .= "<form action=\"" . page_link_to("admin_language") . "\" method=\"post\">";
$html .= "<tr class=\"content\">\n";
$html .= "\t\t<td><input name=\"TextID\" type=\"text\" size=\"40\" value=\"new\"> </td>\n";
foreach ($Sprachen as $Name => $Value)
$html .= "\t\t<td><textarea name=\"$Name\" cols=\"22\" rows=\"8\">$Name Text</textarea></td>\n";
$html .= "\t\t<td><input type=\"submit\" value=\"Save\"></td>\n";
$html .= "</tr>";
$html .= "</form>\n";
$html .= "</table>\n";
} /*if( !isset( $TextID ) )*/
else {
$html .= "edit: " . $_POST["TextID"] . "<br /><br />";
foreach ($_POST as $k => $v) {
if ($k != "TextID") {
$sql_test = "SELECT * FROM `Sprache` " .
"WHERE `TextID`='" . $_POST["TextID"] . "' AND `Sprache`='$k'";
$erg_test = sql_query($sql_test);
if (mysql_num_rows($erg_test) == 0) {
$sql_save = "INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) " .
"VALUES ('" . $_POST["TextID"] . "', '$k', '$v')";
$html .= $sql_save . "<br />";
$Erg = sql_query($sql_save);
$html .= success("$k Save: OK<br />\n");
} else
if (mysql_result($erg_test, 0, "Text") != $v) {
$sql_save = "UPDATE `Sprache` SET `Text`='$v' " .
"WHERE `TextID`='" . $_POST["TextID"] . "' AND `Sprache`='$k' ";
$html .= $sql_save . "<br />";
$Erg = sql_query($sql_save);
$html .= success(" $k Update: OK<br />\n");
} else
$html .= "\t $k no changes<br />\n";
}
}
}
return $html;
}
?>

View File

@ -243,7 +243,7 @@ function admin_user() {
<th><a href="' . page_link_to("admin_user") . '&OrderBy=Gekommen">Gekommen</a></th>
<th><a href="' . page_link_to("admin_user") . '&OrderBy=Aktiv">Aktiv</a></th>
<th><a href="' . page_link_to("admin_user") . '&OrderBy=Tshirt">T-Shirt</a></th>
<th><a href="' . page_link_to("admin_user") . '&OrderBy=CreateDate">Registrier</a></th>
<th><a href="' . page_link_to("admin_user") . '&OrderBy=CreateDate">Registriert</a></th>
<th>&Auml;nd.</th>
</tr></thead>';
$Gekommen = 0;

View File

@ -39,7 +39,8 @@ function make_navigation() {
"admin_shifts",
"admin_rooms",
"admin_groups",
"admin_faq"
"admin_faq",
"admin_language"
));
return $menu;
}

View File

@ -1,8 +1,13 @@
jetzt:
* aktiv
* gekommen
* tshirt
* schichtimport
* schichtadministration
* meine schichten
* schichten
* Services?
* DECT-kram?
* weckservice?
später:

View File

@ -93,6 +93,10 @@ if (in_array($p, $privileges)) {
elseif ($p == "admin_faq") {
require_once ('includes/pages/admin_faq.php');
$content = admin_faq();
}
elseif ($p == "admin_language") {
require_once ('includes/pages/admin_language.php');
$content = admin_language();
} else {
require_once ('includes/pages/guest_start.php');
$content = guest_start();