From d9162c6cd87643d7e7af8e37cd93aa48b8aecb96 Mon Sep 17 00:00:00 2001 From: Kate Arzamastseva Date: Thu, 9 Jun 2011 14:04:50 +0300 Subject: fullscreen media manager --- inc/template.php | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 3 deletions(-) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index d2d66220c..4bbb501fc 100644 --- a/inc/template.php +++ b/inc/template.php @@ -123,6 +123,9 @@ function tpl_content_core(){ case 'subscribe': tpl_subscribe(); break; + case 'media': + tpl_media(); + break; default: $evt = new Doku_Event('TPL_ACT_UNKNOWN',$ACT); if ($evt->advise_before()) @@ -1123,6 +1126,56 @@ function tpl_mediaContent($fromajax=false){ } +/** + * Prints the central column in full-screen media manager + * Depending on the opened tab this may be a list of + * files in a namespace, upload form or search form + * + * @author Kate Arzamastseva + */ +function tpl_fileList(){ + global $AUTH; + global $NS; + global $JUMPTO; + + $opened_tab = $_REQUEST['tab_files']; + if (!$opened_tab) $opened_tab = 'files'; + + media_tabs_files($opened_tab); + if ($opened_tab == 'files') media_tab_files($NS,$AUTH,$JUMPTO); + if ($opened_tab == 'upload') media_tab_upload($NS,$AUTH,$JUMPTO); + if ($opened_tab == 'search') media_tab_search($NS,$AUTH); + +} + +/** + * Prints the third column in full-screen media manager + * Depending on the opened tab this may be details of the + * selected file, the meta editing dialog or + * list of file revisions + * + * @author Kate Arzamastseva + */ +function tpl_fileDetails(){ + global $AUTH; + global $NS; + global $IMG; + + $opened_tab = $_REQUEST['tab_details']; + if (!$opened_tab) $opened_tab = 'view'; + if ($_REQUEST['edit']) $opened_tab = 'edit'; + media_tabs_details($opened_tab); + + $image = $_REQUEST['image']; + if (!$image && !$IMG) return false; + if ($opened_tab == 'view') media_tab_view($image, $NS, $AUTH); + if ($opened_tab == 'edit') { + if ($IMG) media_tab_edit($IMG, $NS, $AUTH); + else if ($image) media_tab_edit($image, $NS, $AUTH); + } + if ($opened_tab == 'history') media_tab_history($image,$NS,$AUTH); +} + /** * prints the namespace tree in the mediamanger popup * @@ -1130,10 +1183,10 @@ function tpl_mediaContent($fromajax=false){ * * @author Andreas Gohr */ -function tpl_mediaTree(){ +function tpl_mediaTree($fullscreen = false){ global $NS; - - ptln('
'); + if ($fullscreen) ptln('
'); + else ptln('
'); media_nstree($NS); ptln('
'); } @@ -1359,6 +1412,36 @@ function tpl_getFavicon($abs=false) { return DOKU_TPL.'images/favicon.ico'; } +/** + * Prints full-screen media manager + * + * @author Kate Arzamastseva + */ +function tpl_media() { + // + global $DEL, $NS, $IMG, $AUTH, $JUMPTO; + require_once(DOKU_INC.'lib/exe/mediamanager.php'); + + echo '
'; + echo '
'; + echo '
'; + html_msgarea(); + echo hsc('Namespaces:'); + echo '

'; + echo '
'; + tpl_mediaTree(true); + echo '
'; + echo '
'; + echo '
'; + tpl_fileList(); + echo '
'; + echo '
'; + tpl_fileDetails(); + echo '
'; + echo '
 
'; + echo '
'; + echo '
'; +} //Setup VIM: ex: et ts=4 : -- cgit v1.2.3