Skip to content

Commit

Permalink
Merge pull request #275 from nerun/deprecation
Browse files Browse the repository at this point in the history
Fix deprecations: html_li_index and PageResolver
  • Loading branch information
Klap-in authored Dec 14, 2023
2 parents ccec376 + 73ed217 commit e794ca0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion action.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ function print_index($ns) {
$out = '';
if($_REQUEST['nojs']) {
require_once(DOKU_INC.'inc/html.php');
$out_tmp = html_buildlist($data, 'idx', array($idxm, "_html_list_index"), "html_li_index");
$out_tmp = html_buildlist($data, 'idx', array($idxm, "_html_list_index"), "tagListItem");
$out .= preg_replace('/<ul class="idx">(.*)<\/ul>/s', "$1", $out_tmp);
} else {
$nodes = $idxm->_jsnodes($data, '', 0);
Expand Down
2 changes: 1 addition & 1 deletion ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function print_index($ns) {
}
if($_REQUEST['nojs']) {
require_once(DOKU_INC.'inc/html.php');
$out_tmp = html_buildlist($data, 'idx', array($idxm, "_html_list_index"), "html_li_index");
$out_tmp = html_buildlist($data, 'idx', array($idxm, "_html_list_index"), "tagListItem");
$out .= preg_replace('/<ul class="idx">(.*)<\/ul>/s', "$1", $out_tmp);
} else {
$nodes = $idxm->_jsnodes($data, '', 0);
Expand Down
17 changes: 11 additions & 6 deletions syntax/indexmenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Samuele Tognini <[email protected]>
*
*/

use dokuwiki\File\PageResolver;
if(!defined('DOKU_INC')) die();
if(!defined('INDEXMENU_IMG_ABSDIR')) define('INDEXMENU_IMG_ABSDIR', DOKU_PLUGIN."indexmenu/images");

Expand Down Expand Up @@ -428,7 +428,7 @@ private function _indexmenu($myns) {
// the toggle interacts with hide needed for js option.
$output = "\n";
$output .= '<div><div id="nojs_'.$js_name.'" data-jsajax="'.utf8_encodeFN($js_opts['jsajax']).'" class="indexmenu_nojs">'."\n";
$output .= html_buildlist($data, 'idx', array($this, "_html_list_index"), "html_li_index");
$output .= html_buildlist($data, 'idx', array($this, "_html_list_index"), "tagListItem");
$output .= "</div></div>\n";
$output .= $output_tmp;
return $output;
Expand Down Expand Up @@ -617,13 +617,18 @@ private function _getTitle($ns, $headpage, &$hns) {
* @return string id of namespace
*/
public function _parse_ns($ns, $id = FALSE) {
if(!$id) {
if(!$id === false) {
global $ID;
$id = $ID;
}
//Just for old reelases compatibility
if(empty($ns) || $ns == '..') $ns = ":..";
return resolve_id(getNS($id), $ns);
//Just for old reelases compatibility, .. was an old version for : in the docs of indexmenu
if ($ns == '..') {
$ns = ":";
}
$ns = "$ns:arandompagehere";
$resolver = new PageResolver($id);
$ns = getNs($resolver->resolveId($ns));
return $ns === false ? '' : $ns;
}

/**
Expand Down

0 comments on commit e794ca0

Please sign in to comment.