Skip to content

Commit

Permalink
Merge branch 'master' into pr72
Browse files Browse the repository at this point in the history
# Conflicts:
#	plugin.info.txt
#	syntax.php
  • Loading branch information
dregad committed Sep 14, 2024
2 parents d2f6521 + dce4bf9 commit 71d2f1b
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 5 deletions.
1 change: 1 addition & 0 deletions lang/en/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* English language file
*/
$lang['namespaceRoot'] = "Root";
$lang['name'] = "Page name";
$lang['okbutton'] = "Add page";
$lang['nooption'] = "You are not allowed to add pages";
//Setup VIM: ex: et ts=2 enc=utf-8 :
1 change: 1 addition & 0 deletions lang/fr/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
* French language file
*/
$lang['namespaceRoot'] = "Racine";
$lang['name'] = "Nom de la page";
$lang['okbutton'] = "Créer";
$lang['nooption'] = "Vous n'avez pas les droits pour ajouter une page";
10 changes: 10 additions & 0 deletions lang/hu/lang.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Fekete Ádám Zsolt <[email protected]>
*/
$lang['namespaceRoot'] = 'Kiindulónévtér';
$lang['okbutton'] = 'Oldal hozzáadása';
$lang['nooption'] = 'Nincs jogosultságod oldal létrehozásához';
11 changes: 11 additions & 0 deletions lang/hu/settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Fekete Ádám Zsolt <[email protected]>
*/
$lang['addpage_exclude'] = 'Elrejtett névterek (pontosvesszővel elválasztva)';
$lang['addpage_showroot'] = 'Kiindulónévtér mutatása';
$lang['addpage_hide'] = 'A {{NEWPAGE>[ns]}} szintaxis használatakor: Névtérválasztó lista elrejtése (ha nincs bejelölve: mutatja az alnévtereket)';
$lang['addpage_hideACL'] = 'A {{NEWPAGE}} elrejtése ha a felhasználónak nincs jogosultsága oldal létrehozásához (ha nincs bejelölve, egy üzenet fog megjelenni)';
2 changes: 1 addition & 1 deletion plugin.info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
base addnewpage
author Damien Regad, Benjamin Santalucia, Sam Wilson and other contributors
email [email protected]
date 2017-05-29
date 2024-09-14
name Add New Page plugin
desc Adds a "new page form" to any wiki page.
url https://www.dokuwiki.org/plugin:addnewpage
11 changes: 7 additions & 4 deletions syntax.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
* @noinspection PhpMissingParamTypeInspection, PhpMissingReturnTypeInspection
*/

use dokuwiki\Extension\SyntaxPlugin;
use dokuwiki\File\PageResolver;

// must be run within Dokuwiki
if(!defined('DOKU_INC')) die();

class syntax_plugin_addnewpage extends DokuWiki_Syntax_Plugin {
class syntax_plugin_addnewpage extends SyntaxPlugin {

/** @var array the parsed options */
protected $options;
Expand Down Expand Up @@ -111,7 +112,7 @@ public function handle($match, $state, $pos, Doku_Handler $handler) {
/**
* Create the new-page form.
*
* @param $format string output format being rendered
* @param $format string output format being rendered
* @param $renderer Doku_Renderer the current renderer object
* @param $data array data created by handler()
* @return boolean rendered correctly?
Expand Down Expand Up @@ -141,9 +142,11 @@ public function render($format, Doku_Renderer $renderer, $data) {
if($this->options['autopage']) $input = 'hidden';

$form = '<div class="addnewpage"><p>'
. '<form name="addnewpage" method="get" action="' . DOKU_BASE . DOKU_SCRIPT . '" accept-charset="' . $lang['encoding'] . '">'
. '<form name="addnewpage" method="get" action="' . DOKU_BASE . DOKU_SCRIPT
. '" accept-charset="' . $lang['encoding'] . '">'
. $namespaceinput
. '<input class="edit" type="'.$input.'" name="title" size="20" maxlength="255" tabindex="2" />'
. '<input class="edit" type="' . $input . '" name="title" size="20" maxlength="255" tabindex="2" placeholder="'
. $this->getLang('name') . '"/>'
. $newpagetemplateinput
. '<input type="hidden" name="newpagevars" value="' . $data['newpagevars'] . '"/>'
. '<input type="hidden" name="do" value="edit" />'
Expand Down

0 comments on commit 71d2f1b

Please sign in to comment.