diff options
author | Andreas Gohr <andi@splitbrain.org> | 2014-03-14 17:09:29 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2014-03-14 17:09:29 +0100 |
commit | 3275c5d6feb683bf4151f7d4867b10431b254d1e (patch) | |
tree | 4fd5e9ecf9165eb1b7cddd3d2bb1ae1330db92ab /inc/html.php | |
parent | 8fcb305db0081dacd8e8ad0583da5ecc6c6837dc (diff) | |
parent | 1359eacbdbff842b241a85ea274a00982fec9267 (diff) | |
download | rpg-3275c5d6feb683bf4151f7d4867b10431b254d1e.tar.gz rpg-3275c5d6feb683bf4151f7d4867b10431b254d1e.tar.bz2 |
Merge branch 'master' into diff_navigation
* master: (103 commits)
Add a basic test case for the cache
Events: Trigger a warning if the default action is not callable
Fix caching (make the event callback public again)
translation update
translation update
translation update
translation update
translation update
translation update
translation update
avoid HTTP image screenshot urls. closes #595
translation update
Extension manager: Fix cache extension to be .repo
adjusted the office type color again
another instance of empty() where an array key might not exist
remove placeholder van denied.txt
updated file icons once more
removed 'not logged in' text, loginform is shown already
Revert "added stripped bit to language file"
fixed index file
...
Conflicts:
inc/html.php
Diffstat (limited to 'inc/html.php')
-rw-r--r-- | inc/html.php | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/inc/html.php b/inc/html.php index 72120438f..57a22b880 100644 --- a/inc/html.php +++ b/inc/html.php @@ -65,6 +65,20 @@ function html_login(){ print '</div>'.NL; } + +/** + * Denied page content + * + * @return string html + */ +function html_denied() { + print p_locale_xhtml('denied'); + + if(!$_SERVER['REMOTE_USER']){ + html_login(); + } +} + /** * inserts section edit buttons if wanted or removes the markers * @@ -697,7 +711,7 @@ function html_recent($first=0, $show_changes='both'){ $form->addElement(form_makeOpenTag('div', array('class' => 'li'))); - if ($recent['media']) { + if (!empty($recent['media'])) { $form->addElement(media_printicon($recent['id'])); } else { $icon = DOKU_BASE.'lib/images/fileicons/file.png'; @@ -711,9 +725,8 @@ function html_recent($first=0, $show_changes='both'){ $diff = false; $href = ''; - if ($recent['media']) { - $medialog = new MediaChangeLog($recent['id']); - $diff = (count($medialog->getRevisions(0, 1)) && @file_exists(mediaFN($recent['id']))); + if (!empty($recent['media'])) { + $diff = (count(getRevisions($recent['id'], 0, 1, 8192, true)) && @file_exists(mediaFN($recent['id']))); if ($diff) { $href = media_managerURL(array('tab_details' => 'history', 'mediado' => 'diff', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&'); @@ -722,7 +735,7 @@ function html_recent($first=0, $show_changes='both'){ $href = wl($recent['id'],"do=diff", false, '&'); } - if ($recent['media'] && !$diff) { + if (!empty($recent['media']) && !$diff) { $form->addElement('<img src="'.DOKU_BASE.'lib/images/blank.gif" width="15" height="11" alt="" />'); } else { $form->addElement(form_makeOpenTag('a', array('class' => 'diff_link', 'href' => $href))); @@ -736,7 +749,7 @@ function html_recent($first=0, $show_changes='both'){ $form->addElement(form_makeCloseTag('a')); } - if ($recent['media']) { + if (!empty($recent['media'])) { $href = media_managerURL(array('tab_details' => 'history', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&'); } else { @@ -752,7 +765,7 @@ function html_recent($first=0, $show_changes='both'){ ))); $form->addElement(form_makeCloseTag('a')); - if ($recent['media']) { + if (!empty($recent['media'])) { $href = media_managerURL(array('tab_details' => 'view', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&'); $class = (file_exists(mediaFN($recent['id']))) ? 'wikilink1' : $class = 'wikilink2'; $form->addElement(form_makeOpenTag('a', array('class' => $class, 'href' => $href))); |