From b6bf48acb721b915040e7d850081c76f557309a1 Mon Sep 17 00:00:00 2001 From: ralf-bonn Date: Sat, 7 Feb 2004 19:08:27 +0000 Subject: [PATCH] =?utf8?q?Einige=20kleinere=20=C4nderungen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lang/de/docs/coding.html | 187 +++++++++++++++++++++++++++++++++++ lang/de/docs/docstyles.css | 119 ++++++++++++++++++++++ lang/de/docs/installamp.html | 112 +++++++++++++++++++++ 3 files changed, 418 insertions(+) create mode 100644 lang/de/docs/coding.html create mode 100644 lang/de/docs/docstyles.css create mode 100644 lang/de/docs/installamp.html diff --git a/lang/de/docs/coding.html b/lang/de/docs/coding.html new file mode 100644 index 0000000000..0e9056abb3 --- /dev/null +++ b/lang/de/docs/coding.html @@ -0,0 +1,187 @@ + + +Moodle Dokumentation: Coding Guidelines + + + + +

Moodle Coding Guidelines

+

Die Stabilität eines Programms wie Moodle hängt weesentlich davon ab, dass alle Entwickler des Programmcodes bestimmte Grundregeln einheitlich anwenden. Diese sind hier definert.

+

Dieser Text wird vorläufig nicht ins Deustche übersetzt. Wir gehen davon aus, dass alle Anwender, dier selber Programmteile für Moodle bearbeiten wollen so viel Englisch lesen und verstehen können dass sie diesen Text im Original verstehen.

+

Any collaborative project needs consistency and stability + to stay strong.

+

These guidelines are to provide a goal for all Moodle code + to strive to. It's true that some of the older existing code falls short in + a few areas, but it will all be fixed eventually. All new code definitely must + adhere to these standards as closely as possible.

+

General Rules

+
    +
  1. All code files should use the .php extension.
  2. +
  3. All template files should use the .html extension.
  4. +
  5. All text files should use Unix-style text format (most text + editors have this as an option).
  6. +
  7. All php tags must be 'full' tags like <?php + ?> ... not 'short' tags like <? ?>. +
  8. +
  9. All existing copyright notices must be retained. You can + add your own if necessary.
  10. +
  11. Each file should include the main config.php file.
  12. +
  13. Each file should check that the user is authenticated correctly, + using require_login() and isadmin(), isteacher(), iscreator() or isstudent().
  14. +
  15. All access to databases should use the functions in lib/datalib.php + whenever possible - this allows compatibility across a wide range of databases. + You should find that almost anything is possible using these functions. If you must write SQL code then make sure it is: cross-platform; restricted to specific functions + within your code (usually a lib.php file); and clearly marked.
  16. +
  17. Don't create or use global variables except for the standard + $CFG, $SESSION, $THEME and $USER.
  18. +
  19. All variables should be initialised or at least tested for + existence using isset() or empty() before they are used.
  20. +
  21. All strings should be translatable - create new texts in + the "lang/en" files and call them using get_string() or print_string().
  22. +
  23. All help files should be translatable - create new texts + in the "en/help" directory and call them using helpbutton().
  24. +
+

 

+

Coding Style

+

I know it can be a little annoying to change your style + if you're used to something else, but balance that annoyance against the annoyance + of all the people trying later on to make sense of Moodle code with mixed styles. + There are obviously many good points for and against any style that people use, + but the current style just is, so please stick to it.

