~ubuntu-branches/ubuntu/jaunty/moodle/jaunty

« back to all changes in this revision

Viewing changes to mod/wiki/ewiki/ewiki.php

  • Committer: Bazaar Package Importer
  • Author(s): Jordan Mantha, Matt Oquist
  • Date: 2009-02-25 15:16:22 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20090225151622-0ekt1liwhv2obfza
Tags: 1.9.4.dfsg-0ubuntu1
* Merge with Debian git (Closes LP: #322961, #239481, #334611):
  - use Ubuntu's smarty lib directory for linking
  - use internal yui library 
  - add update-notifier support back in

[Matt Oquist]
  * renamed prerm script
  * significantly rewrote postinst and other maintainer scripts to improve
    user experience and package maintainability
    (Closes LP: #225662, #325450, #327843, #303078, #234609)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<script language="PHP"> @define("EWIKI_VERSION", "R1.01d");
 
1
<?php
 
2
@define("EWIKI_VERSION", "R1.01d");
2
3
 
3
4
/*
4
5
 
5
6
  ErfurtWiki - an embedable, fast and user-friendly wiki engine
6
 
  ����������
 
7
  ---------
7
8
  This is Public Domain (no license, no warranty); but feel free
8
9
  to redistribute it under GPL or anything else you like.
9
10
 
10
11
  http://erfurtwiki.sourceforge.net/
11
 
  Mario Salzer <mario*erphesfurt�de> and many others(tm)
 
12
  Mario Salzer <mario*erphesfurt·de> and many others(tm)
12
13
 
13
14
 
14
15
  Use it from inside yoursite.php like that:
93
94
    else {
94
95
#### END MOODLE CHANGES
95
96
 
96
 
    define("EWIKI_CHARS_L", "a-z_��$\337-\377");
 
97
    define("EWIKI_CHARS_L", "a-z_µ¤$\337-\377");
97
98
    define("EWIKI_CHARS_U", "A-Z0-9\300-\336");
98
99
 
99
100
#### BEGIN MOODLE CHANGES   
226
227
        \w[-_.+\w]+@(\w[-_\w]+[.])+\w{2,}   ) \007x",
227
228
 
228
229
    #-- rendering ruleset
229
 
           "wm_indent" => '<div style="margin-left:15px;" class="indent">',
 
230
           "wm_indent" => '',
230
231
           "wm_table_defaults" => 'cellpadding="2" border="1" cellspacing="0"',
231
232
           "wm_whole_line" => array(),
232
233
           "htmlentities" => array(
258
259
    #<off># "###" => array("<big><b>", "</b></big>"),
259
260
        "**" => array("<b>", "</b>"),
260
261
        "##" => array("<big>", "</big>"),
261
 
        "��" => array("<small>", "</small>"),
 
262
        "µµ" => array("<small>", "</small>"),
262
263
           ),
263
264
           "wm_start_end" => array(
264
265
           ),
352
353
    ));
353
354
        #
354
355
        $ewiki_t["es"] = @array_merge(@$ewiki_t["es"], array(
355
 
           "EDITTHISPAGE" => "EditarEstaP�gina",
 
356
           "EDITTHISPAGE" => "EditarEstaPágina",
356
357
           "BACKLINKS" => "EnlacesInversos",
357
 
           "PAGESLINKINGTO" => "P�ginas enlazando \$title",
358
 
           "PAGEHISTORY" => "InfoP�gina",
359
 
           "INFOABOUTPAGE" => "Informaci�n sobre la p�gina",
360
 
           "LIKEPAGES" => "P�ginas como esta",
361
 
           "NEWESTPAGES" => "P�ginas m�s nuevas",
362
 
           "LASTCHANGED" => "�ltima modificaci�n %d/%m/%Y a las %H:%M",
363
 
           "DOESNOTEXIST" => "Esta p�gina a�n no existe, por favor eliga EditarEstaP�gina si desea crearla.",
364
 
           "DISABLEDPAGE" => "Esta p�gina no est� disponible en este momento.",
365
 
           "ERRVERSIONSAVE" => "Disculpe, mientras editaba esta p�gina algui�n m�s
366
 
        salv� una versi�n modificada. Por favor regrese a
 
358
           "PAGESLINKINGTO" => "Páginas enlazando \$title",
 
359
           "PAGEHISTORY" => "InfoPágina",
 
360
           "INFOABOUTPAGE" => "Información sobre la página",
 
361
           "LIKEPAGES" => "Páginas como esta",
 
362
           "NEWESTPAGES" => "Páginas más nuevas",
 
363
           "LASTCHANGED" => "última modificación %d/%m/%Y a las %H:%M",
 
364
           "DOESNOTEXIST" => "Esta página aún no existe, por favor eliga EditarEstaPágina si desea crearla.",
 
365
           "DISABLEDPAGE" => "Esta página no está disponible en este momento.",
 
366
           "ERRVERSIONSAVE" => "Disculpe, mientras editaba esta página alguién más
 
367
        salvó una versión modificada. Por favor regrese a
367
368
        a la pantalla anterior y copie sus cambios a su computador
368
 
        para insertalos nuevamente despu�s de que cargue
369
 
        la pantalla de edici�n.",
370
 
           "ERRORSAVING" => "Ocurri� un error mientras se salvavan sus cambios. Por favor intente de nuevo.",
371
 
           "THANKSFORCONTRIBUTION" => "Gracias por su contribuci�n!",
372
 
           "CANNOTCHANGEPAGE" => "Esta p�gina no puede ser modificada.",
373
 
           "OLDVERCOMEBACK" => "Hacer que esta versi�n antigua regrese a remplazar la actual",
 
369
        para insertalos nuevamente después de que cargue
 
370
        la pantalla de edición.",
 
371
           "ERRORSAVING" => "Ocurrió un error mientras se salvavan sus cambios. Por favor intente de nuevo.",
 
372
           "THANKSFORCONTRIBUTION" => "Gracias por su contribución!",
 
373
           "CANNOTCHANGEPAGE" => "Esta página no puede ser modificada.",
 
374
           "OLDVERCOMEBACK" => "Hacer que esta versión antigua regrese a remplazar la actual",
374
375
           "PREVIEW" => "Previsualizar",
375
376
           "SAVE" => "Salvar",
376
 
           "CANCEL_EDIT" => "CancelarEdici�n",
377
 
           "UPLOAD_PICTURE_BUTTON" => "subir gr�fica &gt;&gt;&gt;",
 
377
           "CANCEL_EDIT" => "CancelarEdición",
 
378
           "UPLOAD_PICTURE_BUTTON" => "subir gráfica &gt;&gt;&gt;",
378
379
           "EDIT_FORM_1" => "<a href=\"".EWIKI_SCRIPT."BuenEstilo\">BuenEstilo</a> es
379
380
        escribir lo que viene a su mente. No se preocupe mucho
380
 
        por la apariencia. Tambi�n puede agregar <a href=\"".EWIKI_SCRIPT."ReglasDeMarcadoWiki\">ReglasDeMarcadoWiki</a>
381
 
        m�s adelante si piensa que es necesario.<br />",
 
381
        por la apariencia. También puede agregar <a href=\"".EWIKI_SCRIPT."ReglasDeMarcadoWiki\">ReglasDeMarcadoWiki</a>
 
382
        más adelante si piensa que es necesario.<br />",
382
383
           "EDIT_FORM_2" => "<br />Por favor no escriba cosas, que puedan
383
384
        enfadar a otras personas. Y por favor tenga en mente que
384
 
        usted no es del todo an�nimo en Internet 
385
 
        (encuentre m�s sobre 
 
385
        usted no es del todo anónimo en Internet 
 
386
        (encuentre más sobre 
386
387
        '<a href=\"http://google.com/search?q=my+computers+IP+address\">IP address</a>' de su computador con Google).",
387
 
           "BIN_IMGTOOLARGE" => "�La gr�fica es demasiado grande!",
388
 
           "BIN_NOIMG" => "�No es un archivo con una gr�fica (formato de archivo inaceptable)!",
389
 
           "FORBIDDEN" => "No est� autorizado para acceder a esta p�gina.",
 
388
           "BIN_IMGTOOLARGE" => "¡La gráfica es demasiado grande!",
 
389
           "BIN_NOIMG" => "¡No es un archivo con una gráfica (formato de archivo inaceptable)!",
 
390
           "FORBIDDEN" => "No está autorizado para acceder a esta página.",
390
391
        ));
391
392
        #
392
393
    $ewiki_t["de"] = @array_merge(@$ewiki_t["de"], array(
393
 
       "EDITTHISPAGE" => "DieseSeite�ndern",
394
 
           "APPENDTOPAGE" => "Erg�nze",
395
 
       "BACKLINKS" => "Zur�ckLinks",
 
394
       "EDITTHISPAGE" => "DieseSeiteÄndern",
 
395
           "APPENDTOPAGE" => "Ergänze",
 
396
       "BACKLINKS" => "ZurückLinks",
396
397
       "PAGESLINKINGTO" => "Verweise zur Seite \$title",
397
398
       "PAGEHISTORY" => "SeitenInfo",
398
 
       "INFOABOUTPAGE" => "Informationen �ber Seite",
399
 
       "LIKEPAGES" => "�hnliche Seiten",
 
399
       "INFOABOUTPAGE" => "Informationen über Seite",
 
400
       "LIKEPAGES" => "Ähnliche Seiten",
400
401
       "NEWESTPAGES" => "Neueste Seiten",
401
 
       "LASTCHANGED" => "zuletzt ge�ndert am %d.%m.%Y um %H:%M",
 
402
       "LASTCHANGED" => "zuletzt geändert am %d.%m.%Y um %H:%M",
402
403
       "DISABLEDPAGE" => "Diese Seite kann momentan nicht angezeigt werden.",
403
 
       "ERRVERSIONSAVE" => "Entschuldige, aber w�hrend Du an der Seite
404
 
        gearbeitet hast, hat bereits jemand anders eine ge�nderte
 
404
       "ERRVERSIONSAVE" => "Entschuldige, aber während Du an der Seite
 
405
        gearbeitet hast, hat bereits jemand anders eine geänderte
405
406
        Fassung gespeichert. Damit nichts verloren geht, browse bitte
406
 
        zur�ck und speichere Deine �nderungen in der Zwischenablage
 
407
        zurück und speichere Deine Änderungen in der Zwischenablage
407
408
        (Bearbeiten->Kopieren) um sie dann wieder an der richtigen
408
 
        Stelle einzuf�gen, nachdem du die EditBoxSeite nocheinmal
 
409
        Stelle einzufügen, nachdem du die EditBoxSeite nocheinmal
409
410
        geladen hast.<br />
410
 
        Vielen Dank f�r Deine M�he.",
 
411
        Vielen Dank für Deine Mühe.",
411
412
       "ERRORSAVING" => "Beim Abspeichern ist ein Fehler aufgetreten. Bitte versuche es erneut.",
412
 
       "THANKSFORCONTRIBUTION" => "Vielen Dank f�r Deinen Beitrag!",
413
 
       "CANNOTCHANGEPAGE" => "Diese Seite kann nicht ge�ndert werden.",
 
413
       "THANKSFORCONTRIBUTION" => "Vielen Dank für Deinen Beitrag!",
 
414
       "CANNOTCHANGEPAGE" => "Diese Seite kann nicht geändert werden.",
414
415
       "OLDVERCOMEBACK" => "Diese alte Version der Seite wieder zur Aktuellen machen",
415
416
       "PREVIEW" => "Vorschau",
416
417
       "SAVE" => "Speichern",
417
 
       "CANCEL_EDIT" => "�nderungenVerwerfen",
 
418
       "CANCEL_EDIT" => "ÄnderungenVerwerfen",
418
419
       "UPLOAD_PICTURE_BUTTON" => "Bild hochladen &gt;&gt;&gt;",
419
420
       "EDIT_FORM_1" => "<a href=\"".EWIKI_SCRIPT."GuterStil\">GuterStil</a> ist es,
420
421
        ganz einfach das zu schreiben, was einem gerade in den
421
422
        Sinn kommt. Du solltest dich jetzt noch nicht so sehr
422
 
        darum k�mmern, wie die Seite aussieht. Du kannst sp�ter
423
 
        immernoch zur�ckkommen und den Text mit <a href=\"".EWIKI_SCRIPT."FormatierungsRegeln\">WikiTextFormatierungsRegeln</a>
 
423
        darum kümmern, wie die Seite aussieht. Du kannst später
 
424
        immernoch zurückkommen und den Text mit <a href=\"".EWIKI_SCRIPT."FormatierungsRegeln\">WikiTextFormatierungsRegeln</a>
424
425
        aufputschen.<br />",
425
426
       "EDIT_FORM_2" => "<br />Bitte schreib keine Dinge, die andere Leute
426
 
        ver�rgern k�nnten. Und bedenke auch, da� es schnell auf
427
 
        dich zur�ckfallen kann wenn du verschiedene andere Dinge sagst (mehr Informationen zur
 
427
        verärgern könnten. Und bedenke auch, daß es schnell auf
 
428
        dich zurückfallen kann wenn du verschiedene andere Dinge sagst (mehr Informationen zur
428
429
        '<a href=\"http://google.de/search?q=computer+IP+adresse\">IP Adresse</a>'
429
430
        deines Computers findest du bei Google).",
430
431
    ));
591
592
   if ($pf_a = $ewiki_plugins["page_final"]) {
592
593
      ksort($pf_a);
593
594
      foreach ($pf_a as $pf) {
 
595
         if ($action == 'edit' and $pf == 'ewiki_html_tag_balancer') {
 
596
            continue; // balancer breaks htmlarea buttons
 
597
         }
594
598
         $pf($o, $id, $data, $action);
595
599
      }
596
600
   }
635
639
#-- encloses whole page output with a descriptive <div>
636
640
function ewiki_page_css_container(&$o, &$id, &$data, &$action) {
637
641
   $o = "<div class=\"wiki $action "
638
 
      . strtr($id, ' ./ --_!"�$%&()=?��{[]}`+#*;:,<>| @�������ߤ^���\'\\',
 
642
      . strtr($id, ' ./ --_!"§$%&()=?²³{[]}`+#*;:,<>| @µöäüÖÄÜߤ^°«»\'\\',
639
643
                   '-  -----------------------------------------------')
640
644
      . "\">\n"
641
645
      . $o . "\n</div>\n";
858
862
   if (strlen($params)) {
859
863
      $url .= (strpos($url,"?")!==false ? "&":"?") . $params;
860
864
   }
861
 
 
862
 
   #-- fin
 
865
 
863
866
  #-- fin
864
867
   if ($html) {
865
868
      //Don't replace & if it's part of encoded character (bug 2209)
866
869
      $url = preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/","&amp;", $url);
1636
1639
   $preview_text=$GLOBALS["ewiki_plugins"]["render"][0]($_REQUEST["content"], 1, EWIKI_ALLOW_HTML || (@$data["flags"]&EWIKI_DB_F_HTML));
1637
1640
   return( '<div class="preview">'
1638
1641
           . "<hr noshade>"
1639
 
           . "<div align=\"right\">" . ewiki_t("PREVIEW") . "</div><hr noshade><br />\n"
 
1642
           . "<div class='mdl-right'>" . ewiki_t("PREVIEW") . "</div><hr noshade><br />\n"
1640
1643
           . format_text($preview_text, $moodle_format)
1641
1644
           . "<br /><br /><hr noshade><br />"
1642
1645
           . "</div>"
1656
1659
   }
1657
1660
 
1658
1661
   $o = "\n"
1659
 
      . '<div align="right" class="action-links control-links">'
 
1662
      . '<div class="mdl-right action-links control-links">'
1660
1663
      . "\n<br />\n"
1661
1664
      . "<hr noshade>" . "\n";
1662
1665
 
1779
1782
 
1780
1783
   #-- pre-processing plugins (working on wiki source)
1781
1784
   if ($pf_source = $ewiki_plugins["format_source"]) {
1782
 
      foreach ($pf_source as $pf) $pf(&$iii[0][0]);
 
1785
      foreach ($pf_source as $pf) $pf($iii[0][0]);
1783
1786
   }
1784
1787
 
1785
1788
   #-- simple markup
1938
1941
               }
1939
1942
            }
1940
1943
            while ($n_indent < $s["indent"]) { 
1941
 
               $out .= "</div>\n";
 
1944
               $out .= "";
1942
1945
               $s["indent"]--;
1943
1946
            }
1944
1947
 
2149
2152
   }
2150
2153
   #-- indentation
2151
2154
   while ($s["indent"]) {
2152
 
      $out .= "</div>";
 
2155
      $out .= "";
2153
2156
      $s["indent"]--;
2154
2157
   }
2155
2158
}
2179
2182
 
2180
2183
 
2181
2184
function ewiki_format_comment(&$str, &$in, &$iii, &$s, $btype) {
2182
 
   $str = "<!-- "  . str_replace("--", "��", $str) . " -->";
 
2185
   $str = "<!-- "  . str_replace("--", "¯¯", $str) . " -->";
2183
2186
}
2184
2187
 
2185
2188
 
2564
2567
         $do = "nop";
2565
2568
      }
2566
2569
   }
2567
 
 
2568
2570
   
2569
2571
   #-- auth only happens when enforced with _PROTECTED_MODE_XXL setting
2570
2572
   #   (authentication for inline images in violation of the WWW spirit)
2574
2576
 
2575
2577
   #-- upload an image
2576
2578
   if ($do == "upload"){
2577
 
 
2578
2579
      $id = ewiki_binary_save_image($upload_file["tmp_name"], "", $return=0, $add_meta);
2579
2580
      @unlink($upload_file["tmp_name"]);
2580
2581
      ($title = trim($orig_name, "/")) && ($title = preg_replace("/[^-._\w\d]+/", "_", substr(substr($orig_name, strrpos($title, "/")), 0, 20)))
3189
3190
      $path=EWIKI_INIT_PAGES;
3190
3191
      if (!empty($path)) {
3191
3192
        if ($dh = @opendir($path=EWIKI_INIT_PAGES)) {
3192
 
         while ($filename = readdir($dh)) {
 
3193
         while (false !== ($filename = readdir($dh))) {
3193
3194
#### MOODLE CHANGE TO SOLVE BUG #3830. Original doesn't support dots in names.
3194
3195
    //Orig->if (preg_match('/^(['.EWIKI_CHARS_U.']+['.EWIKI_CHARS_L.']+\w*)+/', $filename)) {
3195
3196
            if ($filename == clean_filename($filename) && !is_dir($path.'/'.$filename)) {
3586
3587
   return($r);
3587
3588
}
3588
3589
 
3589
 
 
3590
 
 
3591
 
</script>
 
3590
?>