summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/changelog.php1
-rw-r--r--inc/html.php78
-rw-r--r--inc/lang/en/lang.php8
-rw-r--r--lib/scripts/behaviour.js4
-rw-r--r--lib/tpl/default/design.css10
5 files changed, 58 insertions, 43 deletions
diff --git a/inc/changelog.php b/inc/changelog.php
index e9b271363..578a04298 100644
--- a/inc/changelog.php
+++ b/inc/changelog.php
@@ -204,6 +204,7 @@ function getRecents($first,$num,$ns='',$flags=0){
if (($flags & RECENTS_MEDIA_PAGES_MIXED) && @$media_rec['date'] >= @$rec['date']) {
$media_lines_position--;
$x = $media_rec;
+ $x['media'] = true;
$media_rec = false;
} else {
$lines_position--;
diff --git a/inc/html.php b/inc/html.php
index e256291ee..4bbfe6a31 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -626,9 +626,14 @@ function html_recent($first=0, $show_changes='both'){
* decide if this is the last page or is there another one.
* This is the cheapest solution to get this information.
*/
- if (!$show_changes || $show_changes == 'both') $flags = RECENTS_MEDIA_PAGES_MIXED;
- if ($show_changes == 'mediafiles') $flags = RECENTS_MEDIA_CHANGES;
- if ($show_changes == 'pages') $flags = 0;
+ if ($show_changes == 'mediafiles') {
+ $flags = RECENTS_MEDIA_CHANGES;
+ } elseif ($show_changes == 'pages') {
+ $flags = 0;
+ } else {
+ $show_changes = 'both';
+ $flags = RECENTS_MEDIA_PAGES_MIXED;
+ }
$recents = getRecents($first,$conf['recent'] + 1,getNS($ID),$flags);
if(count($recents) == 0 && $first != 0){
@@ -651,29 +656,18 @@ function html_recent($first=0, $show_changes='both'){
$form->addHidden('do', 'recent');
$form->addHidden('id', $ID);
- $form->addElement(form_makeOpenTag('div', array('class' => 'changestypenav')));
- $attrs = array('name' => 'show_changes',
- 'value' => 'pages',
- '_text' => $lang['pages_changes']);
- if ($show_changes == 'pages') $attrs['checked'] = 'checked';
- $form->addElement(form_radiofield($attrs));
- $attrs = array('name' => 'show_changes',
- 'value' => 'mediafiles',
- '_text' => $lang['media_changes']);
- if ($show_changes == 'mediafiles') $attrs['checked'] = 'checked';
- $form->addElement(form_radiofield($attrs));
- $attrs = array('name' => 'show_changes',
- 'value' => 'both',
- '_text' => $lang['both_changes'] );
- if (empty($show_changes) || $show_changes == 'both') $attrs['checked'] = 'checked';
- $form->addElement(form_radiofield($attrs));
- $form->addElement(form_makeTag('input', array(
- 'type' => 'submit',
- 'value' => $lang['btn_apply'],
- 'title' => $lang['btn_apply'],
- 'class' => 'button'
- )));
- $form->addElement(form_makeCloseTag('div'));
+ $form->addElement(form_makeListboxField(
+ 'show_changes',
+ array(
+ 'pages' => $lang['pages_changes'],
+ 'mediafiles' => $lang['media_changes'],
+ 'both' => $lang['both_changes']),
+ $show_changes,
+ $lang['changes_type'],
+ '','',
+ array('class'=>'quickselect')));
+
+ $form->addElement(form_makeButton('submit', 'recent', $lang['btn_apply']));
$form->addElement(form_makeOpenTag('ul'));
@@ -690,7 +684,13 @@ function html_recent($first=0, $show_changes='both'){
$form->addElement($date);
$form->addElement(form_makeCloseTag('span'));
- $form->addElement(form_makeOpenTag('a', array('class' => 'diff_link', 'href' => wl($recent['id'],"do=diff", false, '&'))));
+ if ($recent['media']) {
+ $href = media_managerURL(array('tab_details' => 'history',
+ 'mediado' => 'diff', 'image' => $recent['id']), '&');
+ } else {
+ $href = wl($recent['id'],"do=diff", false, '&');
+ }
+ $form->addElement(form_makeOpenTag('a', array('class' => 'diff_link', 'href' => $href)));
$form->addElement(form_makeTag('img', array(
'src' => DOKU_BASE.'lib/images/diff.png',
'width' => 15,
@@ -700,7 +700,12 @@ function html_recent($first=0, $show_changes='both'){
)));
$form->addElement(form_makeCloseTag('a'));
- $form->addElement(form_makeOpenTag('a', array('class' => 'revisions_link', 'href' => wl($recent['id'],"do=revisions",false,'&'))));
+ if ($recent['media']) {
+ $href = media_managerURL(array('tab_details' => 'history', 'image' => $recent['id']), '&');
+ } else {
+ $href = wl($recent['id'],"do=revisions",false,'&');
+ }
+ $form->addElement(form_makeOpenTag('a', array('class' => 'revisions_link', 'href' => $href)));
$form->addElement(form_makeTag('img', array(
'src' => DOKU_BASE.'lib/images/history.png',
'width' => 12,
@@ -710,8 +715,19 @@ function html_recent($first=0, $show_changes='both'){
)));
$form->addElement(form_makeCloseTag('a'));
- $form->addElement(html_wikilink(':'.$recent['id'],useHeading('navigation')?null:$recent['id']));
+ if ($recent['media']) {
+ // Prepare fileicons
+ list($ext,$mime,$dl) = mimetype($recent['id'],false);
+ $class = preg_replace('/[^_\-a-z0-9]+/i','_',$ext);
+ $class = 'mediafile mf_'.$class;
+ $href = media_managerURL(array('tab_details' => 'view', 'image' => $recent['id']), '&');
+ $form->addElement(form_makeOpenTag('a', array('class' => 'wikilink1 '.$class, 'href' => $href)));
+ $form->addElement($recent['id']);
+ $form->addElement(form_makeCloseTag('a'));
+ } else {
+ $form->addElement(html_wikilink(':'.$recent['id'],useHeading('navigation')?null:$recent['id']));
+ }
$form->addElement(form_makeOpenTag('span', array('class' => 'sum')));
$form->addElement(' – '.htmlspecialchars($recent['sum']));
$form->addElement(form_makeCloseTag('span'));
@@ -744,7 +760,7 @@ function html_recent($first=0, $show_changes='both'){
'value' => $lang['btn_newer'],
'accesskey' => 'n',
'title' => $lang['btn_newer'].' [N]',
- 'class' => 'button'
+ 'class' => 'button not_hide'
)));
$form->addElement(form_makeCloseTag('div'));
}
@@ -756,7 +772,7 @@ function html_recent($first=0, $show_changes='both'){
'value' => $lang['btn_older'],
'accesskey' => 'p',
'title' => $lang['btn_older'].' [P]',
- 'class' => 'button'
+ 'class' => 'button not_hide'
)));
$form->addElement(form_makeCloseTag('div'));
}
diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php
index 93f0f4ce7..b9d4bf2a3 100644
--- a/inc/lang/en/lang.php
+++ b/inc/lang/en/lang.php
@@ -181,9 +181,11 @@ $lang['external_edit'] = 'external edit';
$lang['summary'] = 'Edit summary';
$lang['noflash'] = 'The <a href="http://www.adobe.com/products/flashplayer/">Adobe Flash Plugin</a> is needed to display this content.';
$lang['download'] = 'Download Snippet';
-$lang['pages_changes'] = 'Show pages changes';
-$lang['media_changes'] = 'Show media files changes';
-$lang['both_changes'] = 'Show both';
+
+$lang['changes_type'] = 'View changes of';
+$lang['pages_changes'] = 'Pages';
+$lang['media_changes'] = 'Media files';
+$lang['both_changes'] = 'Both pages and media files';
$lang['mail_newpage'] = 'page added:';
$lang['mail_changed'] = 'page changed:';
diff --git a/lib/scripts/behaviour.js b/lib/scripts/behaviour.js
index dd7676432..24704565a 100644
--- a/lib/scripts/behaviour.js
+++ b/lib/scripts/behaviour.js
@@ -73,7 +73,9 @@ var dw_behaviour = {
quickSelect: function(){
jQuery('select.quickselect')
.change(function(e){ e.target.form.submit(); })
- .parents('form').find('input[type=submit]').hide();
+ .parents('form').find('input[type=submit]').each(function(){
+ if (!jQuery(this).hasClass('not_hide')) jQuery(this).hide();
+ });
},
/**
diff --git a/lib/tpl/default/design.css b/lib/tpl/default/design.css
index 1dee4dc69..a94f814aa 100644
--- a/lib/tpl/default/design.css
+++ b/lib/tpl/default/design.css
@@ -246,18 +246,12 @@ div.dokuwiki div.pagenav-next {
width: 49%
}
-/* ----------- type of recent changes ------------- */
+/* ----------- type of recent changes select -------- */
-div.dokuwiki div.changestypenav {
- border-bottom: 1px solid __border__;
- padding-bottom: 10px;
+div.dokuwiki form#dw__recent select {
margin-bottom: 10px;
}
-div.dokuwiki div.changestypenav label {
- padding-right: 10px;
-}
-
/* --------------- Links ------------------ */
div.dokuwiki a:link,