+
    +
  1. Indenting should be consistently 4 spaces. + Don't use tabs AT ALL.
  2. +
  3. Variable names should always be easy-to-read, + meaningful lowercase English words. If you really need more than one word + then run them together, but keep them short as possible. Use +plural names for arrays of objects. +

    GOOD: $quiz
    + GOOD: $errorstring
    +GOOD: $assignments (for an array of objects)
    + GOOD: $i (but only in little loops)
    +
    + BAD: $Quiz
    + BAD: $aReallyLongVariableNameWithoutAGoodReason
    + BAD: $error_string

    +
  4. +
  5. Constants should always be in upper case, + and always start with the name of the module. They should have words separated + by underscores. +

    define("FORUM_MODE_FLATOLDEST", + 1);

    +
  6. +
  7. Function names should be simple English + words, and start with the name of the module to avoid conflicts between modules. + Words should be separated by underscores. Parameters should always have sensible + defaults if possible. Note there is no space between the function name and + the following (brackets).
    +

    function forum_set_display_mode($mode=0) + {
    +     global
    $USER, + $CFG;
    +
    +     if (
    $mode) + {
    +         
    $USER->mode + = $mode;
    +     } else if (empty(
    $USER->mode)) + {
    +         
    $USER->mode + = $CFG->forum_displaymode;
    +     }
    + }

    +
  8. +
  9. Blocks must always be enclosed in curly + braces (even if there is only one line). Moodle uses this style: +

    if ($quiz->attempts) + {
    +     if (
    $numattempts > + $quiz->attempts) + {
    +         
    error($strtoomanyattempts, + "view.php?id=$cm->id");
    +     }
    + }

    +
  10. +
  11. Strings should be defined using single quotes + where possible, for increased speed.
    +

    $var = 'some text without any + variables';
    + $var = "with special characters like a new line \n";
    + $var = 'a very, very long string with a '.$single.' variable in it';
    + $var = "some $text with $many variables $within it";

    +
  12. +
  13. Comments should use two or three slashes + and line up nicely with the code. +

    function forum_get_ratings_mean($postid, + $scale, $ratings=NULL) + {
    +
    /// Return the mean rating of a post given + to the current user by others.
    + /// Scale is an array of possible ratings in the scale
    + /// Ratings is an optional simple array of actual ratings (just integers)
    +
    +     
    if (!$ratings) + {
    +         
    $ratings + = array();     // + Initialize the empty array
    +         if (
    $rates + = get_records("forum_ratings", + "post", $postid)) + {
    +             
    // + Process each rating in turn
    +             foreach + (
    $rates as $rate) + {
    + ....etc

    +
  14. +
  15. Space should be used liberally - don't be + afraid to spread things out a little to gain some clarity. Generally, there + should be one space between brackets and normal statements, but no space between + brackets and variables or functions:
    +

    foreach ($objects + as $key => + $thing) {
    +
        process($thing); +
    + }
    +
    +
    if ($x == + $y) + {
    +
        $a + = $b;
    + } else if (
    $x == + $z) {
    +
        $a + = $c;
    + } else {
    +
        $a + = $d;
    + }

    +
  16. +
+

 

+

Database structures

+
    +
  1. Every table must have an auto-incrementing id field (INT10) as primary index.
  2. +
  3. The main table containing instances of each module must have the same name as the module (eg widget) and contain the following minimum fields: +
      +
    • id - as described above
    • +
    • course - the id of the course that each instance belongs to
    • +
    • name - the full name of each instance of the module
    • +
    +
  4. +
  5. Other tables associated with a module that contain information about 'things' should be named widget_things (note the plural).
  6. +
  7. Column names should be simple and short, following the same rules as for variable names.
  8. +
  9. Where possible, columns that contain a reference to the id field of another table (eg widget) should be called widgetid. (Note that this convention is newish and not followed in some older tables)
  10. +
  11. Boolean fields should be implemented as small integer fields (eg INT4) containing 0 or 1, to allow for later expansion of values if necessary.
  12. +
  13. Most tables should have a timemodified field (INT10) which is updated with a current timestamp obtained with the PHP time() function.
  14. +
+
+

Moodle Documentation

+

Version: $Id$

+ + \ No newline at end of file diff --git a/lang/de/docs/docstyles.css b/lang/de/docs/docstyles.css new file mode 100644 index 0000000000..555c634697 --- /dev/null +++ b/lang/de/docs/docstyles.css @@ -0,0 +1,119 @@ + +body, td, th, li { + font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; +} + +th { + font-weight: bold; +} + +a:link { + text-decoration: none; + color: blue; +} + +a:visited { + text-decoration: none; + color: blue; +} + +a:hover { + text-decoration: underline; + color: red; +} + +form { + margin-bottom: 0; +} + + +li { + margin-bottom: 10px; + +} + +.question { + font-size: medium; + font-weight: bold; + font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; + border: 1px dotted; + padding: 10px; + background-color: #EEEEEE; +} + +.answer { + font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; + font-size: medium; + border: none; + padding-left: 40px; +} + +.normaltext { + font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; + font-size: medium; + border: none; + margin-left: 30px; + +} + +.answercode { + font-family: "Courier New", Courier, mono; + font-size: small; + border: none; + padding-left: 60px; +} + +.questionlink { + font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; + font-size: medium; + border: none; + padding-left: 40px; +} + +.examplecode { + font-family: "Courier New", Courier, mono; + font-size: small; + border: thin dashed #999999; + background-color: #FBFBFB; + margin: auto; + padding: 30px; + height: auto; + width: auto; +} +h1 { + font-weight: bold; + color: #000000; + background-color: #CCCCCC; + padding: 5px; + font-size: large; + border-width: 1px; + border-color: #CCCCCC; + -moz-border-radius: 10px; +} +h2 { + font-weight: bold; + color: #FFFFFF; + background-color: #666666; + padding: 5px; + font-size: medium; + border-width: 1px; + border-color: #666666; + -moz-border-radius: 10px; +} +h3 { + font-weight: normal; + color: #FFFFFF; + background-color: #666666; + padding: 5px; + font-size: medium; + -moz-border-radius: 10px; +} +.spaced { + + margin-bottom: 30px; +} + +ul { + margin-top: 10px; + +} diff --git a/lang/de/docs/installamp.html b/lang/de/docs/installamp.html new file mode 100644 index 0000000000..fcb1c878db --- /dev/null +++ b/lang/de/docs/installamp.html @@ -0,0 +1,112 @@ + + Moodle Dokumentation: Apache, MySQL und PHP installieren + + + + + +

Installation von Apache, MySQL und PHP

+
+

Moodle
+ Moodle ist in einer Scriptsprache namens PHP geschrieben, und speichert die meisten Daten in einer Datenbank. Die favorisierte Datenbank ist MySQL. Bevor Moodle installiert werden kann ist es erforderlich eine PHP-Installation eingerichtet zu haben und eine Datenbank auf einem WebServer einzurichten. Diese Softwarepakete zu installieren kann agnz schön knifflig sein, diese Seite erklärt mit einfachen Worten wie dies auf verschiedenen Plattformen möglich ist:

+ + +

Hosting Service

+
+

Leider gibt es große Unterschiede zwiscehn den verschiedenen Webhostinganbietern. Einige bieten an Moodle für Sie zu installieren.

+

Die meisten bieten eine Onlineoberfläche zur Verwaltung der Seite, zum Einrichten von Datenbanken und zur Aktivierung von Cron-Jobs an. Einige bieten einen terminal access via ssh an. Dann können Sie die command shell nutzen.

+

Arbeiten Sie die Installationsanweisung + Stück für Stück durch. Fragen Sie Ihren Provider wenn Probleme auftauchen. +

+

 

+
+

Mac OS X

+
+

Der einfachste Weg ist die Nutzung des Apache Servers, der auch Apple unterstützt. Und ergänzen Sie PHP und MySQL aus Marc Liyanage's Paket. Beide unten aufgeführten Seiten verfügen über eine gute Anleitung, die wir hier nicht wiederholen:

+
+

PHP: Download: http://www.entropy.ch/software/macosx/php/

+

MySQL: Download: http://www.entropy.ch/software/macosx/mysql/

+
+

Wenn diese installiert sind, sollte die Standard- Installationsanleitung ausreichen.

+

Eine ausführliche Anleitung finden Sie hier: http://moodle.org/wiki/index.php/InstallingMoodle

+

 

+
+

Redhat Linux

+
+

Installieren Sie alle verfügbaren RPM packages für Apache, PHP und MySQL. + Ein Paket, das immer wieder vergessen wird ist das php-mysql Paket. Es wird für die Kommunikation von PHP mit MySQL benötigt.

+

Danach sollte die Standard-Installationsanleitung + weiterhelfen.

+

Eine ausführlichere Anleitung hier:: http://moodle.org/wiki/index.php/InstallingMoodle

+
+

 

+

Windows

+
+

Der einfachste Weg erfolgt über das EasyPHP-Paket. Das Paket bündelt alle erforderlichen Softwareprogramme in einer Windowsanwendung. Hier nun die Schritte von Anfang an:

+
    +
  1. Zunächst, wenn Sie bereits früher MySQL installiert haben, deinstallieren Sie alles. Lösceh sie alle MySQL-Dateien und auch die Dateien c:\my.cnf und c:\windows\my.ini. Führe Sie eine Dateisuche nach den Dateien: my.cnf + oder my.ini durch und löschen Sie sie vollständig.
  2. +
  3. Wenn Sie früher bereits PHP installiert haben, löschen Sie auf die gleiche Art alle Dateien mit dem Namen php4ts.dll + aus dem Windows Verzeichnis, sowie alle Dateien mit dem Namen php.ini.
  4. +
  5. Downloaden sie EasyPHP hier: http://www.easyphp.org/telechargements/dn.php?F=easyphp1-7 + (approx 10 Mb)
  6. +
  7. Führen Sie die Datei easyphp1-7_setup.exe aus. Der Installationsprozess wird auf französisch ausgeführt. Er verläuft jedoch auf die gleiche Art und Weise wie bei anderen Windowsprogrammen auch. Akzeptieren Sie alle Hinweise und führen Sie eine vollständige Installation durch. Anmerkung: + "Suivant" bedeutet 'Weiter' und "Oui" bedeutet 'Ja'.
  8. +
  9. Am Ende der Installation lassen Sie die Auswahl der Checkbox auf "Lancer + EasyPHP" (Start EasyPHP) stehen und klicken Sie auf den 'Terminer" Button. Sie werden nun zu einer Informationsseite egführt, die Sie ignorieren können.
  10. +
  11. Gratulation, wenn alles geklappt hat! Apache, PHP und MySQL sind komplett installiert und laufen. Sie sollten in der Toolbar ein schwarzes E vorfinden. Klicken Sie mit der rechten Maustaste darauf und Sie erhalten ein Kontrollmenu über die laufenden Programme.
  12. +
  13. Einige Einträge werden auf französisch sein. Den englischen Sprachfile finden Sie unter: http://www.easyphp.org/telechargements/dn.php?F=indexUS_1.7. Diese können über die vorhandenen Dateien kopiert werden.
  14. +
  15. Als nächstes müssen Sie eine Datenbank für Moodle einrichten. + Rechts-klick am schwäzen E in der Toolbar und Administration auswählen, dann auch DB Management klicken (neben PHPMyAdmin).
  16. +
  17. Wenn Sie nach einem username gefragt werden, geben Sie "root" mit einem leeren Passwort ein. Sie sollten nun die Oberfläche von phpMyAdmin sehen, wo sie neue Datenbanken und Nutzer einrichten können.
  18. +
  19. Erstellen Sie eine neue Datenbank durch Eingabe von "moodle" im Feld und bestätigen unter im "Create" Button. Das war einfach!
  20. +
  21. Sie könne zugleich neue Anwender mit Zugriff auf diese Datenbank einrichten, wenn Sie wollen. Dies ist etwas aufwendiger wenn Sie es zum ersten Mal machen. Benutzen Sie daher zunächst den vorhandenen Anwender "root" ohne Passwort in Ihrer Konfiguration für Moodle ud nehmen sie später Änderungen vor. .
  22. +
  23. Sie haben nun alles für die Installation von Moodle vorbereitet. Downloaden Sie sich nun die aktuellste Version von Moodle von http://moodle.org/download, + und unzippen Sie das Archiv.
  24. +
  25. Kopieren Sie Ihre Moodle-Dateien nach C:\Program Files\EasyPHP\www. Sie können entweder das gesamte Moodle-Verzeichnis (z.B. C:\Program Files\EasyPHP\www\moodle) + oder den Inhalt des moodle Verzeichnisses kopieren. Wenn Sie die zweite Option wählen, erreichen Sie den Zugnag zu Ihrem Moodle mit der Eingabe von http://localhost/ an Stelle von http://localhost/moodle/.
  26. +
  27. Erstellen Sie einen leeren Ordner an anderer Stelle für die Ablage von hochgeladenen Dateien in Moodle, z.B. : C:\moodledata
  28. +
  29. Gehen Sie in Ihen Moodle-Ordner und erstellen Sie eine Kopie der Datei config-dist.php mit dem Namen config.php
  30. +
  31. Bearbeiten Sie config.php mit einem Texteditor (z.B. mit Notepad oder einem HTML Editor).
  32. +
  33. Geben Sie folgenden Datenbankinformationen ein:
    + $CFG->dbtype = 'mysql';
    + $CFG->dbhost = 'localhost';
    + $CFG->dbname = 'moodle';
    + $CFG->dbuser = 'root';
    + $CFG->dbpass = '';
    + $CFG->dbpersist = true;
    + $CFG->prefix = 'mdl_';
  34. +
  35. Und fügen Sie die Pfade ein:
    + $CFG->wwwroot = 'http://localhost/moodle'; // Use an external address + if you know it.
    + $CFG->dirroot = 'C:\Program Files\EasyPHP\www\moodle';
    + $CFG->dataroot = 'C:\moodledata';
  36. +
  37. Speichern Sie die config.php - alle anderen Einstellungen können Sie ignorieren.
  38. +
  39. Sie sind nun fast fertig. Die weiteren Schritte des Setup nehmen Sie mit Ihrem Browser vor. Rufen Sie http://localhost/moodle/admin/ + mit Ihem Browser auf, um das Setup abzuschließen.
  40. +
  41. Um zip-files mit Moodle zu verwenden (z.B. nutzen die Backups zip-Dateien) sollten Sie "zlib" enablen. Sie können dies in Ihrem EasyPHP + Verzeichnis (C:\Program Files\EasyPHP) durch das Ausführen des Programms phpini.exe. Markieren Sie die Checkbox neben "zlib.dll". + Schließen Sie das Fenster, gehen Sie zum schwarzen E in Ihrer Toolbar und öffnen Sie mit der rechten Maustaste das Menu, wählen Sie "Restart" in diesm Menu aus..
  42. +
  43. Zum Schluß können Sie noch Cron-Jobs einrichten. Beachten Sie auch die Installationsanleitung + guide für weitere Details.
  44. +
+

Wenn Sie EasyPHP nicht benutzen können oder wollen, habe ich hier einige Hinweise für Sie:

+
    +
  • Prüfen Sie, ob das GD Modul enabled ist, damit Moodle, Bilder verarbeiten kann. Sie können die Datei php.ini bearbeiten und den Kommentar (;) von dieser Zeile entfernen: 'extension=php_gd2.dll'. +
  • +
  • Prüfen sie, ob das Zlib Module enabled ist, damit Sie ZIP-Files erstellen u d entpacken können in Moodle.
  • +
  • Stellen Sie sicher, dass sessions auf der Einstellung 'turned on'. Bearbeiten Sie dazu die Datei edit php.ini und legen sie das Verzeichnis für session.save_path fest. Ändern Sie dazu das als Standard eingestellte Verzeichnis "/tmp" auf folgende Einstellung wie z.B. "c:/temp".
  • +
+

 

+
+
+

Moodle Dokumentation

+

Version: $Id$

+ + + \ No newline at end of file -- 2.39.5