diff options
Diffstat (limited to 'inc/template.php')
-rw-r--r-- | inc/template.php | 98 |
1 files changed, 94 insertions, 4 deletions
diff --git a/inc/template.php b/inc/template.php index b9b3951ff..4226c0e52 100644 --- a/inc/template.php +++ b/inc/template.php @@ -89,7 +89,8 @@ function tpl_content_core(){ $_REQUEST['first'] = $_REQUEST['first'][0]; } $first = is_numeric($_REQUEST['first']) ? intval($_REQUEST['first']) : 0; - html_recent($first); + $show_changes = $_REQUEST['show_changes']; + html_recent($first, $show_changes); break; case 'index': html_index($IDX); #FIXME can this be pulled from globals? is it sanitized correctly? @@ -122,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()) @@ -626,6 +630,8 @@ function tpl_get_action($type) { // Superseded by subscribe/subscription return ''; break; + case 'media': + break; default: return '[unknown %s type]'; break; @@ -1123,16 +1129,64 @@ 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 <pshns@ukr.net> + */ +function tpl_fileList(){ + global $AUTH; + global $NS; + global $JUMPTO; + + $opened_tab = $_REQUEST['tab_files']; + if (!$opened_tab) $opened_tab = 'files'; + if ($_REQUEST['mediado'] == 'update') $opened_tab = 'upload'; + + 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 <pshns@ukr.net> + */ +function tpl_fileDetails(){ + global $AUTH; + global $NS; + + if ($_REQUEST['image']) $image = cleanID($_REQUEST['image']); + if (!isset($image) || isset($NS) && getNS($image) != $NS) return ''; + + $opened_tab = $_REQUEST['tab_details']; + if (!$opened_tab) $opened_tab = 'view'; + if ($_REQUEST['edit']) $opened_tab = 'edit'; + media_tabs_details($opened_tab); + + if ($opened_tab == 'view') media_tab_view($image, $NS, $AUTH); + if ($opened_tab == 'edit') media_tab_edit($image, $NS, $AUTH); + if ($opened_tab == 'history') media_tab_history($image,$NS,$AUTH); +} + +/** * prints the namespace tree in the mediamanger popup * * Only allowed in mediamanager.php * * @author Andreas Gohr <andi@splitbrain.org> */ -function tpl_mediaTree(){ +function tpl_mediaTree($fullscreen = false){ global $NS; - - ptln('<div id="media__tree">'); + if ($fullscreen) ptln('<div id="media-menu">'); + else ptln('<div id="media__tree">'); media_nstree($NS); ptln('</div>'); } @@ -1358,6 +1412,42 @@ function tpl_getFavicon($abs=false) { return DOKU_TPL.'images/favicon.ico'; } +/** + * Prints full-screen media manager + * + * @author Kate Arzamastseva <pshns@ukr.net> + */ +function tpl_media() { + // + global $DEL, $NS, $IMG, $AUTH, $JUMPTO, $lang, $fullscreen; + $fullscreen = true; + require_once(DOKU_INC.'lib/exe/mediamanager.php'); + + echo '<div class="mediamanager" id="id-mediamanager">'; + echo '<div class="mediamanager-slider" id="id-mediamanager-layout">'; + echo '<div id="id-mediamanager-layout-namespaces" class="layout" style="width: 25%;">'; + html_msgarea(); + echo '<div class="mediamanager-tabs">'; + echo '<a href="#" class="selected">'.hsc($lang['namespaces']).'</a>'; + echo '<div class="clearer"></div>'; + echo '</div>'; + echo '<div class="background-container">'; + echo hsc($lang['namespaces']); + echo '</div>'; + echo '<div class="scroll-container">'; + tpl_mediaTree(true); + echo '</div>'; + echo '</div>'; + echo '<div id="id-mediamanager-layout-list" class="layout" style="width: 40%;">'; + tpl_fileList(); + echo '</div>'; + echo '<div id="id-mediamanager-layout-detail" class="layout" style="width: 30%;">'; + tpl_fileDetails(); + echo '</div>'; + echo '<div class="clearer"></div>'; + echo '</div>'; + echo '</div>'; +} //Setup VIM: ex: et ts=4 : |