summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/account.module14
-rw-r--r--modules/drupal.module6
-rw-r--r--modules/drupal/drupal.module6
-rw-r--r--modules/headline.module2
-rw-r--r--modules/locale.module26
-rw-r--r--modules/locale/locale.module26
6 files changed, 57 insertions, 23 deletions
diff --git a/modules/account.module b/modules/account.module
index 88a268426..7aeb34ca7 100644
--- a/modules/account.module
+++ b/modules/account.module
@@ -143,7 +143,7 @@ function account_access($account) {
$data = explode(";", $account->access);
foreach ($data as $array) {
$access = explode(":", $array);
- if ($access[0]) $output .= " $access[0]";
+ if ($access[0]) $output .= " <A HREF=\"admin.php?mod=$access[0]\">$access[0]</A>";
}
return $output;
}
@@ -173,15 +173,9 @@ function account_comments($id) {
}
function account_edit_save($name, $edit) {
- foreach ($edit as $key=>$value) {
- if ($key != "access") $query .= "$key = '". addslashes($value) ."', ";
- }
-
- db_query("UPDATE users SET $query access = '' WHERE userid = '$name'");
-
- if ($edit["access"]) {
- foreach ($edit["access"] as $key=>$value) user_set(user_load($name), "access", $value, 1);
- }
+ foreach ($edit as $key=>$value) if ($key != "access") $query .= "$key = '". addslashes($value) ."', ";
+ db_query("UPDATE users SET $query last_access = '". time() ."' WHERE userid = '$name'");
+ foreach ($edit["access"] as $key=>$value) user_set(user_load($name), "access", $value, 1);
watchdog("message", "account: modified user '$name'");
}
diff --git a/modules/drupal.module b/modules/drupal.module
index 47a08265a..dce787314 100644
--- a/modules/drupal.module
+++ b/modules/drupal.module
@@ -13,9 +13,9 @@ function drupal_render($id, $cid) {
$output .= " <P>We don't have a real demo site yet but drupal is used by (and created for) <A HREF=\"http://drop.org/\">http://drop.org/</A>. Create an account, play with it for a bit, read the <A HREF=\"module.php?mod=documentation\">documentation</A> and spend some time getting used to it.</P>\n";
$theme->box("Introduction", $output);
- $output = "<LI><A HREF=\"drupal/drupal-1.00.tgz\">drupal 1.00</A> (2000/01/15 - latest version)</LI>\n";
- $output .= "<LI><A HREF=\"drupal/drupal-1.00-rc2.tgz\">drupal 1.00-rc2</A> (2000/01/08)</LI>\n";
- $output .= "<LI><A HREF=\"drupal/drupal-1.00-rc1.tgz\">drupal 1.00-rc1</A> (2000/01/01)</LI>\n";
+ $output = "<LI><A HREF=\"drupal/drupal-1.00.tgz\">drupal 1.00</A> (2001/01/15 - latest version)</LI>\n";
+ $output .= "<LI><A HREF=\"drupal/drupal-1.00-rc2.tgz\">drupal 1.00-rc2</A> (2001/01/08)</LI>\n";
+ $output .= "<LI><A HREF=\"drupal/drupal-1.00-rc1.tgz\">drupal 1.00-rc1</A> (2001/01/01)</LI>\n";
$theme->box("Download", $output);
unset($output);
diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module
index 47a08265a..dce787314 100644
--- a/modules/drupal/drupal.module
+++ b/modules/drupal/drupal.module
@@ -13,9 +13,9 @@ function drupal_render($id, $cid) {
$output .= " <P>We don't have a real demo site yet but drupal is used by (and created for) <A HREF=\"http://drop.org/\">http://drop.org/</A>. Create an account, play with it for a bit, read the <A HREF=\"module.php?mod=documentation\">documentation</A> and spend some time getting used to it.</P>\n";
$theme->box("Introduction", $output);
- $output = "<LI><A HREF=\"drupal/drupal-1.00.tgz\">drupal 1.00</A> (2000/01/15 - latest version)</LI>\n";
- $output .= "<LI><A HREF=\"drupal/drupal-1.00-rc2.tgz\">drupal 1.00-rc2</A> (2000/01/08)</LI>\n";
- $output .= "<LI><A HREF=\"drupal/drupal-1.00-rc1.tgz\">drupal 1.00-rc1</A> (2000/01/01)</LI>\n";
+ $output = "<LI><A HREF=\"drupal/drupal-1.00.tgz\">drupal 1.00</A> (2001/01/15 - latest version)</LI>\n";
+ $output .= "<LI><A HREF=\"drupal/drupal-1.00-rc2.tgz\">drupal 1.00-rc2</A> (2001/01/08)</LI>\n";
+ $output .= "<LI><A HREF=\"drupal/drupal-1.00-rc1.tgz\">drupal 1.00-rc1</A> (2001/01/01)</LI>\n";
$theme->box("Download", $output);
unset($output);
diff --git a/modules/headline.module b/modules/headline.module
index 6d5f19a5b..4ab0668e7 100644
--- a/modules/headline.module
+++ b/modules/headline.module
@@ -204,7 +204,7 @@ function headline_export($uri) {
while ($story = db_fetch_object($result)) {
print "<item>\n";
- print " <title>$story->subject</title>\n";
+ print " <title>". check_export($story->subject) ."</title>\n";
print " <link>". $site_url ."story.php?id=$story->id</link>\n";
print "</item>\n";
}
diff --git a/modules/locale.module b/modules/locale.module
index 43fd06587..464b3bc41 100644
--- a/modules/locale.module
+++ b/modules/locale.module
@@ -5,7 +5,27 @@ $module = array("help" => "locale_help",
"locale" => "locale_locale");
function locale_help() {
- print "under construction";
+ ?>
+ <P>Normally programs are written and documented in English, and use English to interact with users. This is true for a great deal of websites. However, most people are less comfortable with English than with their own native language, and would prefer to use their mother tongue as much as possible. Many people love see their website showing a lot less of English, and far more of their own language.</P>
+ <P>Therefore drupal provides a framework to setup a multi-lingual website, or to overwrite the default texts in English. We explored the various alternatives to support internationalization and decided to design the framework in such a way that the impact of internationalization on drupal's sources is minimized, modular and that it doesn't require a HTML or PHP wizard to maintain translations. Maintaining translations had to be simple so it became as easy as filling out forms on the administration page. A side effect is that translation support adds significant overhead to the dynamic generation of your website. If you don't need translation support, consider to turn it off.</P>
+
+ <H3>Adding a new language</H3>
+
+ <P>Adding a new language requires you to edit your configuration file and to edit your SQL database. Assuming you want to support Dutch (ISO 639 code: "nl") and French (ISO 639 code: "fr"), you add the following line to your configuration file's <CODE>$languages</CODE>-variable:</P>
+ <PRE>
+ $languages = array("nl" => "Dutch / Nederlands", "fr" => "French / Francais");
+ </PRE>
+ <P>Note that the default language must come first and that if you want to overwrite the default text you can add an entry for English (ISO 639 code: "en"):</P>
+ <PRE>
+ $languages = array("en" => "English", "nl" => "Dutch / Nederlands", "fr" => "French / Francais");
+ </PRE>
+ <P>After having edited your configuration file, make sure your SQL table "locales" has the required database fields setup to host your new translations. You can add the required rows to your "locales" table from the MySQL prompt:</P>
+ <PRE>
+ mysql> ALTER TABLE locales ADD en TEXT DEFAULT '' NOT NULL;
+ mysql> ALTER TABLE locales ADD nl TEXT DEFAULT '' NOT NULL;
+ mysql> ALTER TABLE locales ADD fr TEXT DEFAULT '' NOT NULL;
+ </PRE>
+ <?
}
function locale_delete($id) {
@@ -24,10 +44,10 @@ function locale_edit($id) {
if ($translation = db_fetch_object($result)) {
$output .= "<FORM ACTION=\"admin.php?mod=locale\" METHOD=\"post\">\n";
$output .= "<B>Original string:</B><BR>\n";
- $output .= check_output($translation->string) ."<P>";
+ $output .= "<PRE>". wordwrap(check_output($translation->string)) ."</PRE><P>";
foreach ($languages as $code=>$language) {
$output .= "<B>$language:</B><BR>";
- $output .= "<INPUT TYPE=\"text\" NAME=\"edit[$code]\" VALUE=\"". check_textfield($translation->$code) ."\"><P>";
+ $output .= (strlen($translation->string) > 30) ? "<TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"10\" NAME=\"edit[$code]\">". check_textarea($translation->$code) ."</TEXTAREA><P>" : "<INPUT TYPE=\"text\" NAME=\"edit[$code]\" SIZE=\"50\" VALUE=\"". check_textfield($translation->$code) ."\"><P>";
}
$output .= "<INPUT NAME=\"id\" TYPE=\"hidden\" VALUE=\"$id\">\n";
$output .= "<INPUT NAME=\"op\" TYPE=\"submit\" VALUE=\"Save translations\">\n";
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index 43fd06587..464b3bc41 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -5,7 +5,27 @@ $module = array("help" => "locale_help",
"locale" => "locale_locale");
function locale_help() {
- print "under construction";
+ ?>
+ <P>Normally programs are written and documented in English, and use English to interact with users. This is true for a great deal of websites. However, most people are less comfortable with English than with their own native language, and would prefer to use their mother tongue as much as possible. Many people love see their website showing a lot less of English, and far more of their own language.</P>
+ <P>Therefore drupal provides a framework to setup a multi-lingual website, or to overwrite the default texts in English. We explored the various alternatives to support internationalization and decided to design the framework in such a way that the impact of internationalization on drupal's sources is minimized, modular and that it doesn't require a HTML or PHP wizard to maintain translations. Maintaining translations had to be simple so it became as easy as filling out forms on the administration page. A side effect is that translation support adds significant overhead to the dynamic generation of your website. If you don't need translation support, consider to turn it off.</P>
+
+ <H3>Adding a new language</H3>
+
+ <P>Adding a new language requires you to edit your configuration file and to edit your SQL database. Assuming you want to support Dutch (ISO 639 code: "nl") and French (ISO 639 code: "fr"), you add the following line to your configuration file's <CODE>$languages</CODE>-variable:</P>
+ <PRE>
+ $languages = array("nl" => "Dutch / Nederlands", "fr" => "French / Francais");
+ </PRE>
+ <P>Note that the default language must come first and that if you want to overwrite the default text you can add an entry for English (ISO 639 code: "en"):</P>
+ <PRE>
+ $languages = array("en" => "English", "nl" => "Dutch / Nederlands", "fr" => "French / Francais");
+ </PRE>
+ <P>After having edited your configuration file, make sure your SQL table "locales" has the required database fields setup to host your new translations. You can add the required rows to your "locales" table from the MySQL prompt:</P>
+ <PRE>
+ mysql> ALTER TABLE locales ADD en TEXT DEFAULT '' NOT NULL;
+ mysql> ALTER TABLE locales ADD nl TEXT DEFAULT '' NOT NULL;
+ mysql> ALTER TABLE locales ADD fr TEXT DEFAULT '' NOT NULL;
+ </PRE>
+ <?
}
function locale_delete($id) {
@@ -24,10 +44,10 @@ function locale_edit($id) {
if ($translation = db_fetch_object($result)) {
$output .= "<FORM ACTION=\"admin.php?mod=locale\" METHOD=\"post\">\n";
$output .= "<B>Original string:</B><BR>\n";
- $output .= check_output($translation->string) ."<P>";
+ $output .= "<PRE>". wordwrap(check_output($translation->string)) ."</PRE><P>";
foreach ($languages as $code=>$language) {
$output .= "<B>$language:</B><BR>";
- $output .= "<INPUT TYPE=\"text\" NAME=\"edit[$code]\" VALUE=\"". check_textfield($translation->$code) ."\"><P>";
+ $output .= (strlen($translation->string) > 30) ? "<TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"10\" NAME=\"edit[$code]\">". check_textarea($translation->$code) ."</TEXTAREA><P>" : "<INPUT TYPE=\"text\" NAME=\"edit[$code]\" SIZE=\"50\" VALUE=\"". check_textfield($translation->$code) ."\"><P>";
}
$output .= "<INPUT NAME=\"id\" TYPE=\"hidden\" VALUE=\"$id\">\n";
$output .= "<INPUT NAME=\"op\" TYPE=\"submit\" VALUE=\"Save translations\">\n";