-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge newpagetemplate feature, and fix up some coding standards items.
- Loading branch information
Showing
3 changed files
with
11 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ If you give @NS@ or @PAGE@ as namespace, the namespace of the current page or th | |
- Updated by Sam Wilson <[email protected]>, 2013. | ||
- Updated by Michael Braun <[email protected]>, 2013. | ||
- Improved by Róbert Toth (FurloSK), 2013. | ||
- Support for newpagetemplate added by Gerrit Uitslag <[email protected]>, 2014. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,8 +55,10 @@ public function connectTo($mode) { | |
* @param int $pos The character position of the matched text | ||
* @param Doku_Handler $handler The Doku_Handler object | ||
* @return array Return an array with all data you want to use in render | ||
* @codingStandardsIgnoreStart | ||
*/ | ||
public function handle($match, $state, $pos, Doku_Handler $handler) { | ||
/* @codingStandardsIgnoreEnd */ | ||
$options = substr($match, 9, -2); // strip markup | ||
$options = explode('#', $options, 2); | ||
|
||
|
@@ -118,7 +120,7 @@ public function render($mode, Doku_Renderer $renderer, $data) { | |
* @author Samuele Tognini <[email protected]> | ||
* @author Michael Braun <[email protected]> | ||
*/ | ||
protected function _parse_ns($ns) { | ||
protected function _parseNS($ns) { | ||
global $ID; | ||
if($ns == "@PAGE@") return $ID; | ||
if($ns == "@NS@") return getNS($ID); | ||
|
@@ -151,7 +153,7 @@ protected function _htmlNamespaceInput($dest_ns, &$disablecache) { | |
//namespace given, but hidden | ||
if($hide && !empty($dest_ns)) { | ||
if($can_create) { | ||
return '<input type="hidden" name="np_cat" id="np_cat" value="' . $this->_parse_ns($dest_ns) . '"/>'; | ||
return '<input type="hidden" name="np_cat" id="np_cat" value="' . $this->_parseNS($dest_ns) . '"/>'; | ||
} else { | ||
return false; | ||
} | ||
|
@@ -178,7 +180,7 @@ protected function _htmlNamespaceInput($dest_ns, &$disablecache) { | |
} | ||
} | ||
|
||
$subnamespaces = $this->_getnslist($dest_ns); | ||
$subnamespaces = $this->_getNamespaceList($dest_ns); | ||
foreach($subnamespaces as $ns) { | ||
if(auth_quickaclcheck($ns . ":") < AUTH_CREATE) continue; | ||
$nsparts = explode(':', $ns); | ||
|
@@ -203,7 +205,7 @@ protected function _htmlNamespaceInput($dest_ns, &$disablecache) { | |
* @param string $topns The top namespace | ||
* @return array Multi-dimensional array of all namespaces below $tns | ||
*/ | ||
protected function _getnslist($topns = '') { | ||
protected function _getNamespaceList($topns = '') { | ||
global $conf; | ||
|
||
$topns = utf8_encodeFN(str_replace(':', '/', $topns)); | ||
|
@@ -243,7 +245,7 @@ public function _htmlTemplateInput($newpagetemplates) { | |
|
||
} else { | ||
if($cnt == 1) { | ||
list($template, ) = $this->_parseNStemplatepage($newpagetemplates[0]); | ||
list($template, ) = $this->_parseNSTemplatePage($newpagetemplates[0]); | ||
$input = '<input type="hidden" name="newpagetemplate" value="' . formText($template) . '" />'; | ||
} else { | ||
$first = true; | ||
|
@@ -252,7 +254,7 @@ public function _htmlTemplateInput($newpagetemplates) { | |
$p = ($first ? ' selected="selected"' : ''); | ||
$first = false; | ||
|
||
list($template, $name) = $this->_parseNStemplatepage($template); | ||
list($template, $name) = $this->_parseNSTemplatePage($template); | ||
$p .= ' value="'.formText($template).'"'; | ||
$input .= "<option $p>".formText($name)."</option>"; | ||
} | ||
|
@@ -269,7 +271,7 @@ public function _htmlTemplateInput($newpagetemplates) { | |
* @param $nstemplate | ||
* @return array | ||
*/ | ||
protected function _parseNStemplatepage($nstemplate) { | ||
protected function _parseNSTemplatePage($nstemplate) { | ||
global $ID; | ||
|
||
@list($template, $name) = explode('|', $nstemplate, 2); | ||
|