summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/html.php36
-rw-r--r--inc/template.php3
-rw-r--r--lib/tpl/default/design.css12
3 files changed, 47 insertions, 4 deletions
diff --git a/inc/html.php b/inc/html.php
index 6e187ebe1..e8d6b98a5 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -567,8 +567,9 @@ function html_revisions($first=0){
* @author Andreas Gohr <andi@splitbrain.org>
* @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
* @author Ben Coburn <btcoburn@silicodon.net>
+ * @author Kate Arzamastseva <pshns@ukr.net>
*/
-function html_recent($first=0){
+function html_recent($first=0, $show_changes){
global $conf;
global $lang;
global $ID;
@@ -576,10 +577,14 @@ function html_recent($first=0){
* decide if this is the last page or is there another one.
* This is the cheapest solution to get this information.
*/
- $recents = getRecents($first,$conf['recent'] + 1,getNS($ID));
+ $flags = RECENTS_INCLUDE_MEDIA;
+ if ($show_changes == 'mediafiles') $flags = RECENTS_SKIP_PAGES;
+ if ($show_changes == 'pages') $flags = 0;
+
+ $recents = getRecents($first,$conf['recent'] + 1,getNS($ID),$flags);
if(count($recents) == 0 && $first != 0){
$first=0;
- $recents = getRecents($first,$conf['recent'] + 1,getNS($ID));
+ $recents = getRecents($first,$conf['recent'] + 1,getNS($ID),$flags);
}
$hasNext = false;
if (count($recents)>$conf['recent']) {
@@ -596,6 +601,31 @@ function html_recent($first=0){
$form->addHidden('sectok', null);
$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_makeOpenTag('ul'));
foreach($recents as $recent){
diff --git a/inc/template.php b/inc/template.php
index b9b3951ff..d2d66220c 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?
diff --git a/lib/tpl/default/design.css b/lib/tpl/default/design.css
index 1fdf2bfac..029a5525c 100644
--- a/lib/tpl/default/design.css
+++ b/lib/tpl/default/design.css
@@ -246,6 +246,18 @@ div.dokuwiki div.pagenav-next {
width: 49%
}
+/* ----------- type of recent changes ------------- */
+
+div.dokuwiki div.changestypenav {
+ border-bottom: 1px solid #8CACBB;
+ padding-bottom: 10px;
+ margin-bottom: 10px;
+}
+
+div.dokuwiki div.changestypenav label {
+ padding-right: 10px;
+}
+
/* --------------- Links ------------------ */
div.dokuwiki a:link,