diff options
Diffstat (limited to 'lib/exe')
-rw-r--r-- | lib/exe/ajax.php | 36 | ||||
-rw-r--r-- | lib/exe/js.php | 1 |
2 files changed, 35 insertions, 2 deletions
diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php index 3f64dc7ac..8bcf184b5 100644 --- a/lib/exe/ajax.php +++ b/lib/exe/ajax.php @@ -28,7 +28,7 @@ if(isset($_POST['call'])) else if(isset($_GET['call'])) $call = 'ajax_'.$_GET['call']; else - return; + exit; if(function_exists($call)){ $call(); }else{ @@ -167,6 +167,8 @@ function ajax_draftdel(){ /** * Return subnamespaces for the Mediamanager + * + * @author Andreas Gohr <andi@splitbrain.org> */ function ajax_medians(){ global $conf; @@ -190,7 +192,9 @@ function ajax_medians(){ } /** - * Return subnamespaces for the Mediamanager + * Return list of files for the Mediamanager + * + * @author Andreas Gohr <andi@splitbrain.org> */ function ajax_medialist(){ global $conf; @@ -199,5 +203,33 @@ function ajax_medialist(){ media_filelist($_POST['ns']); } +/** + * Return sub index for index view + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function ajax_index(){ + global $conf; + require_once(DOKU_INC.'inc/search.php'); + require_once(DOKU_INC.'inc/html.php'); + + // wanted namespace + $ns = cleanID($_POST['idx']); + $dir = utf8_encodeFN(str_replace(':','/',$ns)); + + $lvl = count(explode(':',$ns)); + + $data = array(); + search($data,$conf['datadir'],'search_index',array('ns' => $ns),$dir); + foreach($data as $item){ + $item['level'] = $lvl+1; + echo html_li_index($item); + echo '<div class="li">'; + echo html_list_index($item); + echo '</div>'; + echo '</li>'; + } +} + //Setup VIM: ex: et ts=2 enc=utf-8 : ?> diff --git a/lib/exe/js.php b/lib/exe/js.php index 98b276d53..802ed4490 100644 --- a/lib/exe/js.php +++ b/lib/exe/js.php @@ -45,6 +45,7 @@ function js_out(){ DOKU_INC.'lib/scripts/script.js', DOKU_INC.'lib/scripts/tw-sack.js', DOKU_INC.'lib/scripts/ajax.js', + DOKU_INC.'lib/scripts/index.js', ); if($edit){ if($write){ |