summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc')
-rw-r--r--inc/Form/ButtonElement.php34
-rw-r--r--inc/Form/Form.php63
-rw-r--r--inc/Form/InputElement.php9
-rw-r--r--inc/Form/LabelElement.php (renamed from inc/Form/Label.php)6
-rw-r--r--inc/html.php3
-rw-r--r--inc/lang/cs/lang.php4
-rw-r--r--inc/lang/hu/admin.txt4
-rw-r--r--inc/lang/hu/lang.php8
-rw-r--r--inc/lang/it/lang.php4
-rw-r--r--inc/lang/ru/lang.php3
-rw-r--r--inc/parser/xhtml.php1
11 files changed, 124 insertions, 15 deletions
diff --git a/inc/Form/ButtonElement.php b/inc/Form/ButtonElement.php
new file mode 100644
index 000000000..77c30ed4f
--- /dev/null
+++ b/inc/Form/ButtonElement.php
@@ -0,0 +1,34 @@
+<?php
+namespace dokuwiki\Form;
+
+/**
+ * Class ButtonElement
+ *
+ * Represents a simple button
+ *
+ * @package dokuwiki\Form
+ */
+class ButtonElement extends Element {
+
+ /** @var string HTML content */
+ protected $content = '';
+
+ /**
+ * @param string $name
+ * @param string $content HTML content of the button. You have to escape it yourself.
+ */
+ function __construct($name, $content = '') {
+ parent::__construct('button', array('name' => $name, 'value' => 1));
+ $this->content = $content;
+ }
+
+ /**
+ * The HTML representation of this element
+ *
+ * @return string
+ */
+ public function toHTML() {
+ return '<button ' . buildAttributes($this->attrs()) . '>'.$this->content.'</button>';
+ }
+
+}
diff --git a/inc/Form/Form.php b/inc/Form/Form.php
index 625557fa1..7eaa53041 100644
--- a/inc/Form/Form.php
+++ b/inc/Form/Form.php
@@ -140,7 +140,7 @@ class Form extends Element {
* @return Element
*/
public function addElement(Element $element, $pos = -1) {
- if(is_a($element, '\dokuwiki\Form')) throw new \InvalidArgumentException('You can\'t add a form to a form');
+ if(is_a($element, '\dokuwiki\Form\Form')) throw new \InvalidArgumentException('You can\'t add a form to a form');
if($pos < 0) {
$this->elements[] = $element;
} else {
@@ -156,7 +156,7 @@ class Form extends Element {
* @param $pos 0-based position of the element to replace
*/
public function replaceElement(Element $element, $pos) {
- if(is_a($element, '\dokuwiki\Form')) throw new \InvalidArgumentException('You can\'t add a form to a form');
+ if(is_a($element, '\dokuwiki\Form\Form')) throw new \InvalidArgumentException('You can\'t add a form to a form');
array_splice($this->elements, $pos, 1, array($element));
}
@@ -234,6 +234,65 @@ class Form extends Element {
}
/**
+ * Adds a simple button, escapes the content for you
+ *
+ * @param string $name
+ * @param string $content
+ * @param int $pos
+ * @return Element
+ */
+ public function addButton($name, $content, $pos = -1) {
+ return $this->addElement(new ButtonElement($name, hsc($content)), $pos);
+ }
+
+ /**
+ * Adds a simple button, allows HTML for content
+ *
+ * @param string $name
+ * @param string $html
+ * @param int $pos
+ * @return Element
+ */
+ public function addButtonHTML($name, $html, $pos = -1) {
+ return $this->addElement(new ButtonElement($name, $html), $pos);
+ }
+
+ /**
+ * Adds a label referencing another input element, escapes the label for you
+ *
+ * @param $label
+ * @param string $for
+ * @param int $pos
+ * @return Element
+ */
+ public function addLabel($label, $for='', $pos = -1) {
+ return $this->addLabelHTML(hsc($label), $for, $pos);
+ }
+
+ /**
+ * Adds a label referencing another input element, allows HTML for content
+ *
+ * @param string $content
+ * @param string|Element $for
+ * @param int $pos
+ * @return Element
+ */
+ public function addLabelHTML($content, $for='', $pos = -1) {
+ $element = new LabelElement(hsc($content));
+
+ if(is_a($for, '\dokuwiki\Form\Element')) {
+ /** @var Element $for */
+ $for = $for->id();
+ }
+ $for = (string) $for;
+ if($for !== '') {
+ $element->attr('for', $for);
+ }
+
+ return $this->addElement($element, $pos);
+ }
+
+ /**
* Add fixed HTML to the form
*
* @param $html
diff --git a/inc/Form/InputElement.php b/inc/Form/InputElement.php
index 5908f7d11..694dd0848 100644
--- a/inc/Form/InputElement.php
+++ b/inc/Form/InputElement.php
@@ -12,7 +12,7 @@ namespace dokuwiki\Form;
*/
class InputElement extends Element {
/**
- * @var Label
+ * @var LabelElement
*/
protected $label = null;
@@ -24,18 +24,19 @@ class InputElement extends Element {
/**
* @param string $type The type of this element
* @param string $name The name of this form element
- * @param string $label The label text for this element
+ * @param string $label The label text for this element (will be autoescaped)
*/
public function __construct($type, $name, $label = '') {
parent::__construct($type, array('name' => $name));
$this->attr('name', $name);
- if($label) $this->label = new Label($label);
+ $this->attr('type', $type);
+ if($label) $this->label = new LabelElement($label);
}
/**
* Returns the label element if there's one set
*
- * @return Label|null
+ * @return LabelElement|null
*/
public function getLabel() {
return $this->label;
diff --git a/inc/Form/Label.php b/inc/Form/LabelElement.php
index 8dcd7cd5f..9c8d54277 100644
--- a/inc/Form/Label.php
+++ b/inc/Form/LabelElement.php
@@ -5,12 +5,12 @@ namespace dokuwiki\Form;
* Class Label
* @package dokuwiki\Form
*/
-class Label extends ValueElement {
+class LabelElement extends ValueElement {
/**
* Creates a new Label
*
- * @param string $label
+ * @param string $label This is is raw HTML and will not be escaped
*/
public function __construct($label) {
parent::__construct('label', $label);
@@ -22,6 +22,6 @@ class Label extends ValueElement {
* @return string
*/
public function toHTML() {
- return '<label ' . buildAttributes($this->attrs()) . '>' . hsc($this->val()) . '</label>';
+ return '<label ' . buildAttributes($this->attrs()) . '>' . $this->val() . '</label>';
}
}
diff --git a/inc/html.php b/inc/html.php
index 0914a1762..24d108ea4 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -959,13 +959,14 @@ function html_list_index($item){
*/
function html_li_index($item){
global $INFO;
+ global $ACT;
$class = '';
$id = '';
if($item['type'] == "f"){
// scroll to the current item
- if($item['id'] == $INFO['id']) {
+ if($item['id'] == $INFO['id'] && $ACT == 'index') {
$id = ' id="scroll__here"';
$class = ' bounce';
}
diff --git a/inc/lang/cs/lang.php b/inc/lang/cs/lang.php
index d6b50fb97..ffc99eccf 100644
--- a/inc/lang/cs/lang.php
+++ b/inc/lang/cs/lang.php
@@ -19,6 +19,7 @@
* @author Radovan Buroň <radovan@buron.cz>
* @author Viktor Zavadil <vzavadil@newps.cz>
* @author Jaroslav Lichtblau <jlichtblau@seznam.cz>
+ * @author Turkislav <turkislav@blabla.com>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -84,6 +85,7 @@ $lang['regmissing'] = 'Musíte vyplnit všechny údaje.';
$lang['reguexists'] = 'Uživatel se stejným jménem už je zaregistrován.';
$lang['regsuccess'] = 'Uživatelský účet byl vytvořen a heslo zasláno e-mailem.';
$lang['regsuccess2'] = 'Uživatelský účet byl vytvořen.';
+$lang['regfail'] = 'Uživatelský profil nemohl být vytvořen.';
$lang['regmailfail'] = 'Zdá se, že nastala chyba při posílání mailu s heslem. Zkuste kontaktovat správce.';
$lang['regbadmail'] = 'Zadaná e-mailová adresa není platná. Pokud si myslíte, že to je špatně, zkuste kontaktovat správce.';
$lang['regbadpass'] = 'Heslo nebylo zadáno dvakrát stejně, zkuste to prosím znovu.';
@@ -98,6 +100,7 @@ $lang['profdeleteuser'] = 'Smazat účet';
$lang['profdeleted'] = 'Váš uživatelský účet byl z této wiki smazán';
$lang['profconfdelete'] = 'Chci smazat můj účet z této wiki. <br/> Tato akce je nevratná.';
$lang['profconfdeletemissing'] = 'Potvrzovací tlačítko nezaškrtnuto';
+$lang['proffail'] = 'Uživatelský profil nebyl aktualizován.';
$lang['pwdforget'] = 'Zapomněli jste heslo? Nechte si zaslat nové';
$lang['resendna'] = 'Tato wiki neumožňuje zasílání nových hesel.';
$lang['resendpwd'] = 'Nastavit nové heslo pro';
@@ -343,6 +346,7 @@ $lang['media_perm_read'] = 'Bohužel, nemáte práva číst soubory.';
$lang['media_perm_upload'] = 'Bohužel, nemáte práva nahrávat soubory.';
$lang['media_update'] = 'Nahrát novou verzi';
$lang['media_restore'] = 'Obnovit tuto verzi';
+$lang['media_acl_warning'] = 'Tento seznam nemusí být úplný z důvodu omezení práv ACL a skrytým stránkám.';
$lang['currentns'] = 'Aktuální jmenný prostor';
$lang['searchresult'] = 'Výsledek hledání';
$lang['plainhtml'] = 'Čisté HTML';
diff --git a/inc/lang/hu/admin.txt b/inc/lang/hu/admin.txt
index 03d29243c..51b13eb56 100644
--- a/inc/lang/hu/admin.txt
+++ b/inc/lang/hu/admin.txt
@@ -1,3 +1,3 @@
-===== Adminisztrálás =====
+===== Adminisztráció =====
-Itt találod a DokuWiki adminisztrálási lehetőségeit.
+Itt találod a DokuWiki adminisztrációs lehetőségeit.
diff --git a/inc/lang/hu/lang.php b/inc/lang/hu/lang.php
index 37c23e892..83b45b6d2 100644
--- a/inc/lang/hu/lang.php
+++ b/inc/lang/hu/lang.php
@@ -74,11 +74,12 @@ $lang['badpassconfirm'] = 'Hibás jelszó';
$lang['minoredit'] = 'Apróbb változások';
$lang['draftdate'] = 'Piszkozat elmentve:';
$lang['nosecedit'] = 'Időközben megváltozott az oldal, emiatt a szakasz nem friss. Töltsd újra az egész oldalt!';
-$lang['searchcreatepage'] = "Ha nem találtad meg amit kerestél, akkor létrehozhatsz egy új oldalt a keresésed alapján ''Az oldal szerkesztése'' gombbal.";
+$lang['searchcreatepage'] = 'Ha nem találtad meg amit kerestél, akkor létrehozhatsz egy új oldalt a keresésed alapján \'\'Az oldal szerkesztése\'\' gombbal.';
$lang['regmissing'] = 'Sajnáljuk, az összes mezőt ki kell töltened.';
$lang['reguexists'] = 'Sajnáljuk, ilyen azonosítójú felhasználónk már van.';
$lang['regsuccess'] = 'A felhasználói azonosítót létrehoztuk. A jelszót postáztuk.';
$lang['regsuccess2'] = 'A felhasználói azonosítót létrehoztuk.';
+$lang['regfail'] = 'A felhasználó létrehozása sikertelen.';
$lang['regmailfail'] = 'Úgy tűnik hiba történt a jelszó postázása során. Kérjük lépj kapcsolatba az Adminisztrátorokkal!';
$lang['regbadmail'] = 'A megadott e-mail cím érvénytelennek tűnik. Ha úgy gondolod ez hiba, lépj kapcsolatba az Adminisztrátorokkal!';
$lang['regbadpass'] = 'A két megadott jelszó nem egyezik, próbáld újra!';
@@ -93,6 +94,7 @@ $lang['profdeleteuser'] = 'Felhasználói fiók törlése';
$lang['profdeleted'] = 'Felhasználói fiókodat eltávolítottuk erről a wiki-ről.';
$lang['profconfdelete'] = 'Szeretném eltávolítani a felhasználói fiókomat erről a wikiről. <br/> Ez a cselekvés nem visszavonható.';
$lang['profconfdeletemissing'] = 'A megerősítő négyzet nincs bepipálva';
+$lang['proffail'] = 'A profil frissítése sikertelen.';
$lang['pwdforget'] = 'Elfelejtetted a jelszavad? Itt kérhetsz újat';
$lang['resendna'] = 'Ez a wiki nem támogatja a jelszó újraküldést.';
$lang['resendpwd'] = 'Új jelszó beállítása a következőhöz:';
@@ -288,6 +290,7 @@ $lang['i_modified'] = 'Biztonsági okokból ez a Varázsló csak új
Csomagold ki újra a fájlokat a letöltött csomagból, vagy nézd meg a teljes <a href="http://dokuwiki.org/install">Dokuwiki telepítési útmutatót</a>.';
$lang['i_funcna'] = 'A <code>%s</code> PHP funkció nem elérhető. Esetleg a tárhelyszolgáltató letiltotta biztonsági okok miatt?';
$lang['i_phpver'] = 'A PHP <code>%s</code> verziója alacsonyabb, mint ami szükséges lenne: <code>%s</code>. Frissítsd a PHP-det újabb verzióra!';
+$lang['i_mbfuncoverload'] = 'A DokuWiki futtatásához az mbstring.func_overload opciót ki kell kapcsolni a php.ini-ben.';
$lang['i_permfail'] = 'A DokiWiki nem tudja írni a <code>%s</code> könyvtárat. Be kell állítanod ehhez a könyvtárhoz a megfelelő jogosultságokat!';
$lang['i_confexists'] = '<code>%s</code> már létezik.';
$lang['i_writeerr'] = 'Nem tudom ezt létrehozni: <code>%s</code>. Ellenőrizd a könyvtár/fájl jogosultságokat, és hozd létre az állományt kézzel.';
@@ -337,7 +340,10 @@ $lang['media_perm_read'] = 'Sajnáljuk, nincs jogod a fájlok olvasásáho
$lang['media_perm_upload'] = 'Sajnáljuk, nincs jogod a feltöltéshez.';
$lang['media_update'] = 'Új verzió feltöltése';
$lang['media_restore'] = 'Ezen verzió visszaállítása';
+$lang['media_acl_warning'] = 'Ez a lista hiányos lehet a hozzáférési listák (ACL) korlátozásai és a rejtett oldalak miatt.';
$lang['currentns'] = 'Aktuális névtér';
$lang['searchresult'] = 'Keresés eredménye';
$lang['plainhtml'] = 'Sima HTML';
$lang['wikimarkup'] = 'Wiki-jelölőnyelv';
+$lang['page_nonexist_rev'] = 'A(z) %s oldal nem létezik. Később lett létrehozva a(z) <a href="%s">%s</a> helyen.';
+$lang['unable_to_parse_date'] = 'A "%s" paraméter feldolgozása sikertelen.';
diff --git a/inc/lang/it/lang.php b/inc/lang/it/lang.php
index b84c4d7d8..a94bf821f 100644
--- a/inc/lang/it/lang.php
+++ b/inc/lang/it/lang.php
@@ -87,6 +87,7 @@ $lang['regmissing'] = 'Devi riempire tutti i campi.';
$lang['reguexists'] = 'Il nome utente inserito esiste già.';
$lang['regsuccess'] = 'L\'utente è stato creato. La password è stata spedita via email.';
$lang['regsuccess2'] = 'L\'utente è stato creato.';
+$lang['regfail'] = 'L\'utente non può essere creato.';
$lang['regmailfail'] = 'Sembra che ci sia stato un errore nell\'invio della email. Contatta l\'amministratore!';
$lang['regbadmail'] = 'L\'indirizzo email fornito sembra essere non valido - se pensi che ci sia un errore contatta l\'amministratore';
$lang['regbadpass'] = 'Le due password inserite non coincidono, prova di nuovo.';
@@ -101,6 +102,7 @@ $lang['profdeleteuser'] = 'Elimina account';
$lang['profdeleted'] = 'Il tuo account utente è stato rimosso da questa wiki';
$lang['profconfdelete'] = 'Voglio rimuovere il mio account da questa wiki. <br/> Questa operazione non può essere annullata.';
$lang['profconfdeletemissing'] = 'La check box di conferma non è selezionata';
+$lang['proffail'] = 'Il profilo utente non è stato aggiornato.';
$lang['pwdforget'] = 'Hai dimenticato la password? Richiedine una nuova';
$lang['resendna'] = 'Questo wiki non supporta l\'invio di nuove password.';
$lang['resendpwd'] = 'Imposta nuova password per';
@@ -347,7 +349,9 @@ $lang['media_perm_read'] = 'Spiacente, non hai abbastanza privilegi per le
$lang['media_perm_upload'] = 'Spiacente, non hai abbastanza privilegi per caricare files.';
$lang['media_update'] = 'Carica nuova versione';
$lang['media_restore'] = 'Ripristina questa versione';
+$lang['media_acl_warning'] = 'Questa lista potrebbe non essere completa a causa di restrizioni ACL e pagine nascoste.';
$lang['currentns'] = 'Namespace corrente';
$lang['searchresult'] = 'Risultati della ricerca';
$lang['plainhtml'] = 'HTML';
+$lang['wikimarkup'] = 'Marcatura wiki';
$lang['page_nonexist_rev'] = 'Pagina non esistente a %s. E\' stata creata successivamente a <a href="%s">%s</a>.';
diff --git a/inc/lang/ru/lang.php b/inc/lang/ru/lang.php
index 40d3ffefe..569ea0d9b 100644
--- a/inc/lang/ru/lang.php
+++ b/inc/lang/ru/lang.php
@@ -2,7 +2,7 @@
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
- *
+ *
* @author Yuri Pimenov <up@ftpsearch.lv>
* @author Igor Tarasov <tigr@mail15.com>
* @author Denis Simakov <akinoame1@gmail.com>
@@ -32,6 +32,7 @@
* @author Alex P <alexander@lanos.co.uk>
* @author Nolf <m.kopachovets@gmail.com>
* @author Takumo <9206984@mail.ru>
+ * @author RainbowSpike <1@2.ru>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index c92892a35..9d7613f32 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -1033,7 +1033,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$link['title'] = $this->_xmlEntities($url);
$url = str_replace('\\', '/', $url);
- $url = ltrim($url,'/');
$url = 'file:///'.$url;
$link['url'] = $url;