diff options
author | Andreas Gohr <andi@splitbrain.org> | 2006-05-19 18:50:23 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2006-05-19 18:50:23 +0200 |
commit | 3df72098bbc205fa4bd4735d52d2626baad93548 (patch) | |
tree | 105ca14ca3ff596ad4c7d20a1985aeb02c5f7caa /lib/exe/ajax.php | |
parent | a219c1f00349b720d262939fec3e7baf19a63402 (diff) | |
download | rpg-3df72098bbc205fa4bd4735d52d2626baad93548.tar.gz rpg-3df72098bbc205fa4bd4735d52d2626baad93548.tar.bz2 |
new mediamanager
This patch adds a completely rewritten media popup. The following noteworthy
changes were made:
- media manager uses a collapsible namespace tree
- media manager uses AJAX if available
- media manager popup can be kept open when selecting a media file
- only one template is used for the media manager :!: Template
- Editable image metadata is configured in conf/mediameta.php now
- The JS cookie mechanism was enhanced to store key/value pairs
- Language strings can be exported to JS in js.php
darcs-hash:20060519165023-7ad00-4932b4553fc919aa4a8b8187958b823acf4f8cee.gz
Diffstat (limited to 'lib/exe/ajax.php')
-rw-r--r-- | lib/exe/ajax.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php index 886e9829d..c9b93a4b8 100644 --- a/lib/exe/ajax.php +++ b/lib/exe/ajax.php @@ -97,6 +97,8 @@ function ajax_lock(){ /** * Delete a draft + * + * @author Andreas Gohr <andi@splitbrain.org> */ function ajax_draftdel(){ $id = cleanID($_POST['id']); @@ -109,5 +111,39 @@ function ajax_draftdel(){ @unlink($cname); } +/** + * Return subnamespaces for the Mediamanager + */ +function ajax_medians(){ + global $conf; + require_once(DOKU_INC.'inc/search.php'); + require_once(DOKU_INC.'inc/media.php'); + + // wanted namespace + $ns = cleanID($_POST['ns']); + $dir = utf8_encodeFN(str_replace(':','/',$ns)); + + $lvl = count(explode(':',$ns)); + + $data = array(); + search($data,$conf['mediadir'],'search_index',array(),$dir); + foreach($data as $item){ + $item['level'] = $lvl+1; + echo media_nstree_li($item); + echo media_nstree_item($item); + echo '</div></li>'; + } +} + +/** + * Return subnamespaces for the Mediamanager + */ +function ajax_medialist(){ + global $conf; + require_once(DOKU_INC.'inc/media.php'); + + media_filelist($_POST['ns']); +} + //Setup VIM: ex: et ts=2 enc=utf-8 : ?> |