Skip to content

Commit e794ca0

Browse files
authored
Merge pull request #275 from nerun/deprecation
Fix deprecations: html_li_index and PageResolver
2 parents ccec376 + 73ed217 commit e794ca0

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

action.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ function print_index($ns) {
352352
$out = '';
353353
if($_REQUEST['nojs']) {
354354
require_once(DOKU_INC.'inc/html.php');
355-
$out_tmp = html_buildlist($data, 'idx', array($idxm, "_html_list_index"), "html_li_index");
355+
$out_tmp = html_buildlist($data, 'idx', array($idxm, "_html_list_index"), "tagListItem");
356356
$out .= preg_replace('/<ul class="idx">(.*)<\/ul>/s', "$1", $out_tmp);
357357
} else {
358358
$nodes = $idxm->_jsnodes($data, '', 0);

ajax.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ function print_index($ns) {
189189
}
190190
if($_REQUEST['nojs']) {
191191
require_once(DOKU_INC.'inc/html.php');
192-
$out_tmp = html_buildlist($data, 'idx', array($idxm, "_html_list_index"), "html_li_index");
192+
$out_tmp = html_buildlist($data, 'idx', array($idxm, "_html_list_index"), "tagListItem");
193193
$out .= preg_replace('/<ul class="idx">(.*)<\/ul>/s', "$1", $out_tmp);
194194
} else {
195195
$nodes = $idxm->_jsnodes($data, '', 0);

syntax/indexmenu.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @author Samuele Tognini <samuele@samuele.netsons.org>
77
*
88
*/
9-
9+
use dokuwiki\File\PageResolver;
1010
if(!defined('DOKU_INC')) die();
1111
if(!defined('INDEXMENU_IMG_ABSDIR')) define('INDEXMENU_IMG_ABSDIR', DOKU_PLUGIN."indexmenu/images");
1212

@@ -428,7 +428,7 @@ private function _indexmenu($myns) {
428428
// the toggle interacts with hide needed for js option.
429429
$output = "\n";
430430
$output .= '<div><div id="nojs_'.$js_name.'" data-jsajax="'.utf8_encodeFN($js_opts['jsajax']).'" class="indexmenu_nojs">'."\n";
431-
$output .= html_buildlist($data, 'idx', array($this, "_html_list_index"), "html_li_index");
431+
$output .= html_buildlist($data, 'idx', array($this, "_html_list_index"), "tagListItem");
432432
$output .= "</div></div>\n";
433433
$output .= $output_tmp;
434434
return $output;
@@ -617,13 +617,18 @@ private function _getTitle($ns, $headpage, &$hns) {
617617
* @return string id of namespace
618618
*/
619619
public function _parse_ns($ns, $id = FALSE) {
620-
if(!$id) {
620+
if(!$id === false) {
621621
global $ID;
622622
$id = $ID;
623623
}
624-
//Just for old reelases compatibility
625-
if(empty($ns) || $ns == '..') $ns = ":..";
626-
return resolve_id(getNS($id), $ns);
624+
//Just for old reelases compatibility, .. was an old version for : in the docs of indexmenu
625+
if ($ns == '..') {
626+
$ns = ":";
627+
}
628+
$ns = "$ns:arandompagehere";
629+
$resolver = new PageResolver($id);
630+
$ns = getNs($resolver->resolveId($ns));
631+
return $ns === false ? '' : $ns;
627632
}
628633

629634
/**

0 commit comments

Comments
 (0)