diff options
Diffstat (limited to 'inc/template.php')
-rw-r--r-- | inc/template.php | 129 |
1 files changed, 126 insertions, 3 deletions
diff --git a/inc/template.php b/inc/template.php index a476e78ab..81b3795ac 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; @@ -1122,15 +1128,91 @@ 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') { + echo '<div class="mediamanager-tab-files" id="mediamanager__files">'; + media_tab_files($NS,$AUTH,$JUMPTO); + echo '</div>'; + + } elseif ($opened_tab == 'upload') { + echo '<div class="mediamanager-tab-upload" id="mediamanager__files">'; + media_tab_upload($NS,$AUTH,$JUMPTO); + echo '</div>'; + + } elseif ($opened_tab == 'search') { + echo '<div class="mediamanager-tab-search" id="mediamanager__files">'; + media_tab_search($NS,$AUTH); + echo '</div>'; + } + +} + +/** + * 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($image, $rev){ + global $AUTH; + global $NS; + + if (!$image || !file_exists(mediaFN($image))) return ''; + if ($rev && !file_exists(mediaFN($image, $rev))) return ''; + if (isset($NS) && getNS($image) != $NS) return ''; + $do = $_REQUEST['mediado']; + + $opened_tab = $_REQUEST['tab_details']; + if (!$opened_tab) $opened_tab = 'view'; + if ($_REQUEST['edit']) $opened_tab = 'edit'; + if ($do == 'restore') $opened_tab = 'view'; + + media_tabs_details($image, $opened_tab); + + if ($opened_tab == 'view') { + echo '<div class="mediamanager-tab-detail-view" id="mediamanager__details">'; + media_tab_view($image, $NS, $AUTH, $rev); + echo '</div>'; + + } elseif ($opened_tab == 'edit') { + echo '<div class="mediamanager-tab-detail-edit" id="mediamanager__details">'; + media_tab_edit($image, $NS, $AUTH); + echo '</div>'; + + } elseif ($opened_tab == 'history') { + echo '<div class="mediamanager-tab-detail-history" id="mediamanager__details">'; + media_tab_history($image,$NS,$AUTH); + echo '</div>'; + } +} + +/** * 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">'); media_nstree($NS); ptln('</div>'); @@ -1357,6 +1439,47 @@ 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, $REV, $lang, $fullscreen; + $fullscreen = true; + require_once(DOKU_INC.'lib/exe/mediamanager.php'); + + if ($_REQUEST['image']) $image = cleanID($_REQUEST['image']); + if (isset($IMG)) $image = $IMG; + if (isset($JUMPTO)) $image = $JUMPTO; + if (isset($REV) && !$JUMPTO) $rev = $REV; + + 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="mediamanager__layout_list" class="layout" style="width: 40%;">'; + tpl_fileList(); + echo '</div>'; + echo '<div id="mediamanager__layout_detail" class="layout" style="width: 30%;">'; + tpl_fileDetails($image, $rev); + echo '</div>'; + echo '<div class="clearer"></div>'; + echo '</div>'; + echo '</div>'; +} //Setup VIM: ex: et ts=4 : |