summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKate Arzamastseva <pshns@ukr.net>2011-09-05 16:37:05 +0300
committerKate Arzamastseva <pshns@ukr.net>2011-09-05 16:37:05 +0300
commit9ea9cc5260965262406f3eff600201f995049e1c (patch)
tree3f703a0873e42b0b3efb9e7fe2ece701b1badabe
parent69b29ddf0b274b494a4ded27e96cf57c8370876b (diff)
parentaea34b5fe445064477d8ad0c98926db33a0d0851 (diff)
downloadrpg-9ea9cc5260965262406f3eff600201f995049e1c.tar.gz
rpg-9ea9cc5260965262406f3eff600201f995049e1c.tar.bz2
Merge branch 'master' of git://github.com/splitbrain/dokuwiki into media-revisions
-rw-r--r--_test/cases/inc/search/data/ns1/ns3/page3.txt0
-rw-r--r--_test/cases/inc/search/data/ns1/page1.txt0
-rw-r--r--_test/cases/inc/search/data/ns1/page2.txt0
-rw-r--r--_test/cases/inc/search/data/ns2/nopage.ext0
-rw-r--r--_test/cases/inc/search/data/ns2/page1.txt0
-rw-r--r--_test/cases/inc/search/search.test.php102
-rw-r--r--inc/lang/es/lang.php3
-rw-r--r--inc/lang/pl/lang.php6
-rw-r--r--inc/search.php49
-rw-r--r--lib/plugins/acl/lang/es/lang.php1
-rw-r--r--lib/plugins/acl/lang/pl/lang.php1
-rw-r--r--lib/plugins/config/lang/es/lang.php2
-rw-r--r--lib/plugins/config/lang/pl/lang.php1
-rw-r--r--lib/plugins/plugin/lang/es/lang.php1
-rw-r--r--lib/plugins/plugin/lang/pl/lang.php1
-rw-r--r--lib/plugins/popularity/lang/es/lang.php1
-rw-r--r--lib/plugins/popularity/lang/pl/lang.php6
-rw-r--r--lib/plugins/popularity/lang/pl/submitted.txt3
-rw-r--r--lib/plugins/revert/lang/es/lang.php1
-rw-r--r--lib/plugins/revert/lang/pl/lang.php1
-rw-r--r--lib/plugins/usermanager/lang/es/lang.php1
-rw-r--r--lib/plugins/usermanager/lang/pl/lang.php1
22 files changed, 143 insertions, 38 deletions
diff --git a/_test/cases/inc/search/data/ns1/ns3/page3.txt b/_test/cases/inc/search/data/ns1/ns3/page3.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/_test/cases/inc/search/data/ns1/ns3/page3.txt
diff --git a/_test/cases/inc/search/data/ns1/page1.txt b/_test/cases/inc/search/data/ns1/page1.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/_test/cases/inc/search/data/ns1/page1.txt
diff --git a/_test/cases/inc/search/data/ns1/page2.txt b/_test/cases/inc/search/data/ns1/page2.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/_test/cases/inc/search/data/ns1/page2.txt
diff --git a/_test/cases/inc/search/data/ns2/nopage.ext b/_test/cases/inc/search/data/ns2/nopage.ext
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/_test/cases/inc/search/data/ns2/nopage.ext
diff --git a/_test/cases/inc/search/data/ns2/page1.txt b/_test/cases/inc/search/data/ns2/page1.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/_test/cases/inc/search/data/ns2/page1.txt
diff --git a/_test/cases/inc/search/search.test.php b/_test/cases/inc/search/search.test.php
new file mode 100644
index 000000000..a6f15e9b6
--- /dev/null
+++ b/_test/cases/inc/search/search.test.php
@@ -0,0 +1,102 @@
+<?php
+require_once DOKU_INC.'inc/search.php';
+
+class search_test extends UnitTestCase {
+ function strip_index_data($entry) {
+ $n_entry = array();
+ foreach(array('id', 'type', 'level', 'open') as $k) {
+ $n_entry[$k] = $entry[$k];
+ }
+ return $n_entry;
+ }
+
+ function test_search_index(){
+ $data = array();
+ search($data, dirname(__FILE__) . '/data', 'search_index',
+ array('ns' => 'ns2'));
+ $this->assertEqual(array_map(array($this, 'strip_index_data'), $data),
+ array(
+ array(
+ 'id' => 'ns1',
+ 'type' => 'd',
+ 'level' => 1,
+ 'open' => false
+ ), array(
+ 'id' => 'ns2',
+ 'type' => 'd',
+ 'level' => 1,
+ 'open' => true
+ ), array(
+ 'id' => 'ns2:page1',
+ 'type' => 'f',
+ 'level' => 2,
+ 'open' => true,
+ ), ));
+ $data = array();
+ search($data, dirname(__FILE__) . '/data', 'search_index',
+ array('ns' => 'ns1/ns3'));
+ $this->assertEqual(array_map(array($this, 'strip_index_data'), $data),
+ array(
+ array(
+ 'id' => 'ns1',
+ 'type' => 'd',
+ 'level' => 1,
+ 'open' => true,
+ ),
+ array(
+ 'id' => 'ns1:ns3',
+ 'type' => 'd',
+ 'level' => 2,
+ 'open' => true,
+ ),
+ array(
+ 'id' => 'ns1:ns3:page3',
+ 'type' => 'f',
+ 'level' => 3,
+ 'open' => true,
+ ),
+ array(
+ 'id' => 'ns1:page1',
+ 'type' => 'f',
+ 'level' => 2,
+ 'open' => true,
+ ),
+ array(
+ 'id' => 'ns1:page2',
+ 'type' => 'f',
+ 'level' => 2,
+ 'open' => true,
+ ),
+ array(
+ 'id' => 'ns2',
+ 'type' => 'd',
+ 'level' => 1,
+ 'open' => false,
+ ), ));
+ $data = array();
+ search($data, dirname(__FILE__) . '/data', 'search_index',
+ array('ns' => 'ns1/ns3', 'nofiles' => true));
+ $this->assertEqual(array_map(array($this, 'strip_index_data'), $data),
+ array(
+ array(
+ 'id' => 'ns1',
+ 'type' => 'd',
+ 'level' => 1,
+ 'open' => true,
+ ),
+ array(
+ 'id' => 'ns1:ns3',
+ 'type' => 'd',
+ 'level' => 2,
+ 'open' => true,
+ ),
+ array(
+ 'id' => 'ns2',
+ 'type' => 'd',
+ 'level' => 1,
+ 'open' => false,
+ ), ));
+
+ }
+}
+//Setup VIM: ex: et ts=4 :
diff --git a/inc/lang/es/lang.php b/inc/lang/es/lang.php
index 5dc6834e6..4c83f5d96 100644
--- a/inc/lang/es/lang.php
+++ b/inc/lang/es/lang.php
@@ -24,6 +24,7 @@
* @author Victor Castelan <victorcastelan@gmail.com>
* @author Mauro Javier Giamberardino <mgiamberardino@gmail.com>
* @author emezeta <emezeta@infoprimo.com>
+ * @author Oscar Ciudad <oscar@jacho.net>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -109,7 +110,7 @@ $lang['txt_filename'] = 'Subir como (opcional)';
$lang['txt_overwrt'] = 'Sobreescribir archivo existente';
$lang['lockedby'] = 'Actualmente bloqueado por';
$lang['lockexpire'] = 'El bloqueo expira en';
-$lang['js']['willexpire'] = 'Tu bloqueo para editar esta página expira en un minuto.\nPara evitar conflictos usa el botón previsualizar para reiniciar el contador de tiempo.';
+$lang['willexpire'] = 'Tu bloqueo para editar esta página expira en un minuto.\nPara evitar conflictos usa el botón previsualizar para reiniciar el contador de tiempo.';
$lang['js']['notsavedyet'] = 'Los cambios que no se han guardado se perderán.
¿Realmente quieres continuar?';
$lang['js']['searchmedia'] = 'Buscar archivos';
diff --git a/inc/lang/pl/lang.php b/inc/lang/pl/lang.php
index 32e5bf80c..f9bf57852 100644
--- a/inc/lang/pl/lang.php
+++ b/inc/lang/pl/lang.php
@@ -11,6 +11,7 @@
* @author Leszek Stachowski <shazarre@gmail.com>
* @author maros <dobrimaros@yahoo.pl>
* @author Grzegorz Widła <dzesdzes@gmail.com>
+ * @author Łukasz Chmaj <teachmeter@gmail.com>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -96,7 +97,7 @@ $lang['txt_filename'] = 'Nazwa pliku (opcjonalnie)';
$lang['txt_overwrt'] = 'Nadpisać istniejący plik?';
$lang['lockedby'] = 'Aktualnie zablokowane przez';
$lang['lockexpire'] = 'Blokada wygasa';
-$lang['js']['willexpire'] = 'Za minutę Twoja blokada tej strony wygaśnie.\nW celu uniknięcia konfliktów wyświetl podgląd aby odnowić blokadę.';
+$lang['willexpire'] = 'Za minutę Twoja blokada tej strony wygaśnie.\nW celu uniknięcia konfliktów wyświetl podgląd aby odnowić blokadę.';
$lang['js']['notsavedyet'] = 'Nie zapisane zmiany zostaną utracone.
Czy na pewno kontynuować?';
$lang['js']['searchmedia'] = 'Szukaj plików';
@@ -163,6 +164,9 @@ $lang['yours'] = 'Twoja wersja';
$lang['diff'] = 'Pokaż różnice między wersjami';
$lang['diff2'] = 'Pokaż różnice między zaznaczonymi wersjami';
$lang['difflink'] = 'Odnośnik do tego porównania';
+$lang['diff_type'] = 'Zobacz różnice:';
+$lang['diff_inline'] = 'W linii';
+$lang['diff_side'] = 'Jeden obok drugiego';
$lang['line'] = 'Linia';
$lang['breadcrumb'] = 'Ślad';
$lang['youarehere'] = 'Jesteś tutaj';
diff --git a/inc/search.php b/inc/search.php
index a6089c479..a26ae4808 100644
--- a/inc/search.php
+++ b/inc/search.php
@@ -84,8 +84,8 @@ function search_callback($func,&$data,$base,$file,$type,$lvl,$opts){
* return values for files are ignored
*
* All functions should check the ACL for document READ rights
- * namespaces (directories) are NOT checked as this would break
- * the recursion (You can have an nonreadable dir over a readable
+ * namespaces (directories) are NOT checked (when sneaky_index is 0) as this
+ * would break the recursion (You can have an nonreadable dir over a readable
* one deeper nested) also make sure to check the file type (for example
* in case of lockfiles).
*/
@@ -107,45 +107,22 @@ function search_qsearch(&$data,$base,$file,$type,$lvl,$opts){
/**
* Build the browsable index of pages
*
- * $opts['ns'] is the current namespace
+ * $opts['ns'] is the currently viewed namespace
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function search_index(&$data,$base,$file,$type,$lvl,$opts){
global $conf;
- $return = true;
-
- $item = array();
-
- if($type == 'd' && !preg_match('#^'.$file.'(/|$)#','/'.$opts['ns'])){
- //add but don't recurse
- $return = false;
- }elseif($type == 'f' && ($opts['nofiles'] || substr($file,-4) != '.txt')){
- //don't add
- return false;
- }
-
- $id = pathID($file,($type == 'd'));
-
- if($type=='d' && $conf['sneaky_index'] && auth_quickaclcheck($id.':') < AUTH_READ){
- return false;
- }
-
- //check hidden
- if(isHiddenPage($id)){
- return false;
- }
-
- //check ACL
- if($type=='f' && auth_quickaclcheck($id) < AUTH_READ){
- return false;
- }
-
- $data[]=array( 'id' => $id,
- 'type' => $type,
- 'level' => $lvl,
- 'open' => $return );
- return $return;
+ $opts = array(
+ 'pagesonly' => true,
+ 'listdirs' => true,
+ 'listfiles' => !$opts['nofiles'],
+ 'sneakyacl' => $conf['sneaky_index'],
+ // Hacky, should rather use recmatch
+ 'depth' => preg_match('#^'.$file.'(/|$)#','/'.$opts['ns']) ? 0 : -1
+ );
+
+ return search_universal($data, $base, $file, $type, $lvl, $opts);
}
/**
diff --git a/lib/plugins/acl/lang/es/lang.php b/lib/plugins/acl/lang/es/lang.php
index 096320af9..91a4ca1a1 100644
--- a/lib/plugins/acl/lang/es/lang.php
+++ b/lib/plugins/acl/lang/es/lang.php
@@ -20,6 +20,7 @@
* @author Victor Castelan <victorcastelan@gmail.com>
* @author Mauro Javier Giamberardino <mgiamberardino@gmail.com>
* @author emezeta <emezeta@infoprimo.com>
+ * @author Oscar Ciudad <oscar@jacho.net>
*/
$lang['admin_acl'] = 'Administración de lista de control de acceso';
$lang['acl_group'] = 'Grupo';
diff --git a/lib/plugins/acl/lang/pl/lang.php b/lib/plugins/acl/lang/pl/lang.php
index c954abe2a..a72b6af11 100644
--- a/lib/plugins/acl/lang/pl/lang.php
+++ b/lib/plugins/acl/lang/pl/lang.php
@@ -11,6 +11,7 @@
* @author Leszek Stachowski <shazarre@gmail.com>
* @author maros <dobrimaros@yahoo.pl>
* @author Grzegorz Widła <dzesdzes@gmail.com>
+ * @author Łukasz Chmaj <teachmeter@gmail.com>
*/
$lang['admin_acl'] = 'Zarządzanie uprawnieniami';
$lang['acl_group'] = 'Grupa';
diff --git a/lib/plugins/config/lang/es/lang.php b/lib/plugins/config/lang/es/lang.php
index 5355d64ad..ccb963ff1 100644
--- a/lib/plugins/config/lang/es/lang.php
+++ b/lib/plugins/config/lang/es/lang.php
@@ -20,6 +20,7 @@
* @author Victor Castelan <victorcastelan@gmail.com>
* @author Mauro Javier Giamberardino <mgiamberardino@gmail.com>
* @author emezeta <emezeta@infoprimo.com>
+ * @author Oscar Ciudad <oscar@jacho.net>
*/
$lang['menu'] = 'Parámetros de configuración';
$lang['error'] = 'Los parámetros no han sido actualizados a causa de un valor inválido, por favor revise los cambios y re-envíe el formulario. <br /> Los valores incorrectos se mostrarán con un marco rojo alrededor.';
@@ -124,6 +125,7 @@ $lang['jpg_quality'] = 'Calidad de compresión de JPG (0-100)';
$lang['subscribers'] = 'Habilitar soporte para suscripción a páginas';
$lang['subscribe_time'] = 'Tiempo después que alguna lista de suscripción fue enviada (seg); Debe ser menor que el tiempo especificado en días recientes.';
$lang['compress'] = 'Compactar la salida de CSS y javascript';
+$lang['cssdatauri'] = 'Tamaño en bytes hasta el cual las imágenes referenciadas en archivos CSS deberían ir incrustadas en la hoja de estilos para reducir el número de cabeceras de petición HTTP. ¡Esta técnica no funcionará en IE < 8! De <code>400</code> a <code>600</code> bytes es un valor adecuado. Establezca <code>0</code> para deshabilitarlo.';
$lang['hidepages'] = 'Ocultar páginas con coincidencias (expresiones regulares)';
$lang['send404'] = 'Enviar "HTTP 404/Page Not Found" para páginas no existentes';
$lang['sitemap'] = 'Generar sitemap de Google (días)';
diff --git a/lib/plugins/config/lang/pl/lang.php b/lib/plugins/config/lang/pl/lang.php
index c051e9e13..6e94a2e3d 100644
--- a/lib/plugins/config/lang/pl/lang.php
+++ b/lib/plugins/config/lang/pl/lang.php
@@ -12,6 +12,7 @@
* @author Leszek Stachowski <shazarre@gmail.com>
* @author maros <dobrimaros@yahoo.pl>
* @author Grzegorz Widła <dzesdzes@gmail.com>
+ * @author Łukasz Chmaj <teachmeter@gmail.com>
*/
$lang['menu'] = 'Ustawienia';
$lang['error'] = 'Ustawienia nie zostały zapisane z powodu błędnych wartości, przejrzyj je i ponów próbę zapisu. <br/> Niepoprawne wartości są wyróżnione kolorem czerwonym.';
diff --git a/lib/plugins/plugin/lang/es/lang.php b/lib/plugins/plugin/lang/es/lang.php
index 207c48d2c..2726a5ffa 100644
--- a/lib/plugins/plugin/lang/es/lang.php
+++ b/lib/plugins/plugin/lang/es/lang.php
@@ -20,6 +20,7 @@
* @author Victor Castelan <victorcastelan@gmail.com>
* @author Mauro Javier Giamberardino <mgiamberardino@gmail.com>
* @author emezeta <emezeta@infoprimo.com>
+ * @author Oscar Ciudad <oscar@jacho.net>
*/
$lang['menu'] = 'Administración de Plugins';
$lang['download'] = 'Descargar e instalar un nuevo plugin';
diff --git a/lib/plugins/plugin/lang/pl/lang.php b/lib/plugins/plugin/lang/pl/lang.php
index d4ccc7751..f48426bf6 100644
--- a/lib/plugins/plugin/lang/pl/lang.php
+++ b/lib/plugins/plugin/lang/pl/lang.php
@@ -12,6 +12,7 @@
* @author Leszek Stachowski <shazarre@gmail.com>
* @author maros <dobrimaros@yahoo.pl>
* @author Grzegorz Widła <dzesdzes@gmail.com>
+ * @author Łukasz Chmaj <teachmeter@gmail.com>
*/
$lang['menu'] = 'Menadżer wtyczek';
$lang['download'] = 'Ściągnij i zainstaluj nową wtyczkę';
diff --git a/lib/plugins/popularity/lang/es/lang.php b/lib/plugins/popularity/lang/es/lang.php
index 5e42cd45c..d78343a36 100644
--- a/lib/plugins/popularity/lang/es/lang.php
+++ b/lib/plugins/popularity/lang/es/lang.php
@@ -17,6 +17,7 @@
* @author Mauro Javier Giamberardino <mgiamberardino@gmail.com>
* @author Oscar M. Lage <r0sk10@gmail.com>
* @author emezeta <emezeta@infoprimo.com>
+ * @author Oscar Ciudad <oscar@jacho.net>
*/
$lang['name'] = 'Retroinformación (Feedback) plugin Popularity';
$lang['submit'] = 'Enviar datos';
diff --git a/lib/plugins/popularity/lang/pl/lang.php b/lib/plugins/popularity/lang/pl/lang.php
index fbbe6dab2..d96254fd8 100644
--- a/lib/plugins/popularity/lang/pl/lang.php
+++ b/lib/plugins/popularity/lang/pl/lang.php
@@ -10,6 +10,12 @@
* @author Leszek Stachowski <shazarre@gmail.com>
* @author maros <dobrimaros@yahoo.pl>
* @author Grzegorz Widła <dzesdzes@gmail.com>
+ * @author Łukasz Chmaj <teachmeter@gmail.com>
*/
$lang['name'] = 'Informacja o popularności (ładowanie może zająć dłuższą chwilę)';
$lang['submit'] = 'Wyślij dane';
+$lang['autosubmit'] = 'Automatycznie wysyłaj dane raz na miesiąc';
+$lang['submissionFailed'] = 'Dane nie mogły być przesłane ze względu na następujące błędy:';
+$lang['submitDirectly'] = 'Możesz wysłać dane ręcznie poprzez następujący formularz:';
+$lang['autosubmitError'] = 'Ostatnie wysyłanie automatyczne nie powiodło się ze względu na następujące błędy:';
+$lang['lastSent'] = 'Dane zostały wysłane:';
diff --git a/lib/plugins/popularity/lang/pl/submitted.txt b/lib/plugins/popularity/lang/pl/submitted.txt
new file mode 100644
index 000000000..195e81388
--- /dev/null
+++ b/lib/plugins/popularity/lang/pl/submitted.txt
@@ -0,0 +1,3 @@
+====== Informacje o popularności ======
+
+Wysyłanie danych powiodło się. \ No newline at end of file
diff --git a/lib/plugins/revert/lang/es/lang.php b/lib/plugins/revert/lang/es/lang.php
index 7e357e3db..f793eb06d 100644
--- a/lib/plugins/revert/lang/es/lang.php
+++ b/lib/plugins/revert/lang/es/lang.php
@@ -18,6 +18,7 @@
* @author Victor Castelan <victorcastelan@gmail.com>
* @author Mauro Javier Giamberardino <mgiamberardino@gmail.com>
* @author emezeta <emezeta@infoprimo.com>
+ * @author Oscar Ciudad <oscar@jacho.net>
*/
$lang['menu'] = 'Restaurador';
$lang['filter'] = 'Buscar páginas con spam';
diff --git a/lib/plugins/revert/lang/pl/lang.php b/lib/plugins/revert/lang/pl/lang.php
index 8166250b4..f36dc591a 100644
--- a/lib/plugins/revert/lang/pl/lang.php
+++ b/lib/plugins/revert/lang/pl/lang.php
@@ -9,6 +9,7 @@
* @author Leszek Stachowski <shazarre@gmail.com>
* @author maros <dobrimaros@yahoo.pl>
* @author Grzegorz Widła <dzesdzes@gmail.com>
+ * @author Łukasz Chmaj <teachmeter@gmail.com>
*/
$lang['menu'] = 'Menadżer przywracania';
$lang['filter'] = 'Wyszukaj uszkodzone strony';
diff --git a/lib/plugins/usermanager/lang/es/lang.php b/lib/plugins/usermanager/lang/es/lang.php
index 1e79c6826..50138bf2b 100644
--- a/lib/plugins/usermanager/lang/es/lang.php
+++ b/lib/plugins/usermanager/lang/es/lang.php
@@ -19,6 +19,7 @@
* @author Victor Castelan <victorcastelan@gmail.com>
* @author Mauro Javier Giamberardino <mgiamberardino@gmail.com>
* @author emezeta <emezeta@infoprimo.com>
+ * @author Oscar Ciudad <oscar@jacho.net>
*/
$lang['menu'] = 'Administración de usuarios';
$lang['noauth'] = '(la autenticación de usuarios no está disponible)';
diff --git a/lib/plugins/usermanager/lang/pl/lang.php b/lib/plugins/usermanager/lang/pl/lang.php
index 0c4ecbcdf..7c79c5d1f 100644
--- a/lib/plugins/usermanager/lang/pl/lang.php
+++ b/lib/plugins/usermanager/lang/pl/lang.php
@@ -10,6 +10,7 @@
* @author Leszek Stachowski <shazarre@gmail.com>
* @author maros <dobrimaros@yahoo.pl>
* @author Grzegorz Widła <dzesdzes@gmail.com>
+ * @author Łukasz Chmaj <teachmeter@gmail.com>
*/
$lang['menu'] = 'Menadżer użytkowników';
$lang['noauth'] = '(uwierzytelnienie użytkownika niemożliwe)';