summaryrefslogtreecommitdiff
path: root/inc/html.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/html.php')
-rw-r--r--inc/html.php27
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)));