summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorlupo49 <post@lupo49.de>2011-09-11 19:02:50 +0200
committerlupo49 <post@lupo49.de>2011-09-11 19:02:50 +0200
commitded84e755a312cf3c82cd910d35b371b64bec5be (patch)
tree2d3bd07085d8ba68c9d487cc90dae8132bdd5824 /inc
parente2b5ad84f88d0bd1fe510fa74673cc7557c6e630 (diff)
parent8bfdbb5efd72c2e708d005a977444400c7affcfa (diff)
downloadrpg-ded84e755a312cf3c82cd910d35b371b64bec5be.tar.gz
rpg-ded84e755a312cf3c82cd910d35b371b64bec5be.tar.bz2
Merge branch 'master' of github.com:lupo49/dokuwiki
Diffstat (limited to 'inc')
-rw-r--r--inc/actions.php2
-rw-r--r--inc/changelog.php77
-rw-r--r--inc/common.php1
-rw-r--r--inc/config_cascade.php5
-rw-r--r--inc/html.php216
-rw-r--r--inc/infoutils.php4
-rw-r--r--inc/init.php2
-rw-r--r--inc/lang/de-informal/lang.php73
-rw-r--r--inc/lang/de-informal/uploadmail.txt17
-rw-r--r--inc/lang/de/lang.php116
-rw-r--r--inc/lang/de/uploadmail.txt17
-rw-r--r--inc/lang/en/lang.php651
-rw-r--r--inc/lang/en/uploadmail.txt1
-rw-r--r--inc/media.php1202
-rw-r--r--inc/pageutils.php26
-rw-r--r--inc/parser/xhtml.php6
-rw-r--r--inc/plugincontroller.class.php165
-rw-r--r--inc/pluginutils.php6
-rw-r--r--inc/search.php59
-rw-r--r--inc/template.php146
20 files changed, 2163 insertions, 629 deletions
diff --git a/inc/actions.php b/inc/actions.php
index ecf09036f..1a0ae4028 100644
--- a/inc/actions.php
+++ b/inc/actions.php
@@ -227,7 +227,7 @@ function act_clean($act){
'preview','search','show','check','index','revisions',
'diff','recent','backlink','admin','subscribe','revert',
'unsubscribe','profile','resendpwd','recover',
- 'draftdel','subscribens','unsubscribens','sitemap')) && substr($act,0,7) != 'export_' ) {
+ 'draftdel','subscribens','unsubscribens','sitemap','media')) && substr($act,0,7) != 'export_' ) {
msg('Command unknown: '.htmlspecialchars($act),-1);
return 'show';
}
diff --git a/inc/changelog.php b/inc/changelog.php
index 15cd46d77..fea39f9f7 100644
--- a/inc/changelog.php
+++ b/inc/changelog.php
@@ -138,6 +138,7 @@ function addMediaLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='',
// add changelog lines
$logline = implode("\t", $logline)."\n";
io_saveFile($conf['media_changelog'],$logline,true); //global media changelog cache
+ io_saveFile(mediaMetaFN($id,'.changes'),$logline,true); //media file's changelog
}
/**
@@ -151,6 +152,7 @@ function addMediaLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='',
* RECENTS_SKIP_MINORS - don't include minor changes
* RECENTS_SKIP_SUBSPACES - don't include subspaces
* RECENTS_MEDIA_CHANGES - return media changes instead of page changes
+ * RECENTS_MEDIA_PAGES_MIXED - return both media changes and page changes
*
* @param int $first number of first entry returned (for paginating
* @param int $num return $num entries
@@ -158,6 +160,7 @@ function addMediaLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='',
* @param bool $flags see above
*
* @author Ben Coburn <btcoburn@silicodon.net>
+ * @author Kate Arzamastseva <pshns@ukr.net>
*/
function getRecents($first,$num,$ns='',$flags=0){
global $conf;
@@ -173,20 +176,48 @@ function getRecents($first,$num,$ns='',$flags=0){
} else {
$lines = @file($conf['changelog']);
}
+ $lines_position = count($lines)-1;
+
+ if ($flags & RECENTS_MEDIA_PAGES_MIXED) {
+ $media_lines = @file($conf['media_changelog']);
+ $media_lines_position = count($media_lines)-1;
+ }
- // handle lines
$seen = array(); // caches seen lines, _handleRecent() skips them
- for($i = count($lines)-1; $i >= 0; $i--){
- $rec = _handleRecent($lines[$i], $ns, $flags, $seen);
- if($rec !== false) {
- if(--$first >= 0) continue; // skip first entries
- $recent[] = $rec;
- $count++;
- // break when we have enough entries
- if($count >= $num){ break; }
+
+ // handle lines
+ while ($lines_position >= 0 || (($flags & RECENTS_MEDIA_PAGES_MIXED) && $media_lines_position >=0)) {
+ if (empty($rec) && $lines_position >= 0) {
+ $rec = _handleRecent(@$lines[$lines_position], $ns, $flags & ~RECENTS_MEDIA_CHANGES, $seen);
+ if (!$rec) {
+ $lines_position --;
+ continue;
+ }
+ }
+ if (($flags & RECENTS_MEDIA_PAGES_MIXED) && empty($media_rec) && $media_lines_position >= 0) {
+ $media_rec = _handleRecent(@$media_lines[$media_lines_position], $ns, $flags | RECENTS_MEDIA_CHANGES, $seen);
+ if (!$media_rec) {
+ $media_lines_position --;
+ continue;
+ }
}
+ 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--;
+ $x = $rec;
+ if ($flags & RECENTS_MEDIA_CHANGES) $x['media'] = true;
+ $rec = false;
+ }
+ if(--$first >= 0) continue; // skip first entries
+ $recent[] = $x;
+ $count++;
+ // break when we have enough entries
+ if($count >= $num){ break; }
}
-
return $recent;
}
@@ -281,7 +312,11 @@ function _handleRecent($line,$ns,$flags,&$seen){
if (($flags & RECENTS_SKIP_SUBSPACES) && (getNS($recent['id']) != $ns)) return false;
// check ACL
- $recent['perms'] = auth_quickaclcheck($recent['id']);
+ if ($flags & RECENTS_MEDIA_CHANGES) {
+ $recent['perms'] = auth_quickaclcheck(getNS($recent['id']).':*');
+ } else {
+ $recent['perms'] = auth_quickaclcheck($recent['id']);
+ }
if ($recent['perms'] < AUTH_READ) return false;
// check existance
@@ -300,8 +335,9 @@ function _handleRecent($line,$ns,$flags,&$seen){
* requested changelog line is read.
*
* @author Ben Coburn <btcoburn@silicodon.net>
+ * @author Kate Arzamastseva <pshns@ukr.net>
*/
-function getRevisionInfo($id, $rev, $chunk_size=8192) {
+function getRevisionInfo($id, $rev, $chunk_size=8192, $media=false) {
global $cache_revinfo;
$cache =& $cache_revinfo;
if (!isset($cache[$id])) { $cache[$id] = array(); }
@@ -312,7 +348,11 @@ function getRevisionInfo($id, $rev, $chunk_size=8192) {
return $cache[$id][$rev];
}
- $file = metaFN($id, '.changes');
+ if ($media) {
+ $file = mediaMetaFN($id, '.changes');
+ } else {
+ $file = metaFN($id, '.changes');
+ }
if (!@file_exists($file)) { return false; }
if (filesize($file)<$chunk_size || $chunk_size==0) {
// read whole file
@@ -397,8 +437,9 @@ function getRevisionInfo($id, $rev, $chunk_size=8192) {
* lines are recieved.
*
* @author Ben Coburn <btcoburn@silicodon.net>
+ * @author Kate Arzamastseva <pshns@ukr.net>
*/
-function getRevisions($id, $first, $num, $chunk_size=8192) {
+function getRevisions($id, $first, $num, $chunk_size=8192, $media=false) {
global $cache_revinfo;
$cache =& $cache_revinfo;
if (!isset($cache[$id])) { $cache[$id] = array(); }
@@ -406,11 +447,15 @@ function getRevisions($id, $first, $num, $chunk_size=8192) {
$revs = array();
$lines = array();
$count = 0;
- $file = metaFN($id, '.changes');
+ if ($media) {
+ $file = mediaMetaFN($id, '.changes');
+ } else {
+ $file = metaFN($id, '.changes');
+ }
$num = max($num, 0);
$chunk_size = max($chunk_size, 0);
if ($first<0) { $first = 0; }
- else if (@file_exists(wikiFN($id))) {
+ else if (!$media && @file_exists(wikiFN($id)) || $media && @file_exists(mediaFN($id))) {
// skip current revision if the page exists
$first = max($first+1, 0);
}
diff --git a/inc/common.php b/inc/common.php
index 239cfcf99..56a7fb060 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -15,6 +15,7 @@ define('RECENTS_SKIP_DELETED',2);
define('RECENTS_SKIP_MINORS',4);
define('RECENTS_SKIP_SUBSPACES',8);
define('RECENTS_MEDIA_CHANGES',16);
+define('RECENTS_MEDIA_PAGES_MIXED',32);
/**
* Wrapper around htmlspecialchars()
diff --git a/inc/config_cascade.php b/inc/config_cascade.php
index 48ed5a000..c01778e99 100644
--- a/inc/config_cascade.php
+++ b/inc/config_cascade.php
@@ -64,6 +64,11 @@ $config_cascade = array_merge(
'plainauth.users' => array(
'default' => DOKU_CONF.'users.auth.php',
),
+
+ 'plugins' => array(
+ 'local' => array(DOKU_CONF.'plugins.local.php'),
+ 'protected' => array(DOKU_CONF.'plugins.protected.php'),
+ ),
),
$config_cascade
);
diff --git a/inc/html.php b/inc/html.php
index 6e9cce7df..1c48d6059 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -415,20 +415,28 @@ function html_locked(){
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Ben Coburn <btcoburn@silicodon.net>
+ * @author Kate Arzamastseva <pshns@ukr.net>
*/
-function html_revisions($first=0){
+function html_revisions($first=0, $media_id = false){
global $ID;
global $INFO;
global $conf;
global $lang;
+ $id = $ID;
/* we need to get one additionally log entry to be able to
* decide if this is the last page or is there another one.
* see html_recent()
*/
- $revisions = getRevisions($ID, $first, $conf['recent']+1);
+ if (!$media_id) $revisions = getRevisions($ID, $first, $conf['recent']+1);
+ else {
+ $revisions = getRevisions($media_id, $first, $conf['recent']+1, 8192, true);
+ $id = $media_id;
+ }
+
if(count($revisions)==0 && $first!=0){
$first=0;
- $revisions = getRevisions($ID, $first, $conf['recent']+1);;
+ if (!$media_id) $revisions = getRevisions($ID, $first, $conf['recent']+1);
+ else $revisions = getRevisions($media_id, $first, $conf['recent']+1, 8192, true);
}
$hasNext = false;
if (count($revisions)>$conf['recent']) {
@@ -436,14 +444,22 @@ function html_revisions($first=0){
array_pop($revisions); // remove extra log entry
}
- $date = dformat($INFO['lastmod']);
+ if (!$media_id) $date = dformat($INFO['lastmod']);
+ else $date = dformat(@filemtime(mediaFN($id)));
+
+ if (!$media_id) print p_locale_xhtml('revisions');
- print p_locale_xhtml('revisions');
+ $params = array('id' => 'page__revisions');
+ if ($media_id) $params['action'] = media_managerURL(array('image' => $media_id), '&');
- $form = new Doku_Form(array('id' => 'page__revisions'));
+ $form = new Doku_Form($params);
$form->addElement(form_makeOpenTag('ul'));
- if($INFO['exists'] && $first==0){
- if (isset($INFO['meta']) && isset($INFO['meta']['last_change']) && $INFO['meta']['last_change']['type']===DOKU_CHANGE_TYPE_MINOR_EDIT)
+
+ if (!$media_id) $exists = $INFO['exists'];
+ else $exists = @file_exists(mediaFN($id));
+
+ if($exists && $first==0){
+ if (!$media_id && isset($INFO['meta']) && isset($INFO['meta']['last_change']) && $INFO['meta']['last_change']['type']===DOKU_CHANGE_TYPE_MINOR_EDIT)
$form->addElement(form_makeOpenTag('li', array('class' => 'minor')));
else
$form->addElement(form_makeOpenTag('li'));
@@ -459,30 +475,53 @@ function html_revisions($first=0){
$form->addElement('<img src="'.DOKU_BASE.'lib/images/blank.gif" width="15" height="11" alt="" />');
+ if (!$media_id) $href = wl($id);
+ else $href = media_managerURL(array('image' => $id, 'tab_details' => 'view'), '&');
$form->addElement(form_makeOpenTag('a', array(
'class' => 'wikilink1',
- 'href' => wl($ID))));
- $form->addElement($ID);
+ 'href' => $href)));
+ $form->addElement($id);
$form->addElement(form_makeCloseTag('a'));
- $form->addElement(form_makeOpenTag('span', array('class' => 'sum')));
- $form->addElement(' &ndash; ');
- $form->addElement(htmlspecialchars($INFO['sum']));
- $form->addElement(form_makeCloseTag('span'));
+ if ($media_id) $form->addElement(form_makeOpenTag('div'));
+
+ if (!$media_id) {
+ $form->addElement(form_makeOpenTag('span', array('class' => 'sum')));
+ $form->addElement(' &ndash; ');
+ $form->addElement(htmlspecialchars($INFO['sum']));
+ $form->addElement(form_makeCloseTag('span'));
+ }
$form->addElement(form_makeOpenTag('span', array('class' => 'user')));
- $form->addElement((empty($INFO['editor']))?('('.$lang['external_edit'].')'):editorinfo($INFO['editor']));
+ if (!$media_id) $editor = $INFO['editor'];
+ else {
+ $revinfo = getRevisionInfo($id, @filemtime(fullpath(mediaFN($id))), 1024, true);
+ if($revinfo['user']){
+ $editor = $revinfo['user'];
+ }else{
+ $editor = $revinfo['ip'];
+ }
+ }
+ $form->addElement((empty($editor))?('('.$lang['external_edit'].')'):editorinfo($editor));
$form->addElement(form_makeCloseTag('span'));
$form->addElement('('.$lang['current'].')');
+
+ if ($media_id) $form->addElement(form_makeCloseTag('div'));
+
$form->addElement(form_makeCloseTag('div'));
$form->addElement(form_makeCloseTag('li'));
}
foreach($revisions as $rev){
- $date = dformat($rev);
- $info = getRevisionInfo($ID,$rev,true);
- $exists = page_exists($ID,$rev);
+ $date = dformat($rev);
+ if (!$media_id) {
+ $info = getRevisionInfo($id,$rev,true);
+ $exists = page_exists($id,$rev);
+ } else {
+ $info = getRevisionInfo($id,$rev,true,true);
+ $exists = @file_exists(mediaFN($id,$rev));
+ }
if ($info['type']===DOKU_CHANGE_TYPE_MINOR_EDIT)
$form->addElement(form_makeOpenTag('li', array('class' => 'minor')));
@@ -503,7 +542,9 @@ function html_revisions($first=0){
$form->addElement(form_makeCloseTag('span'));
if($exists){
- $form->addElement(form_makeOpenTag('a', array('href' => wl($ID,"rev=$rev,do=diff", false, '&'), 'class' => 'diff_link')));
+ if (!$media_id) $href = wl($id,"rev=$rev,do=diff", false, '&');
+ else $href = media_managerURL(array('image' => $id, 'rev' => $rev, 'mediado' => 'diff'), '&');
+ $form->addElement(form_makeOpenTag('a', array('href' => $href, 'class' => 'diff_link')));
$form->addElement(form_makeTag('img', array(
'src' => DOKU_BASE.'lib/images/diff.png',
'width' => 15,
@@ -511,19 +552,24 @@ function html_revisions($first=0){
'title' => $lang['diff'],
'alt' => $lang['diff'])));
$form->addElement(form_makeCloseTag('a'));
-
- $form->addElement(form_makeOpenTag('a', array('href' => wl($ID,"rev=$rev",false,'&'), 'class' => 'wikilink1')));
- $form->addElement($ID);
+ if (!$media_id) $href = wl($id,"rev=$rev",false,'&');
+ else $href = media_managerURL(array('image' => $id, 'tab_details' => 'view', 'rev' => $rev), '&');
+ $form->addElement(form_makeOpenTag('a', array('href' => $href, 'class' => 'wikilink1')));
+ $form->addElement($id);
$form->addElement(form_makeCloseTag('a'));
}else{
$form->addElement('<img src="'.DOKU_BASE.'lib/images/blank.gif" width="15" height="11" alt="" />');
- $form->addElement($ID);
+ $form->addElement($id);
}
- $form->addElement(form_makeOpenTag('span', array('class' => 'sum')));
- $form->addElement(' &ndash; ');
- $form->addElement(htmlspecialchars($info['sum']));
- $form->addElement(form_makeCloseTag('span'));
+ if ($media_id) $form->addElement(form_makeOpenTag('div'));
+
+ if ($info['sum']) {
+ $form->addElement(form_makeOpenTag('span', array('class' => 'sum')));
+ if (!$media_id) $form->addElement(' &ndash; ');
+ $form->addElement(htmlspecialchars($info['sum']));
+ $form->addElement(form_makeCloseTag('span'));
+ }
$form->addElement(form_makeOpenTag('span', array('class' => 'user')));
if($info['user']){
@@ -536,11 +582,18 @@ function html_revisions($first=0){
}
$form->addElement(form_makeCloseTag('span'));
+ if ($media_id) $form->addElement(form_makeCloseTag('div'));
+
$form->addElement(form_makeCloseTag('div'));
$form->addElement(form_makeCloseTag('li'));
}
$form->addElement(form_makeCloseTag('ul'));
- $form->addElement(form_makeButton('submit', 'diff', $lang['diff2']));
+ if (!$media_id) {
+ $form->addElement(form_makeButton('submit', 'diff', $lang['diff2']));
+ } else {
+ $form->addHidden('mediado', 'diff');
+ $form->addElement(form_makeButton('submit', '', $lang['diff2']));
+ }
html_form('revisions', $form);
print '<div class="pagenav">';
@@ -549,12 +602,20 @@ function html_revisions($first=0){
$first -= $conf['recent'];
if ($first < 0) $first = 0;
print '<div class="pagenav-prev">';
- print html_btn('newer',$ID,"p",array('do' => 'revisions', 'first' => $first));
+ if ($media_id) {
+ print html_btn('newer',$media_id,"p",media_managerURL(array('first' => $first), '&amp;', false, true));
+ } else {
+ print html_btn('newer',$id,"p",array('do' => 'revisions', 'first' => $first));
+ }
print '</div>';
}
if ($hasNext) {
print '<div class="pagenav-next">';
- print html_btn('older',$ID,"n",array('do' => 'revisions', 'first' => $last));
+ if ($media_id) {
+ print html_btn('older',$media_id,"n",media_managerURL(array('first' => $last), '&amp;', false, true));
+ } else {
+ print html_btn('older',$id,"n",array('do' => 'revisions', 'first' => $last));
+ }
print '</div>';
}
print '</div>';
@@ -567,8 +628,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='both'){
global $conf;
global $lang;
global $ID;
@@ -576,10 +638,20 @@ 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 = 0;
+ if ($show_changes == 'mediafiles' && $conf['mediarevisions']) {
+ $flags = RECENTS_MEDIA_CHANGES;
+ } elseif ($show_changes == 'pages') {
+ $flags = 0;
+ } elseif ($conf['mediarevisions']) {
+ $show_changes = 'both';
+ $flags = RECENTS_MEDIA_PAGES_MIXED;
+ }
+
+ $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 +668,22 @@ function html_recent($first=0){
$form->addHidden('sectok', null);
$form->addHidden('do', 'recent');
$form->addHidden('id', $ID);
+
+ if ($conf['mediarevisions']) {
+ $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'));
foreach($recents as $recent){
@@ -607,21 +695,48 @@ function html_recent($first=0){
$form->addElement(form_makeOpenTag('div', array('class' => 'li')));
+ if ($recent['media']) {
+ $form->addElement(media_printicon($recent['id']));
+ } else {
+ $icon = DOKU_BASE.'lib/images/fileicons/file.png';
+ $form->addElement('<img src="'.$icon.'" alt="'.$filename.'" class="icon" />');
+ }
+
$form->addElement(form_makeOpenTag('span', array('class' => 'date')));
$form->addElement($date);
$form->addElement(form_makeCloseTag('span'));
- $form->addElement(form_makeOpenTag('a', array('class' => 'diff_link', 'href' => wl($recent['id'],"do=diff", false, '&'))));
- $form->addElement(form_makeTag('img', array(
- 'src' => DOKU_BASE.'lib/images/diff.png',
- 'width' => 15,
- 'height'=> 11,
- 'title' => $lang['diff'],
- 'alt' => $lang['diff']
- )));
- $form->addElement(form_makeCloseTag('a'));
+ if ($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'])), '&');
+ }
+ } else {
+ $href = wl($recent['id'],"do=diff", false, '&');
+ }
- $form->addElement(form_makeOpenTag('a', array('class' => 'revisions_link', 'href' => wl($recent['id'],"do=revisions",false,'&'))));
+ if ($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)));
+ $form->addElement(form_makeTag('img', array(
+ 'src' => DOKU_BASE.'lib/images/diff.png',
+ 'width' => 15,
+ 'height'=> 11,
+ 'title' => $lang['diff'],
+ 'alt' => $lang['diff']
+ )));
+ $form->addElement(form_makeCloseTag('a'));
+ }
+
+ if ($recent['media']) {
+ $href = media_managerURL(array('tab_details' => 'history',
+ 'image' => $recent['id'], 'ns' => getNS($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,
@@ -631,8 +746,15 @@ function html_recent($first=0){
)));
$form->addElement(form_makeCloseTag('a'));
- $form->addElement(html_wikilink(':'.$recent['id'],useHeading('navigation')?null:$recent['id']));
-
+ if ($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)));
+ $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(' &ndash; '.htmlspecialchars($recent['sum']));
$form->addElement(form_makeCloseTag('span'));
@@ -665,7 +787,7 @@ function html_recent($first=0){
'value' => $lang['btn_newer'],
'accesskey' => 'n',
'title' => $lang['btn_newer'].' [N]',
- 'class' => 'button'
+ 'class' => 'button show'
)));
$form->addElement(form_makeCloseTag('div'));
}
@@ -677,7 +799,7 @@ function html_recent($first=0){
'value' => $lang['btn_older'],
'accesskey' => 'p',
'title' => $lang['btn_older'].' [P]',
- 'class' => 'button'
+ 'class' => 'button show'
)));
$form->addElement(form_makeCloseTag('div'));
}
diff --git a/inc/infoutils.php b/inc/infoutils.php
index 786661d01..f1deec66b 100644
--- a/inc/infoutils.php
+++ b/inc/infoutils.php
@@ -66,8 +66,8 @@ function getVersionData(){
$chunk = fread($fh,2000);
fclose($fh);
$chunk = trim($chunk);
- $chunk = array_pop(explode("\n",$chunk)); //last log line
- $chunk = array_shift(explode("\t",$chunk)); //strip commit msg
+ $chunk = @array_pop(explode("\n",$chunk)); //last log line
+ $chunk = @array_shift(explode("\t",$chunk)); //strip commit msg
$chunk = explode(" ",$chunk);
array_pop($chunk); //strip timezone
$date = date('Y-m-d',array_pop($chunk));
diff --git a/inc/init.php b/inc/init.php
index dfa25f8b1..b3acf2e33 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -231,7 +231,9 @@ function init_paths(){
$paths = array('datadir' => 'pages',
'olddir' => 'attic',
'mediadir' => 'media',
+ 'mediaolddir' => 'media_attic',
'metadir' => 'meta',
+ 'mediametadir' => 'media_meta',
'cachedir' => 'cache',
'indexdir' => 'index',
'lockdir' => 'locks',
diff --git a/inc/lang/de-informal/lang.php b/inc/lang/de-informal/lang.php
index 16686bc4c..4f762b55d 100644
--- a/inc/lang/de-informal/lang.php
+++ b/inc/lang/de-informal/lang.php
@@ -16,9 +16,10 @@
* @author Alexander Fischer <tbanus@os-forge.net>
* @author Juergen Schwarzer <jschwarzer@freenet.de>
* @author Marcel Metz <marcel_metz@gmx.de>
- * @author Matthias Schulte <post@lupo49.de>
+ * @author Matthias Schulte <mailinglist@lupo49.de>
* @author Christian Wichmann <nospam@zone0.de>
*/
+
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
$lang['doublequoteopening'] = '„';
@@ -26,6 +27,7 @@ $lang['doublequoteclosing'] = '“';
$lang['singlequoteopening'] = '‚';
$lang['singlequoteclosing'] = '‘';
$lang['apostrophe'] = '’';
+
$lang['btn_edit'] = 'Diese Seite bearbeiten';
$lang['btn_source'] = 'Zeige Quelltext';
$lang['btn_show'] = 'Seite anzeigen';
@@ -59,6 +61,9 @@ $lang['btn_recover'] = 'Entwurf wiederherstellen';
$lang['btn_draftdel'] = 'Entwurf löschen';
$lang['btn_revert'] = 'Wiederherstellen';
$lang['btn_register'] = 'Registrieren';
+$lang['btn_apply'] = 'Übernehmen';
+$lang['btn_media'] = 'Medien-Manager';
+
$lang['loggedinas'] = 'Angemeldet als';
$lang['user'] = 'Benutzername';
$lang['pass'] = 'Passwort';
@@ -73,6 +78,7 @@ $lang['badlogin'] = 'Nutzername oder Passwort sind falsch.';
$lang['minoredit'] = 'kleine Änderung';
$lang['draftdate'] = 'Entwurf gespeichert am';
$lang['nosecedit'] = 'Diese Seite wurde in der Zwischenzeit geändert, da das Sektionsinfo veraltet ist. Die ganze Seite wird stattdessen geladen.';
+
$lang['regmissing'] = 'Alle Felder müssen ausgefüllt werden';
$lang['reguexists'] = 'Der Nutzername existiert leider schon.';
$lang['regsuccess'] = 'Der neue Nutzer wurde angelegt und das Passwort per E-Mail versandt.';
@@ -82,10 +88,12 @@ $lang['regbadmail'] = 'Die angegebene Mail-Adresse scheint ungültig
$lang['regbadpass'] = 'Die beiden eingegeben Passwörter stimmen nicht überein. Bitte versuche es noch einmal.';
$lang['regpwmail'] = 'Ihr DokuWiki Passwort';
$lang['reghere'] = 'Du hast noch keinen Zugang? Hier registrieren';
+
$lang['profna'] = 'Änderung des Benutzerprofils in diesem Wiki nicht möglich.';
$lang['profnochange'] = 'Keine Änderungen, nichts zu tun.';
$lang['profnoempty'] = 'Es muss ein Name oder eine E-Mail Adresse angegeben werden.';
$lang['profchanged'] = 'Benutzerprofil erfolgreich geändert.';
+
$lang['pwdforget'] = 'Passwort vergessen? Fordere ein neues an';
$lang['resendna'] = 'Passwörter versenden ist in diesem Wiki nicht möglich.';
$lang['resendpwd'] = 'Neues Passwort senden für';
@@ -94,8 +102,10 @@ $lang['resendpwdnouser'] = 'Es tut mir Leid, aber der Benutzer existiert n
$lang['resendpwdbadauth'] = 'Es tut mir Leid, aber dieser Authentifizierungscode ist ungültig. Stelle sicher, dass du den kompletten Bestätigungslink verwendet haben.';
$lang['resendpwdconfirm'] = 'Ein Bestätigungslink wurde per E-Mail versandt.';
$lang['resendpwdsuccess'] = 'Dein neues Passwort wurde per E-Mail versandt.';
+
$lang['license'] = 'Falls nicht anders bezeichnet, ist der Inhalt dieses Wikis unter der folgenden Lizenz veröffentlicht:';
$lang['licenseok'] = 'Hinweis: Durch das Bearbeiten dieser Seite gibst du dein Einverständnis, dass dein Inhalt unter der folgenden Lizenz veröffentlicht wird:';
+
$lang['searchmedia'] = 'Suche nach Datei:';
$lang['searchmedia_in'] = 'Suche in %s';
$lang['txt_upload'] = 'Datei zum Hochladen auswählen';
@@ -103,6 +113,7 @@ $lang['txt_filename'] = 'Hochladen als (optional)';
$lang['txt_overwrt'] = 'Bestehende Datei überschreiben';
$lang['lockedby'] = 'Momentan gesperrt von';
$lang['lockexpire'] = 'Sperre läuft ab am';
+
$lang['js']['willexpire'] = 'Die Sperre zur Bearbeitung dieser Seite läuft in einer Minute ab.\nUm Bearbeitungskonflikte zu vermeiden, solltest du sie durch einen Klick auf den Vorschau-Knopf verlängern.';
$lang['js']['notsavedyet'] = 'Nicht gespeicherte Änderungen gehen verloren!';
$lang['js']['searchmedia'] = 'Suche nach Dateien';
@@ -134,8 +145,21 @@ $lang['js']['linkwiz'] = 'Link-Assistent';
$lang['js']['linkto'] = 'Link zu:';
$lang['js']['del_confirm'] = 'Die ausgewählten Dateien wirklich löschen?';
$lang['js']['mu_btn'] = 'Mehrere Dateien gleichzeitig hochladen';
+$lang['js']['restore_confirm'] = 'Really restore this version?';
+$lang['js']['media_diff'] = 'Unterschiede anzeigen:';
+$lang['js']['media_diff_both'] = 'Side by Side';
+$lang['js']['media_diff_opacity'] = 'Überblenden';
+$lang['js']['media_diff_portions'] = 'Übergang';
+$lang['js']['media_select'] = 'Dateien auswählen…';
+$lang['js']['media_upload_btn'] = 'Hochladen';
+$lang['js']['media_done_btn'] = 'Fertig';
+$lang['js']['media_drop'] = 'Dateien hier draufziehen um sie hochzuladen';
+$lang['js']['media_cancel'] = 'Entfernen';
+$lang['js']['media_overwrt'] = 'Existierende Dateien überschreiben';
+
$lang['rssfailed'] = 'Es ist ein Fehler beim Laden des Feeds aufgetreten: ';
$lang['nothingfound'] = 'Nichts gefunden.';
+
$lang['mediaselect'] = 'Dateiauswahl';
$lang['fileupload'] = 'Datei hochladen';
$lang['uploadsucc'] = 'Datei wurde erfolgreich hochgeladen';
@@ -160,6 +184,7 @@ $lang['mediaextchange'] = 'Dateiendung vom .%s nach .%s geändert!';
$lang['reference'] = 'Verwendung von';
$lang['ref_inuse'] = 'Diese Datei kann nicht gelöscht werden, da sie noch von folgenden Seiten benutzt wird:';
$lang['ref_hidden'] = 'Einige Verweise sind auf Seiten, für die du keine Leseberechtigung hast.';
+
$lang['hits'] = 'Treffer';
$lang['quickhits'] = 'Passende Seitennamen';
$lang['toc'] = 'Inhaltsverzeichnis';
@@ -183,11 +208,18 @@ $lang['external_edit'] = 'Externe Bearbeitung';
$lang['summary'] = 'Zusammenfassung';
$lang['noflash'] = 'Das <a href="http://www.adobe.com/products/flashplayer/">Adobe Flash Plugin</a> wird benötigt, um diesen Inhalt anzuzeigen.';
$lang['download'] = 'Download-Teil';
+
$lang['mail_newpage'] = 'Neue Seite:';
$lang['mail_changed'] = 'Seite geändert:';
$lang['mail_subscribe_list'] = 'Seite hat sich im Namespace geändert:';
$lang['mail_new_user'] = 'Neuer Benutzer:';
$lang['mail_upload'] = 'Datei hochgeladen:';
+
+$lang['changes_type'] = 'Änderungen anzeigen von';
+$lang['pages_changes'] = 'Seiten';
+$lang['media_changes'] = 'Mediendateien';
+$lang['both_changes'] = 'Beides, Seiten- und Mediendateien';
+
$lang['qb_bold'] = 'Fetter Text';
$lang['qb_italic'] = 'Kursiver Text';
$lang['qb_underl'] = 'Unterstrichener Text';
@@ -212,8 +244,11 @@ $lang['qb_media'] = 'Bilder und andere Dateien hinzufügen';
$lang['qb_sig'] = 'Unterschrift einfügen';
$lang['qb_smileys'] = 'Smileys';
$lang['qb_chars'] = 'Sonderzeichen';
+
$lang['upperns'] = 'Gehe zum übergeordneten Namensraum';
+
$lang['admin_register'] = 'Neuen Benutzer anmelden';
+
$lang['metaedit'] = 'Metadaten bearbeiten';
$lang['metasaveerr'] = 'Die Metadaten konnten nicht gesichert werden';
$lang['metasaveok'] = 'Metadaten gesichert';
@@ -228,6 +263,10 @@ $lang['img_copyr'] = 'Copyright';
$lang['img_format'] = 'Format';
$lang['img_camera'] = 'Kamera';
$lang['img_keywords'] = 'Schlagwörter';
+$lang['img_width'] = 'Breite';
+$lang['img_height'] = 'Höhe';
+$lang['img_manager'] = 'Im Medien-Manager anzeigen';
+
$lang['subscr_subscribe_success'] = 'Die Seite %s wurde zur Abonnementenliste von %s hinzugefügt';
$lang['subscr_subscribe_error'] = 'Fehler beim Hinzufügen von %s zur Abonnementenliste von %s';
$lang['subscr_subscribe_noaddress'] = 'In deinem Account ist keine E-Mail-Adresse hinterlegt. Dadurch kann die Seite nicht abonniert werden';
@@ -235,6 +274,7 @@ $lang['subscr_unsubscribe_success'] = 'Die Seite %s wurde von der Abonnementenli
$lang['subscr_unsubscribe_error'] = 'Fehler beim Entfernen von %s von der Abonnementenliste von %s';
$lang['subscr_already_subscribed'] = '%s ist bereits auf der Abonnementenliste von %s';
$lang['subscr_not_subscribed'] = '%s ist nicht auf der Abonnementenliste von %s';
+// Manage page for subscriptions
$lang['subscr_m_not_subscribed'] = 'Du hast kein Abonnement von dieser Seite oder dem Namensraum.';
$lang['subscr_m_new_header'] = 'Abonnementen hinzufügen';
$lang['subscr_m_current_header'] = 'Aktive Abonnements';
@@ -244,8 +284,12 @@ $lang['subscr_m_receive'] = 'Erhalten';
$lang['subscr_style_every'] = 'E-Mail bei jeder Änderung';
$lang['subscr_style_digest'] = 'E-Mail mit zusammengefasster Übersicht der Seitenänderungen (alle %.2f Tage)';
$lang['subscr_style_list'] = 'Auflistung aller geänderten Seiten seit der letzten E-Mail (alle %.2f Tage)';
+
+/* auth.class language support */
$lang['authmodfailed'] = 'Benutzerüberprüfung nicht möglich. Bitte wende dich an den Admin.';
$lang['authtempfail'] = 'Benutzerüberprüfung momentan nicht möglich. Falls das Problem andauert, wende dich an den Admin.';
+
+/* installer strings */
$lang['i_chooselang'] = 'Wähle deine Sprache';
$lang['i_installer'] = 'DokuWiki-Installation';
$lang['i_wikiname'] = 'Wiki-Name';
@@ -268,6 +312,7 @@ $lang['i_pol1'] = 'Öffentliches Wiki (lesen für alle, schreiben
$lang['i_pol2'] = 'Geschlossenes Wiki (lesen, schreiben, hochladen nur für registrierte Nutzer)';
$lang['i_retry'] = 'Wiederholen';
$lang['i_license'] = 'Bitte wähle die Lizenz aus unter der die Wiki-Inhalte veröffentlicht werden sollen:';
+
$lang['mu_intro'] = 'In diesem Bereich kannst du mehrere Dateien gleichzeitig hochladen. Benutze die Schaltfläche "Durchsuchen", um sie der Warteschlange zuzufügen. Betätige die Schaltfläche "Hochladen", um die Übertragung zu starten.';
$lang['mu_gridname'] = 'Dateiname';
$lang['mu_gridsize'] = 'Größe';
@@ -283,6 +328,7 @@ $lang['mu_progress'] = '@PCT@% hochgeladen';
$lang['mu_filetypes'] = 'Erlaubte Dateitypen';
$lang['mu_info'] = 'Dateien hochgeladen.';
$lang['mu_lasterr'] = 'Letzter Fehler:';
+
$lang['recent_global'] = 'Im Moment siehst du die Änderungen im Namensraum <b>%s</b>. Du kannst auch <a href="%s">die Änderungen im gesamten Wiki sehen</a>.';
$lang['years'] = 'vor %d Jahren';
$lang['months'] = 'vor %d Monaten';
@@ -291,4 +337,29 @@ $lang['days'] = 'vor %d Tagen';
$lang['hours'] = 'vor %d Stunden';
$lang['minutes'] = 'vor %d Minuten';
$lang['seconds'] = 'vor %d Sekunden';
+
$lang['wordblock'] = 'Deine Bearbeitung wurde nicht gespeichert, da sie gesperrten Text enthielt (Spam).';
+
+$lang['media_uploadtab'] = 'Hochladen';
+$lang['media_searchtab'] = 'Suchen';
+$lang['media_viewtab'] = 'Anzeigen';
+$lang['media_edittab'] = 'Bearbeiten';
+$lang['media_historytab'] = 'Verlauf';
+$lang['media_thumbsview'] = 'Miniaturansicht';
+$lang['media_listview'] = 'Detailansicht';
+$lang['media_sort'] = 'Sortieren';
+$lang['media_sort_name'] = 'nach Name';
+$lang['media_sort_date'] = 'nach Datum';
+$lang['media_upload'] = 'In den <strong>%s</strong> Namespace hochladen.';
+$lang['media_search'] = 'Im Namespace <strong>%s</strong> suchen.';
+$lang['media_edit'] = 'Bearbeiten';
+$lang['media_history'] = 'Versionsverlauf der Datei.';
+$lang['media_meta_edited'] = 'Meta-Informationen bearbeitet';
+$lang['media_perm_read'] = 'Du besitzt nicht die notwendigen Berechtigungen um die Datei anzuzeigen.';
+$lang['media_perm_upload'] = 'Du besitzt nicht die notwendigen Berechtigungen um Dateien hochzuladen.';
+$lang['media_update'] = 'Neue Version hochladen';
+$lang['media_restore'] = 'Diese Version wiederherstellen';
+
+$lang['plugin_install_err'] = "Plugin nicht korrekt installiert. Plugin-Verzeichnis von '%s' nach '%s' umbenennen.";
+
+//Setup VIM: ex: et ts=2 : \ No newline at end of file
diff --git a/inc/lang/de-informal/uploadmail.txt b/inc/lang/de-informal/uploadmail.txt
index 7239cc10c..69f11400f 100644
--- a/inc/lang/de-informal/uploadmail.txt
+++ b/inc/lang/de-informal/uploadmail.txt
@@ -1,13 +1,14 @@
Eine Datei wurde in deinem Wiki hochgeladen. Hier sind die Details:
-Datei : @MEDIA@
-Datum : @DATE@
-Browser : @BROWSER@
-IP-Adresse : @IPADDRESS@
-Hostname : @HOSTNAME@
-Größe : @SIZE@
-MIME-Typ : @MIME@
-Benutzer : @USER@
+Datei : @MEDIA@
+Alte Version: @OLD@
+Datum : @DATE@
+Browser : @BROWSER@
+IP-Adresse : @IPADDRESS@
+Hostname : @HOSTNAME@
+Größe : @SIZE@
+MIME-Typ : @MIME@
+Benutzer : @USER@
--
Diese Mail wurde vom DokuWiki auf
diff --git a/inc/lang/de/lang.php b/inc/lang/de/lang.php
index 3ae06dc71..a289f9987 100644
--- a/inc/lang/de/lang.php
+++ b/inc/lang/de/lang.php
@@ -18,14 +18,16 @@
* @author Robert Bogenschneider <robog@gmx.de>
* @author Niels Lange <niels@boldencursief.nl>
* @author Christian Wichmann <nospam@zone0.de>
+ * @author Matthias Schulte <mailinglist@lupo49.de>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
-$lang['doublequoteopening'] = '„';
-$lang['doublequoteclosing'] = '“';
-$lang['singlequoteopening'] = '‚';
-$lang['singlequoteclosing'] = '‘';
-$lang['apostrophe'] = '’';
+$lang['doublequoteopening'] = '„'; //&ldquo;
+$lang['doublequoteclosing'] = '“'; //&rdquo;
+$lang['singlequoteopening'] = '‚'; //&lsquo;
+$lang['singlequoteclosing'] = '‘'; //&rsquo;
+$lang['apostrophe'] = '’'; //&rsquo;
+
$lang['btn_edit'] = 'Diese Seite bearbeiten';
$lang['btn_source'] = 'Zeige Quelltext';
$lang['btn_show'] = 'Seite anzeigen';
@@ -59,6 +61,9 @@ $lang['btn_recover'] = 'Entwurf wiederherstellen';
$lang['btn_draftdel'] = 'Entwurf löschen';
$lang['btn_revert'] = 'Wiederherstellen';
$lang['btn_register'] = 'Registrieren';
+$lang['btn_apply'] = 'Übernehmen';
+$lang['btn_media'] = 'Medien-Manager';
+
$lang['loggedinas'] = 'Angemeldet als';
$lang['user'] = 'Benutzername';
$lang['pass'] = 'Passwort';
@@ -71,8 +76,9 @@ $lang['email'] = 'E-Mail';
$lang['profile'] = 'Benutzerprofil';
$lang['badlogin'] = 'Nutzername oder Passwort sind falsch.';
$lang['minoredit'] = 'kleine Änderung';
-$lang['draftdate'] = 'Entwurf gespeichert am';
+$lang['draftdate'] = 'Entwurf gespeichert am'; // full dformat date will be added
$lang['nosecedit'] = 'Diese Seite wurde in der Zwischenzeit geändert, Sektionsinfo ist veraltet, lade stattdessen volle Seite.';
+
$lang['regmissing'] = 'Alle Felder müssen ausgefüllt werden.';
$lang['reguexists'] = 'Der Nutzername existiert leider schon.';
$lang['regsuccess'] = 'Der neue Nutzer wurde angelegt und das Passwort per E-Mail versandt.';
@@ -82,10 +88,12 @@ $lang['regbadmail'] = 'Die angegebene E-Mail-Adresse scheint ungülti
$lang['regbadpass'] = 'Die beiden eingegeben Passwörter stimmen nicht überein. Bitte versuchen Sie es noch einmal.';
$lang['regpwmail'] = 'Ihr DokuWiki Passwort';
$lang['reghere'] = 'Sie haben noch keinen Zugang? Hier registrieren';
+
$lang['profna'] = 'Änderung des Benutzerprofils in diesem Wiki nicht möglich.';
$lang['profnochange'] = 'Keine Änderungen, nichts zu tun.';
$lang['profnoempty'] = 'Es muss ein Name und eine E-Mail-Adresse angegeben werden.';
$lang['profchanged'] = 'Benutzerprofil erfolgreich geändert.';
+
$lang['pwdforget'] = 'Passwort vergessen? Fordere ein neues an';
$lang['resendna'] = 'Passwörter versenden ist in diesem Wiki nicht möglich.';
$lang['resendpwd'] = 'Neues Passwort senden für';
@@ -94,8 +102,10 @@ $lang['resendpwdnouser'] = 'Es tut mir Leid, aber der Benutzer existiert n
$lang['resendpwdbadauth'] = 'Es tut mir Leid, aber dieser Authentifizierungscode ist ungültig. Stellen Sie sicher, dass Sie den kompletten Bestätigungslink verwendet haben.';
$lang['resendpwdconfirm'] = 'Ein Bestätigungslink wurde per E-Mail versandt.';
$lang['resendpwdsuccess'] = 'Ihr neues Passwort wurde per E-Mail versandt.';
+
$lang['license'] = 'Falls nicht anders bezeichnet, ist der Inhalt dieses Wikis unter der folgenden Lizenz veröffentlicht:';
$lang['licenseok'] = 'Hinweis: Durch das Bearbeiten dieser Seite geben Sie Ihr Einverständnis, dass Ihr Inhalt unter der folgenden Lizenz veröffentlicht wird:';
+
$lang['searchmedia'] = 'Suche Dateinamen:';
$lang['searchmedia_in'] = 'Suche in %s';
$lang['txt_upload'] = 'Datei zum Hochladen auswählen';
@@ -103,7 +113,8 @@ $lang['txt_filename'] = 'Hochladen als (optional)';
$lang['txt_overwrt'] = 'Bestehende Datei überschreiben';
$lang['lockedby'] = 'Momentan gesperrt von';
$lang['lockexpire'] = 'Sperre läuft ab am';
-$lang['js']['willexpire'] = 'Die Sperre zur Bearbeitung dieser Seite läuft in einer Minute ab.\nUm Bearbeitungskonflikte zu vermeiden, sollten Sie sie durch einen Klick auf den Vorschau-Knopf verlängern.';
+
+$lang['js']['willexpire'] = 'Die Sperre zur Bearbeitung dieser Seite läuft in einer Minute ab.\nUm Bearbeitungskonflikte zu vermeiden, sollten Sie sie durch einen Klick auf den Vorschau-Knopf verlängern.';
$lang['js']['notsavedyet'] = 'Nicht gespeicherte Änderungen gehen verloren!';
$lang['js']['searchmedia'] = 'Suche Dateien';
$lang['js']['keepopen'] = 'Fenster nach Auswahl nicht schließen';
@@ -129,14 +140,26 @@ $lang['js']['medialeft'] = 'Das Bild links anordnen.';
$lang['js']['mediaright'] = 'Das Bild rechts anordnen.';
$lang['js']['mediacenter'] = 'Das Bild in der Mitte anordnen.';
$lang['js']['medianoalign'] = 'Keine Anordnung benutzen.';
-$lang['js']['nosmblinks'] = 'Das Verlinken von Windows-Freigaben funktioniert nur im Microsoft Internet Explorer.
-Der Link kann jedoch durch Kopieren und Einfügen verwendet werden.';
+$lang['js']['nosmblinks'] = 'Das Verlinken von Windows-Freigaben funktioniert nur im Microsoft Internet Explorer.\nDer Link kann jedoch durch Kopieren und Einfügen verwendet werden.';
$lang['js']['linkwiz'] = 'Link-Assistent';
$lang['js']['linkto'] = 'Link nach:';
$lang['js']['del_confirm'] = 'Eintrag wirklich löschen?';
$lang['js']['mu_btn'] = 'Mehrere Dateien gleichzeitig hochladen';
+$lang['js']['restore_confirm'] = 'Really restore this version?';
+$lang['js']['media_diff'] = 'Unterschiede anzeigen:';
+$lang['js']['media_diff_both'] = 'Side by Side';
+$lang['js']['media_diff_opacity'] = 'Überblenden';
+$lang['js']['media_diff_portions'] = 'Übergang';
+$lang['js']['media_select'] = 'Dateien auswählen…';
+$lang['js']['media_upload_btn'] = 'Hochladen';
+$lang['js']['media_done_btn'] = 'Fertig';
+$lang['js']['media_drop'] = 'Dateien hier draufziehen um sie hochzuladen';
+$lang['js']['media_cancel'] = 'Entfernen';
+$lang['js']['media_overwrt'] = 'Existierende Dateien überschreiben';
+
$lang['rssfailed'] = 'Es ist ein Fehler beim Laden des Feeds aufgetreten: ';
$lang['nothingfound'] = 'Nichts gefunden.';
+
$lang['mediaselect'] = 'Dateiauswahl';
$lang['fileupload'] = 'Datei hochladen';
$lang['uploadsucc'] = 'Datei wurde erfolgreich hochgeladen';
@@ -161,6 +184,7 @@ $lang['mediaextchange'] = 'Dateiendung vom .%s nach .%s geändert!';
$lang['reference'] = 'Verwendung von';
$lang['ref_inuse'] = 'Diese Datei kann nicht gelöscht werden, da sie noch von folgenden Seiten benutzt wird:';
$lang['ref_hidden'] = 'Einige Verweise sind auf Seiten, für die Sie keine Leseberechtigung haben.';
+
$lang['hits'] = 'Treffer';
$lang['quickhits'] = 'Passende Seitennamen';
$lang['toc'] = 'Inhaltsverzeichnis';
@@ -184,11 +208,18 @@ $lang['external_edit'] = 'Externe Bearbeitung';
$lang['summary'] = 'Zusammenfassung';
$lang['noflash'] = 'Das <a href="http://www.adobe.com/products/flashplayer/">Adobe Flash Plugin</a> wird benötigt, um diesen Inhalt anzuzeigen.';
$lang['download'] = 'Schnipsel herunterladen';
+
$lang['mail_newpage'] = 'Neue Seite:';
$lang['mail_changed'] = 'Seite geändert:';
$lang['mail_subscribe_list'] = 'Geänderte Seiten im Namensraum:';
$lang['mail_new_user'] = 'Neuer Benutzer:';
$lang['mail_upload'] = 'Datei hochgeladen:';
+
+$lang['changes_type'] = 'Änderungen anzeigen von';
+$lang['pages_changes'] = 'Seiten';
+$lang['media_changes'] = 'Mediendateien';
+$lang['both_changes'] = 'Beides, Seiten- und Mediendateien';
+
$lang['qb_bold'] = 'Fetter Text';
$lang['qb_italic'] = 'Kursiver Text';
$lang['qb_underl'] = 'Unterstrichener Text';
@@ -213,8 +244,11 @@ $lang['qb_media'] = 'Bilder und andere Dateien hinzufügen';
$lang['qb_sig'] = 'Unterschrift einfügen';
$lang['qb_smileys'] = 'Smileys';
$lang['qb_chars'] = 'Sonderzeichen';
+
$lang['upperns'] = 'zum übergeordneten Namensraum springen';
+
$lang['admin_register'] = 'Neuen Benutzer anmelden';
+
$lang['metaedit'] = 'Metadaten bearbeiten';
$lang['metasaveerr'] = 'Die Metadaten konnten nicht gesichert werden';
$lang['metasaveok'] = 'Metadaten gesichert';
@@ -229,24 +263,33 @@ $lang['img_copyr'] = 'Copyright';
$lang['img_format'] = 'Format';
$lang['img_camera'] = 'Kamera';
$lang['img_keywords'] = 'Schlagwörter';
-$lang['subscr_subscribe_success'] = '%s hat nun Änderungen der Seite %s abonniert';
-$lang['subscr_subscribe_error'] = '%s kann die Änderungen der Seite %s nicht abonnieren';
+$lang['img_width'] = 'Breite';
+$lang['img_height'] = 'Höhe';
+$lang['img_manager'] = 'Im Medien-Manager anzeigen';
+
+$lang['subscr_subscribe_success'] = '%s hat nun Änderungen der Seite %s abonniert';
+$lang['subscr_subscribe_error'] = '%s kann die Änderungen der Seite %s nicht abonnieren';
$lang['subscr_subscribe_noaddress'] = 'Weil Ihre E-Mail-Adresse fehlt, können Sie das Thema nicht abonnieren';
$lang['subscr_unsubscribe_success'] = 'Das Abonnement von %s für die Seite %s wurde aufgelöst';
-$lang['subscr_unsubscribe_error'] = 'Das Abonnement von %s für die Seite %s konnte nicht aufgelöst werden';
-$lang['subscr_already_subscribed'] = '%s hat %s bereits abonniert';
-$lang['subscr_not_subscribed'] = '%s hat %s nicht abonniert';
-$lang['subscr_m_not_subscribed'] = 'Sie haben die aktuelle Seite und ihre Namensräume nicht abonniert.';
-$lang['subscr_m_new_header'] = 'Abonnement hinzufügen';
-$lang['subscr_m_current_header'] = 'Aktuelle Abonnements';
-$lang['subscr_m_unsubscribe'] = 'Löschen';
-$lang['subscr_m_subscribe'] = 'Abonnieren';
-$lang['subscr_m_receive'] = 'Benachrichtigung';
-$lang['subscr_style_every'] = 'E-Mail bei jeder Bearbeitung';
-$lang['subscr_style_digest'] = 'Zusammenfassung der Änderungen für jede veränderte Seite (Alle %.2f Tage)';
-$lang['subscr_style_list'] = 'Liste der geänderten Seiten (Alle %.2f Tage)';
+$lang['subscr_unsubscribe_error'] = 'Das Abonnement von %s für die Seite %s konnte nicht aufgelöst werden';
+$lang['subscr_already_subscribed'] = '%s hat %s bereits abonniert';
+$lang['subscr_not_subscribed'] = '%s hat %s nicht abonniert';
+// Manage page for subscriptions
+$lang['subscr_m_not_subscribed'] = 'Sie haben die aktuelle Seite und ihre Namensräume nicht abonniert.';
+$lang['subscr_m_new_header'] = 'Abonnement hinzufügen';
+$lang['subscr_m_current_header'] = 'Aktuelle Abonnements';
+$lang['subscr_m_unsubscribe'] = 'Löschen';
+$lang['subscr_m_subscribe'] = 'Abonnieren';
+$lang['subscr_m_receive'] = 'Benachrichtigung';
+$lang['subscr_style_every'] = 'E-Mail bei jeder Bearbeitung';
+$lang['subscr_style_digest'] = 'Zusammenfassung der Änderungen für jede veränderte Seite (Alle %.2f Tage)';
+$lang['subscr_style_list'] = 'Liste der geänderten Seiten (Alle %.2f Tage)';
+
+/* auth.class language support */
$lang['authmodfailed'] = 'Benutzerüberprüfung nicht möglich. Bitte wenden Sie sich an den Systembetreuer.';
$lang['authtempfail'] = 'Benutzerüberprüfung momentan nicht möglich. Falls das Problem andauert, wenden Sie sich an den Systembetreuer.';
+
+/* installer strings */
$lang['i_chooselang'] = 'Wählen Sie Ihre Sprache';
$lang['i_installer'] = 'DokuWiki Installation';
$lang['i_wikiname'] = 'Wiki-Name';
@@ -269,6 +312,7 @@ $lang['i_pol1'] = 'Öffentliches Wiki (lesen für alle, schreiben
$lang['i_pol2'] = 'Geschlossenes Wiki (lesen, schreiben, hochladen nur für registrierte Nutzer)';
$lang['i_retry'] = 'Wiederholen';
$lang['i_license'] = 'Bitte wählen Sie die Lizenz, unter die Sie Ihre Inhalte stellen möchten:';
+
$lang['mu_intro'] = 'In diesem Bereich können Sie mehrere Dateien gleichzeitig hochladen. Benutzen Sie die Schaltfläche "Durchsuchen" um sie der Warteschlange zuzufügen. Betätigen Sie die Schaltfläche "Hochladen" um die Übertragung zu starten.';
$lang['mu_gridname'] = 'Dateiname';
$lang['mu_gridsize'] = 'Größe';
@@ -284,6 +328,7 @@ $lang['mu_progress'] = '@PCT@% hochgeladen';
$lang['mu_filetypes'] = 'Erlaubte Dateitypen';
$lang['mu_info'] = 'Dateien hochgeladen!';
$lang['mu_lasterr'] = 'Letzter Fehler:';
+
$lang['recent_global'] = 'Im Moment sehen Sie die Änderungen im Namensraum <b>%s</b>. Sie können auch <a href="%s">die Änderungen im gesamten Wiki sehen</a>.';
$lang['years'] = 'vor %d Jahren';
$lang['months'] = 'vor %d Monaten';
@@ -292,4 +337,29 @@ $lang['days'] = 'vor %d Tagen';
$lang['hours'] = 'vor %d Stunden';
$lang['minutes'] = 'vor %d Minuten';
$lang['seconds'] = 'vor %d Sekunden';
+
$lang['wordblock'] = 'Ihre Bearbeitung wurde nicht gespeichert, da sie gesperrten Text enthielt (Spam).';
+
+$lang['media_uploadtab'] = 'Hochladen';
+$lang['media_searchtab'] = 'Suchen';
+$lang['media_viewtab'] = 'Anzeigen';
+$lang['media_edittab'] = 'Bearbeiten';
+$lang['media_historytab'] = 'Verlauf';
+$lang['media_thumbsview'] = 'Miniaturansicht';
+$lang['media_listview'] = 'Detailansicht';
+$lang['media_sort'] = 'Sortieren';
+$lang['media_sort_name'] = 'nach Name';
+$lang['media_sort_date'] = 'nach Datum';
+$lang['media_upload'] = 'In den <strong>%s</strong> Namespace hochladen.';
+$lang['media_search'] = 'Im Namespace <strong>%s</strong> suchen.';
+$lang['media_edit'] = 'Bearbeiten';
+$lang['media_history'] = 'Versionsverlauf der Datei.';
+$lang['media_meta_edited'] = 'Meta-Informationen bearbeitet';
+$lang['media_perm_read'] = 'Sie besitzen nicht die notwendigen Berechtigungen um die Datei anzuzeigen.';
+$lang['media_perm_upload'] = 'Sie besitzen nicht die notwendigen Berechtigungen um Dateien hochzuladen.';
+$lang['media_update'] = 'Neue Version hochladen';
+$lang['media_restore'] = 'Diese Version wiederherstellen';
+
+$lang['plugin_install_err'] = "Plugin nicht korrekt installiert. Plugin-Verzeichnis von '%s' nach '%s' umbenennen.";
+
+//Setup VIM: ex: et ts=2 : \ No newline at end of file
diff --git a/inc/lang/de/uploadmail.txt b/inc/lang/de/uploadmail.txt
index 757729804..977e7561c 100644
--- a/inc/lang/de/uploadmail.txt
+++ b/inc/lang/de/uploadmail.txt
@@ -1,13 +1,14 @@
Eine Datei wurde in Ihrem Wiki hochgeladen. Hier sind die Details:
-Datei : @MEDIA@
-Datum : @DATE@
-Browser : @BROWSER@
-IP-Adresse : @IPADDRESS@
-Hostname : @HOSTNAME@
-Größe : @SIZE@
-MIME-Typ : @MIME@
-Benutzer : @USER@
+Datei : @MEDIA@
+Alte Version: @OLD@
+Datum : @DATE@
+Browser : @BROWSER@
+IP-Adresse : @IPADDRESS@
+Hostname : @HOSTNAME@
+Größe : @SIZE@
+MIME-Typ : @MIME@
+Benutzer : @USER@
--
Diese Mail kommt vom DokuWiki auf
diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php
index 95356f7b4..d97de87d5 100644
--- a/inc/lang/en/lang.php
+++ b/inc/lang/en/lang.php
@@ -6,317 +6,352 @@
* @author Andreas Gohr <andi@splitbrain.org>
* @author Anika Henke <anika@selfthinker.org>
* @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
+ * @author Matthias Schulte <mailinglist@lupo49.de>
*/
-$lang['encoding'] = 'utf-8';
-$lang['direction'] = 'ltr';
-$lang['doublequoteopening'] = '“';//&ldquo;
-$lang['doublequoteclosing'] = '”';//&rdquo;
-$lang['singlequoteopening'] = '‘';//&lsquo;
-$lang['singlequoteclosing'] = '’';//&rsquo;
-$lang['apostrophe'] = '’';//&rsquo;
-
-$lang['btn_edit'] = 'Edit this page';
-$lang['btn_source'] = 'Show pagesource';
-$lang['btn_show'] = 'Show page';
-$lang['btn_create'] = 'Create this page';
-$lang['btn_search'] = 'Search';
-$lang['btn_save'] = 'Save';
-$lang['btn_preview']= 'Preview';
-$lang['btn_top'] = 'Back to top';
-$lang['btn_newer'] = '<< more recent';
-$lang['btn_older'] = 'less recent >>';
-$lang['btn_revs'] = 'Old revisions';
-$lang['btn_recent'] = 'Recent changes';
-$lang['btn_upload'] = 'Upload';
-$lang['btn_cancel'] = 'Cancel';
-$lang['btn_index'] = 'Sitemap';
-$lang['btn_secedit']= 'Edit';
-$lang['btn_login'] = 'Login';
-$lang['btn_logout'] = 'Logout';
-$lang['btn_admin'] = 'Admin';
-$lang['btn_update'] = 'Update';
-$lang['btn_delete'] = 'Delete';
-$lang['btn_back'] = 'Back';
-$lang['btn_backlink'] = "Backlinks";
-$lang['btn_backtomedia'] = 'Back to Mediafile Selection';
-$lang['btn_subscribe'] = 'Manage Subscriptions';
-$lang['btn_profile'] = 'Update Profile';
-$lang['btn_reset'] = 'Reset';
-$lang['btn_resendpwd'] = 'Send new password';
-$lang['btn_draft'] = 'Edit draft';
-$lang['btn_recover'] = 'Recover draft';
-$lang['btn_draftdel'] = 'Delete draft';
-$lang['btn_revert'] = 'Restore';
-$lang['btn_register'] = 'Register';
-
-$lang['loggedinas'] = 'Logged in as';
-$lang['user'] = 'Username';
-$lang['pass'] = 'Password';
-$lang['newpass'] = 'New password';
-$lang['oldpass'] = 'Confirm current password';
-$lang['passchk'] = 'once again';
-$lang['remember'] = 'Remember me';
-$lang['fullname'] = 'Real name';
-$lang['email'] = 'E-Mail';
-$lang['profile'] = 'User Profile';
-$lang['badlogin'] = 'Sorry, username or password was wrong.';
-$lang['minoredit'] = 'Minor Changes';
-$lang['draftdate'] = 'Draft autosaved on'; // full dformat date will be added
-$lang['nosecedit'] = 'The page was changed in the meantime, section info was out of date loaded full page instead.';
-
-$lang['regmissing'] = 'Sorry, you must fill in all fields.';
-$lang['reguexists'] = 'Sorry, a user with this login already exists.';
-$lang['regsuccess'] = 'The user has been created and the password was sent by email.';
-$lang['regsuccess2']= 'The user has been created.';
-$lang['regmailfail']= 'Looks like there was an error on sending the password mail. Please contact the admin!';
-$lang['regbadmail'] = 'The given email address looks invalid - if you think this is an error, contact the admin';
-$lang['regbadpass'] = 'The two given passwords are not identical, please try again.';
-$lang['regpwmail'] = 'Your DokuWiki password';
-$lang['reghere'] = 'You don\'t have an account yet? Just get one';
-
-$lang['profna'] = 'This wiki does not support profile modification';
-$lang['profnochange'] = 'No changes, nothing to do.';
-$lang['profnoempty'] = 'An empty name or email address is not allowed.';
-$lang['profchanged'] = 'User profile successfully updated.';
-
-$lang['pwdforget'] = 'Forgotten your password? Get a new one';
-$lang['resendna'] = 'This wiki does not support password resending.';
-$lang['resendpwd'] = 'Send new password for';
-$lang['resendpwdmissing'] = 'Sorry, you must fill in all fields.';
-$lang['resendpwdnouser'] = 'Sorry, we can\'t find this user in our database.';
-$lang['resendpwdbadauth'] = 'Sorry, this auth code is not valid. Make sure you used the complete confirmation link.';
-$lang['resendpwdconfirm'] = 'A confirmation link has been sent by email.';
-$lang['resendpwdsuccess'] = 'Your new password has been sent by email.';
-
-$lang['license'] = 'Except where otherwise noted, content on this wiki is licensed under the following license:';
-$lang['licenseok'] = 'Note: By editing this page you agree to license your content under the following license:';
-
-$lang['searchmedia'] = 'Search file name:';
-$lang['searchmedia_in'] = 'Search in %s';
-$lang['txt_upload'] = 'Select file to upload';
-$lang['txt_filename'] = 'Upload as (optional)';
-$lang['txt_overwrt'] = 'Overwrite existing file';
-$lang['lockedby'] = 'Currently locked by';
-$lang['lockexpire'] = 'Lock expires at';
-$lang['js']['willexpire'] = 'Your lock for editing this page is about to expire in a minute.\nTo avoid conflicts use the preview button to reset the locktimer.';
-
-$lang['js']['notsavedyet'] = "Unsaved changes will be lost.";
-$lang['rssfailed'] = 'An error occurred while fetching this feed: ';
-$lang['nothingfound']= 'Nothing was found.';
-
-$lang['mediaselect'] = 'Media Files';
-$lang['fileupload'] = 'Media File Upload';
-$lang['uploadsucc'] = 'Upload successful';
-$lang['uploadfail'] = 'Upload failed. Maybe wrong permissions?';
-$lang['uploadwrong'] = 'Upload denied. This file extension is forbidden!';
-$lang['uploadexist'] = 'File already exists. Nothing done.';
-$lang['uploadbadcontent'] = 'The uploaded content did not match the %s file extension.';
-$lang['uploadspam'] = 'The upload was blocked by the spam blacklist.';
-$lang['uploadxss'] = 'The upload was blocked for possibly malicious content.';
-$lang['uploadsize'] = 'The uploaded file was too big. (max. %s)';
-$lang['deletesucc'] = 'The file "%s" has been deleted.';
-$lang['deletefail'] = '"%s" couldn\'t be deleted - check permissions.';
-$lang['mediainuse'] = 'The file "%s" hasn\'t been deleted - it is still in use.';
-$lang['namespaces'] = 'Namespaces';
-$lang['mediafiles'] = 'Available files in';
-$lang['accessdenied'] = 'You are not allowed to view this page.';
-
-$lang['js']['searchmedia'] = 'Search for files';
-$lang['js']['keepopen'] = 'Keep window open on selection';
-$lang['js']['hidedetails'] = 'Hide Details';
-$lang['mediausage'] = 'Use the following syntax to reference this file:';
-$lang['mediaview'] = 'View original file';
-$lang['mediaroot'] = 'root';
-$lang['mediaupload'] = 'Upload a file to the current namespace here. To create subnamespaces, prepend them to your "Upload as" filename separated by colons.';
-$lang['mediaextchange'] = 'Filextension changed from .%s to .%s!';
-
-$lang['js']['mediatitle'] = 'Link settings';
-$lang['js']['mediadisplay'] = 'Link type';
-$lang['js']['mediaalign'] = 'Alignment';
-$lang['js']['mediasize'] = 'Image size';
-$lang['js']['mediatarget'] = 'Link target';
-$lang['js']['mediaclose'] = 'Close';
-$lang['js']['mediainsert'] = 'Insert';
-$lang['js']['mediadisplayimg'] = 'Show the image.';
-$lang['js']['mediadisplaylnk'] = 'Show only the link.';
-$lang['js']['mediasmall'] = 'Small version';
-$lang['js']['mediamedium'] = 'Medium version';
-$lang['js']['medialarge'] = 'Large version';
-$lang['js']['mediaoriginal'] = 'Original version';
-$lang['js']['medialnk'] = 'Link to detail page';
-$lang['js']['mediadirect'] = 'Direct link to original';
-$lang['js']['medianolnk'] = 'No link';
-$lang['js']['medianolink'] = 'Do not link the image';
-$lang['js']['medialeft'] = 'Align the image on the left.';
-$lang['js']['mediaright'] = 'Align the image on the right.';
-$lang['js']['mediacenter'] = 'Align the image in the middle.';
-$lang['js']['medianoalign'] = 'Use no align.';
-
-$lang['reference'] = 'References for';
-$lang['ref_inuse'] = 'The file can\'t be deleted, because it\'s still used by the following pages:';
-$lang['ref_hidden'] = 'Some references are on pages you don\'t have permission to read';
-
-$lang['hits'] = 'Hits';
-$lang['quickhits'] = 'Matching pagenames';
-$lang['toc'] = 'Table of Contents';
-$lang['current'] = 'current';
-$lang['yours'] = 'Your Version';
-$lang['diff'] = 'Show differences to current revisions';
-$lang['diff2'] = 'Show differences between selected revisions';
-$lang['difflink'] = 'Link to this comparison view';
-$lang['diff_type'] = 'View differences:';
-$lang['diff_inline']= 'Inline';
-$lang['diff_side'] = 'Side by Side';
-$lang['line'] = 'Line';
-$lang['breadcrumb'] = 'Trace';
-$lang['youarehere'] = 'You are here';
-$lang['lastmod'] = 'Last modified';
-$lang['by'] = 'by';
-$lang['deleted'] = 'removed';
-$lang['created'] = 'created';
-$lang['restored'] = 'old revision restored';
-$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['mail_newpage'] = 'page added:';
-$lang['mail_changed'] = 'page changed:';
-$lang['mail_subscribe_list'] = 'pages changed in namespace:';
-$lang['mail_new_user'] = 'new user:';
-$lang['mail_upload'] = 'file uploaded:';
-
-$lang['js']['nosmblinks'] = "Linking to Windows shares only works in Microsoft Internet Explorer.\nYou still can copy and paste the link.";
-
-$lang['qb_bold'] = 'Bold Text';
-$lang['qb_italic'] = 'Italic Text';
-$lang['qb_underl'] = 'Underlined Text';
-$lang['qb_code'] = 'Code Text';
-$lang['qb_strike'] = 'Strike-through Text';
-$lang['qb_h1'] = 'Level 1 Headline';
-$lang['qb_h2'] = 'Level 2 Headline';
-$lang['qb_h3'] = 'Level 3 Headline';
-$lang['qb_h4'] = 'Level 4 Headline';
-$lang['qb_h5'] = 'Level 5 Headline';
-
-$lang['qb_h'] = 'Headline';
-$lang['qb_hs'] = 'Select Headline';
-$lang['qb_hplus'] = 'Higher Headline';
-$lang['qb_hminus'] = 'Lower Headline';
-$lang['qb_hequal'] = 'Same Level Headline';
-
-$lang['qb_link'] = 'Internal Link';
-$lang['qb_extlink'] = 'External Link';
-$lang['qb_hr'] = 'Horizontal Rule';
-$lang['qb_ol'] = 'Ordered List Item';
-$lang['qb_ul'] = 'Unordered List Item';
-$lang['qb_media'] = 'Add Images and other files';
-$lang['qb_sig'] = 'Insert Signature';
-$lang['qb_smileys'] = 'Smileys';
-$lang['qb_chars'] = 'Special Chars';
-
-$lang['upperns'] = 'jump to parent namespace';
-$lang['js']['linkwiz'] = 'Link Wizard';
-$lang['js']['linkto'] = 'Link to:';
-
-$lang['js']['del_confirm']= 'Really delete selected item(s)?';
-$lang['admin_register']= 'Add new user';
-
-$lang['metaedit'] = 'Edit Metadata';
-$lang['metasaveerr'] = 'Writing metadata failed';
-$lang['metasaveok'] = 'Metadata saved';
-$lang['img_backto'] = 'Back to';
-$lang['img_title'] = 'Title';
-$lang['img_caption'] = 'Caption';
-$lang['img_date'] = 'Date';
-$lang['img_fname'] = 'Filename';
-$lang['img_fsize'] = 'Size';
-$lang['img_artist'] = 'Photographer';
-$lang['img_copyr'] = 'Copyright';
-$lang['img_format'] = 'Format';
-$lang['img_camera'] = 'Camera';
-$lang['img_keywords']= 'Keywords';
-
-$lang['subscr_subscribe_success'] = 'Added %s to subscription list for %s';
-$lang['subscr_subscribe_error'] = 'Error adding %s to subscription list for %s';
-$lang['subscr_subscribe_noaddress']= 'There is no address associated with your login, you cannot be added to the subscription list';
-$lang['subscr_unsubscribe_success']= 'Removed %s from subscription list for %s';
-$lang['subscr_unsubscribe_error'] = 'Error removing %s from subscription list for %s';
-$lang['subscr_already_subscribed'] = '%s is already subscribed to %s';
-$lang['subscr_not_subscribed'] = '%s is not subscribed to %s';
+$lang['encoding'] = 'utf-8';
+$lang['direction'] = 'ltr';
+$lang['doublequoteopening'] = '“'; //&ldquo;
+$lang['doublequoteclosing'] = '”'; //&rdquo;
+$lang['singlequoteopening'] = '‘'; //&lsquo;
+$lang['singlequoteclosing'] = '’'; //&rsquo;
+$lang['apostrophe'] = '’'; //&rsquo;
+
+$lang['btn_edit'] = 'Edit this page';
+$lang['btn_source'] = 'Show pagesource';
+$lang['btn_show'] = 'Show page';
+$lang['btn_create'] = 'Create this page';
+$lang['btn_search'] = 'Search';
+$lang['btn_save'] = 'Save';
+$lang['btn_preview'] = 'Preview';
+$lang['btn_top'] = 'Back to top';
+$lang['btn_newer'] = '<< more recent';
+$lang['btn_older'] = 'less recent >>';
+$lang['btn_revs'] = 'Old revisions';
+$lang['btn_recent'] = 'Recent changes';
+$lang['btn_upload'] = 'Upload';
+$lang['btn_cancel'] = 'Cancel';
+$lang['btn_index'] = 'Sitemap';
+$lang['btn_secedit'] = 'Edit';
+$lang['btn_login'] = 'Login';
+$lang['btn_logout'] = 'Logout';
+$lang['btn_admin'] = 'Admin';
+$lang['btn_update'] = 'Update';
+$lang['btn_delete'] = 'Delete';
+$lang['btn_back'] = 'Back';
+$lang['btn_backlink'] = "Backlinks";
+$lang['btn_backtomedia'] = 'Back to Mediafile Selection';
+$lang['btn_subscribe'] = 'Manage Subscriptions';
+$lang['btn_profile'] = 'Update Profile';
+$lang['btn_reset'] = 'Reset';
+$lang['btn_resendpwd'] = 'Send new password';
+$lang['btn_draft'] = 'Edit draft';
+$lang['btn_recover'] = 'Recover draft';
+$lang['btn_draftdel'] = 'Delete draft';
+$lang['btn_revert'] = 'Restore';
+$lang['btn_register'] = 'Register';
+$lang['btn_apply'] = 'Apply';
+$lang['btn_media'] = 'Media Manager';
+
+$lang['loggedinas'] = 'Logged in as';
+$lang['user'] = 'Username';
+$lang['pass'] = 'Password';
+$lang['newpass'] = 'New password';
+$lang['oldpass'] = 'Confirm current password';
+$lang['passchk'] = 'once again';
+$lang['remember'] = 'Remember me';
+$lang['fullname'] = 'Real name';
+$lang['email'] = 'E-Mail';
+$lang['profile'] = 'User Profile';
+$lang['badlogin'] = 'Sorry, username or password was wrong.';
+$lang['minoredit'] = 'Minor Changes';
+$lang['draftdate'] = 'Draft autosaved on'; // full dformat date will be added
+$lang['nosecedit'] = 'The page was changed in the meantime, section info was out of date loaded full page instead.';
+
+$lang['regmissing'] = 'Sorry, you must fill in all fields.';
+$lang['reguexists'] = 'Sorry, a user with this login already exists.';
+$lang['regsuccess'] = 'The user has been created and the password was sent by email.';
+$lang['regsuccess2'] = 'The user has been created.';
+$lang['regmailfail'] = 'Looks like there was an error on sending the password mail. Please contact the admin!';
+$lang['regbadmail'] = 'The given email address looks invalid - if you think this is an error, contact the admin';
+$lang['regbadpass'] = 'The two given passwords are not identical, please try again.';
+$lang['regpwmail'] = 'Your DokuWiki password';
+$lang['reghere'] = 'You don\'t have an account yet? Just get one';
+
+$lang['profna'] = 'This wiki does not support profile modification';
+$lang['profnochange'] = 'No changes, nothing to do.';
+$lang['profnoempty'] = 'An empty name or email address is not allowed.';
+$lang['profchanged'] = 'User profile successfully updated.';
+
+$lang['pwdforget'] = 'Forgotten your password? Get a new one';
+$lang['resendna'] = 'This wiki does not support password resending.';
+$lang['resendpwd'] = 'Send new password for';
+$lang['resendpwdmissing'] = 'Sorry, you must fill in all fields.';
+$lang['resendpwdnouser'] = 'Sorry, we can\'t find this user in our database.';
+$lang['resendpwdbadauth'] = 'Sorry, this auth code is not valid. Make sure you used the complete confirmation link.';
+$lang['resendpwdconfirm'] = 'A confirmation link has been sent by email.';
+$lang['resendpwdsuccess'] = 'Your new password has been sent by email.';
+
+$lang['license'] = 'Except where otherwise noted, content on this wiki is licensed under the following license:';
+$lang['licenseok'] = 'Note: By editing this page you agree to license your content under the following license:';
+
+$lang['searchmedia'] = 'Search file name:';
+$lang['searchmedia_in'] = 'Search in %s';
+$lang['txt_upload'] = 'Select file to upload';
+$lang['txt_filename'] = 'Upload as (optional)';
+$lang['txt_overwrt'] = 'Overwrite existing file';
+$lang['lockedby'] = 'Currently locked by';
+$lang['lockexpire'] = 'Lock expires at';
+
+$lang['js']['willexpire'] = 'Your lock for editing this page is about to expire in a minute.\nTo avoid conflicts use the preview button to reset the locktimer.';
+$lang['js']['notsavedyet'] = "Unsaved changes will be lost.";
+$lang['js']['searchmedia'] = 'Search for files';
+$lang['js']['keepopen'] = 'Keep window open on selection';
+$lang['js']['hidedetails'] = 'Hide Details';
+$lang['js']['mediatitle'] = 'Link settings';
+$lang['js']['mediadisplay'] = 'Link type';
+$lang['js']['mediaalign'] = 'Alignment';
+$lang['js']['mediasize'] = 'Image size';
+$lang['js']['mediatarget'] = 'Link target';
+$lang['js']['mediaclose'] = 'Close';
+$lang['js']['mediainsert'] = 'Insert';
+$lang['js']['mediadisplayimg'] = 'Show the image.';
+$lang['js']['mediadisplaylnk'] = 'Show only the link.';
+$lang['js']['mediasmall'] = 'Small version';
+$lang['js']['mediamedium'] = 'Medium version';
+$lang['js']['medialarge'] = 'Large version';
+$lang['js']['mediaoriginal'] = 'Original version';
+$lang['js']['medialnk'] = 'Link to detail page';
+$lang['js']['mediadirect'] = 'Direct link to original';
+$lang['js']['medianolnk'] = 'No link';
+$lang['js']['medianolink'] = 'Do not link the image';
+$lang['js']['medialeft'] = 'Align the image on the left.';
+$lang['js']['mediaright'] = 'Align the image on the right.';
+$lang['js']['mediacenter'] = 'Align the image in the middle.';
+$lang['js']['medianoalign'] = 'Use no align.';
+$lang['js']['nosmblinks'] = "Linking to Windows shares only works in Microsoft Internet Explorer.\nYou still can copy and paste the link.";
+$lang['js']['linkwiz'] = 'Link Wizard';
+$lang['js']['linkto'] = 'Link to:';
+$lang['js']['del_confirm'] = 'Really delete selected item(s)?';
+$lang['js']['mu_btn'] = 'Upload multiple files at once';
+$lang['js']['restore_confirm'] = 'Really restore this version?';
+$lang['js']['media_diff'] = 'View differences:';
+$lang['js']['media_diff_both'] = 'Side by Side';
+$lang['js']['media_diff_opacity'] = 'Overlay';
+$lang['js']['media_diff_portions'] = 'Slider';
+$lang['js']['media_select'] = 'Select files…';
+$lang['js']['media_upload_btn'] = 'Upload';
+$lang['js']['media_done_btn'] = 'Done';
+$lang['js']['media_drop'] = 'Drop files here to upload';
+$lang['js']['media_cancel'] = 'remove';
+$lang['js']['media_overwrt'] = 'Overwrite existing files';
+
+$lang['rssfailed'] = 'An error occurred while fetching this feed: ';
+$lang['nothingfound'] = 'Nothing was found.';
+
+$lang['mediaselect'] = 'Media Files';
+$lang['fileupload'] = 'Media File Upload';
+$lang['uploadsucc'] = 'Upload successful';
+$lang['uploadfail'] = 'Upload failed. Maybe wrong permissions?';
+$lang['uploadwrong'] = 'Upload denied. This file extension is forbidden!';
+$lang['uploadexist'] = 'File already exists. Nothing done.';
+$lang['uploadbadcontent'] = 'The uploaded content did not match the %s file extension.';
+$lang['uploadspam'] = 'The upload was blocked by the spam blacklist.';
+$lang['uploadxss'] = 'The upload was blocked for possibly malicious content.';
+$lang['uploadsize'] = 'The uploaded file was too big. (max. %s)';
+$lang['deletesucc'] = 'The file "%s" has been deleted.';
+$lang['deletefail'] = '"%s" couldn\'t be deleted - check permissions.';
+$lang['mediainuse'] = 'The file "%s" hasn\'t been deleted - it is still in use.';
+$lang['namespaces'] = 'Namespaces';
+$lang['mediafiles'] = 'Available files in';
+$lang['accessdenied'] = 'You are not allowed to view this page.';
+$lang['mediausage'] = 'Use the following syntax to reference this file:';
+$lang['mediaview'] = 'View original file';
+$lang['mediaroot'] = 'root';
+$lang['mediaupload'] = 'Upload a file to the current namespace here. To create subnamespaces, prepend them to your "Upload as" filename separated by colons. Files also can be selected by drag and drop.';
+$lang['mediaextchange'] = 'Filextension changed from .%s to .%s!';
+$lang['reference'] = 'References for';
+$lang['ref_inuse'] = 'The file can\'t be deleted, because it\'s still used by the following pages:';
+$lang['ref_hidden'] = 'Some references are on pages you don\'t have permission to read';
+
+$lang['hits'] = 'Hits';
+$lang['quickhits'] = 'Matching pagenames';
+$lang['toc'] = 'Table of Contents';
+$lang['current'] = 'current';
+$lang['yours'] = 'Your Version';
+$lang['diff'] = 'Show differences to current revisions';
+$lang['diff2'] = 'Show differences between selected revisions';
+$lang['difflink'] = 'Link to this comparison view';
+$lang['diff_type'] = 'View differences:';
+$lang['diff_inline'] = 'Inline';
+$lang['diff_side'] = 'Side by Side';
+$lang['line'] = 'Line';
+$lang['breadcrumb'] = 'Trace';
+$lang['youarehere'] = 'You are here';
+$lang['lastmod'] = 'Last modified';
+$lang['by'] = 'by';
+$lang['deleted'] = 'removed';
+$lang['created'] = 'created';
+$lang['restored'] = 'old revision restored';
+$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['mail_newpage'] = 'page added:';
+$lang['mail_changed'] = 'page changed:';
+$lang['mail_subscribe_list'] = 'pages changed in namespace:';
+$lang['mail_new_user'] = 'new user:';
+$lang['mail_upload'] = 'file uploaded:';
+
+$lang['changes_type'] = 'View changes of';
+$lang['pages_changes'] = 'Pages';
+$lang['media_changes'] = 'Media files';
+$lang['both_changes'] = 'Both pages and media files';
+
+$lang['qb_bold'] = 'Bold Text';
+$lang['qb_italic'] = 'Italic Text';
+$lang['qb_underl'] = 'Underlined Text';
+$lang['qb_code'] = 'Code Text';
+$lang['qb_strike'] = 'Strike-through Text';
+$lang['qb_h1'] = 'Level 1 Headline';
+$lang['qb_h2'] = 'Level 2 Headline';
+$lang['qb_h3'] = 'Level 3 Headline';
+$lang['qb_h4'] = 'Level 4 Headline';
+$lang['qb_h5'] = 'Level 5 Headline';
+$lang['qb_h'] = 'Headline';
+$lang['qb_hs'] = 'Select Headline';
+$lang['qb_hplus'] = 'Higher Headline';
+$lang['qb_hminus'] = 'Lower Headline';
+$lang['qb_hequal'] = 'Same Level Headline';
+$lang['qb_link'] = 'Internal Link';
+$lang['qb_extlink'] = 'External Link';
+$lang['qb_hr'] = 'Horizontal Rule';
+$lang['qb_ol'] = 'Ordered List Item';
+$lang['qb_ul'] = 'Unordered List Item';
+$lang['qb_media'] = 'Add Images and other files';
+$lang['qb_sig'] = 'Insert Signature';
+$lang['qb_smileys'] = 'Smileys';
+$lang['qb_chars'] = 'Special Chars';
+
+$lang['upperns'] = 'jump to parent namespace';
+
+$lang['admin_register'] = 'Add new user';
+
+$lang['metaedit'] = 'Edit Metadata';
+$lang['metasaveerr'] = 'Writing metadata failed';
+$lang['metasaveok'] = 'Metadata saved';
+$lang['img_backto'] = 'Back to';
+$lang['img_title'] = 'Title';
+$lang['img_caption'] = 'Caption';
+$lang['img_date'] = 'Date';
+$lang['img_fname'] = 'Filename';
+$lang['img_fsize'] = 'Size';
+$lang['img_artist'] = 'Photographer';
+$lang['img_copyr'] = 'Copyright';
+$lang['img_format'] = 'Format';
+$lang['img_camera'] = 'Camera';
+$lang['img_keywords'] = 'Keywords';
+$lang['img_width'] = 'Width';
+$lang['img_height'] = 'Height';
+$lang['img_manager'] = 'View in media manager';
+
+$lang['subscr_subscribe_success'] = 'Added %s to subscription list for %s';
+$lang['subscr_subscribe_error'] = 'Error adding %s to subscription list for %s';
+$lang['subscr_subscribe_noaddress'] = 'There is no address associated with your login, you cannot be added to the subscription list';
+$lang['subscr_unsubscribe_success'] = 'Removed %s from subscription list for %s';
+$lang['subscr_unsubscribe_error'] = 'Error removing %s from subscription list for %s';
+$lang['subscr_already_subscribed'] = '%s is already subscribed to %s';
+$lang['subscr_not_subscribed'] = '%s is not subscribed to %s';
// Manage page for subscriptions
-$lang['subscr_m_not_subscribed'] = 'You are currently not subscribed to the current page or namespace.';
-$lang['subscr_m_new_header'] = 'Add subscription';
-$lang['subscr_m_current_header'] = 'Current subscriptions';
-$lang['subscr_m_unsubscribe'] = 'Unsubscribe';
-$lang['subscr_m_subscribe'] = 'Subscribe';
-$lang['subscr_m_receive'] = 'Receive';
-$lang['subscr_style_every'] = 'email on every change';
-$lang['subscr_style_digest'] = 'digest email of changes for each page (every %.2f days)';
-$lang['subscr_style_list'] = 'list of changed pages since last email (every %.2f days)';
-
+$lang['subscr_m_not_subscribed'] = 'You are currently not subscribed to the current page or namespace.';
+$lang['subscr_m_new_header'] = 'Add subscription';
+$lang['subscr_m_current_header'] = 'Current subscriptions';
+$lang['subscr_m_unsubscribe'] = 'Unsubscribe';
+$lang['subscr_m_subscribe'] = 'Subscribe';
+$lang['subscr_m_receive'] = 'Receive';
+$lang['subscr_style_every'] = 'email on every change';
+$lang['subscr_style_digest'] = 'digest email of changes for each page (every %.2f days)';
+$lang['subscr_style_list'] = 'list of changed pages since last email (every %.2f days)';
/* auth.class language support */
-$lang['authmodfailed'] = 'Bad user authentication configuration. Please inform your Wiki Admin.';
-$lang['authtempfail'] = 'User authentication is temporarily unavailable. If this situation persists, please inform your Wiki Admin.';
+$lang['authmodfailed'] = 'Bad user authentication configuration. Please inform your Wiki Admin.';
+$lang['authtempfail'] = 'User authentication is temporarily unavailable. If this situation persists, please inform your Wiki Admin.';
/* installer strings */
-$lang['i_chooselang'] = 'Choose your language';
-$lang['i_installer'] = 'DokuWiki Installer';
-$lang['i_wikiname'] = 'Wiki Name';
-$lang['i_enableacl'] = 'Enable ACL (recommended)';
-$lang['i_superuser'] = 'Superuser';
-$lang['i_problems'] = 'The installer found some problems, indicated below. You can not continue until you have fixed them.';
-$lang['i_modified'] = 'For security reasons this script will only work with a new and unmodified Dokuwiki installation.
- You should either re-extract the files from the downloaded package or consult the complete
- <a href="http://dokuwiki.org/install">Dokuwiki installation instructions</a>';
-$lang['i_funcna'] = 'PHP function <code>%s</code> is not available. Maybe your hosting provider disabled it for some reason?';
-$lang['i_phpver'] = 'Your PHP version <code>%s</code> is lower than the needed <code>%s</code>. You need to upgrade your PHP install.';
-$lang['i_permfail'] = '<code>%s</code> is not writable by DokuWiki. You need to fix the permission settings of this directory!';
-$lang['i_confexists'] = '<code>%s</code> already exists';
-$lang['i_writeerr'] = 'Unable to create <code>%s</code>. You will need to check directory/file permissions and create the file manually.';
-$lang['i_badhash'] = 'unrecognised or modified dokuwiki.php (hash=<code>%s</code>)';
-$lang['i_badval'] = '<code>%s</code> - illegal or empty value';
-$lang['i_success'] = 'The configuration was finished successfully. You may delete the install.php file now. Continue to
- <a href="doku.php">your new DokuWiki</a>.';
-$lang['i_failure'] = 'Some errors occurred while writing the configuration files. You may need to fix them manually before
- you can use <a href="doku.php">your new DokuWiki</a>.';
-$lang['i_policy'] = 'Initial ACL policy';
-$lang['i_pol0'] = 'Open Wiki (read, write, upload for everyone)';
-$lang['i_pol1'] = 'Public Wiki (read for everyone, write and upload for registered users)';
-$lang['i_pol2'] = 'Closed Wiki (read, write, upload for registered users only)';
-
-$lang['i_retry'] = 'Retry';
-$lang['i_license'] = 'Please choose the license you want to put your content under:';
-
-$lang['mu_intro'] = 'Here you can upload multiple files at once. Click the browse button to add them to the queue. Press upload when done.';
-$lang['js']['mu_btn'] = 'Upload multiple files at once';
-$lang['mu_gridname'] = 'Filename';
-$lang['mu_gridsize'] = 'Size';
-$lang['mu_gridstat'] = 'Status';
-$lang['mu_namespace'] = 'Namespace';
-$lang['mu_browse'] = 'Browse';
-$lang['mu_toobig'] = 'too big';
-$lang['mu_ready'] = 'ready for upload';
-$lang['mu_done'] = 'complete';
-$lang['mu_fail'] = 'failed';
-$lang['mu_authfail'] = 'session expired';
-$lang['mu_progress'] = '@PCT@% uploaded';
-$lang['mu_filetypes'] = 'Allowed Filetypes';
-$lang['mu_info'] = 'files uploaded.';
-$lang['mu_lasterr'] = 'Last error:';
-
-$lang['recent_global'] = 'You\'re currently watching the changes inside the <b>%s</b> namespace. You can also <a href="%s">view the recent changes of the whole wiki</a>.';
-
-$lang['years'] = '%d years ago';
-$lang['months'] = '%d months ago';
-$lang['weeks'] = '%d weeks ago';
-$lang['days'] = '%d days ago';
-$lang['hours'] = '%d hours ago';
-$lang['minutes'] = '%d minutes ago';
-$lang['seconds'] = '%d seconds ago';
-
-$lang['wordblock'] = 'Your change was not saved because it contains blocked text (spam).';
-
-
-//Setup VIM: ex: et ts=2 :
+$lang['i_chooselang'] = 'Choose your language';
+$lang['i_installer'] = 'DokuWiki Installer';
+$lang['i_wikiname'] = 'Wiki Name';
+$lang['i_enableacl'] = 'Enable ACL (recommended)';
+$lang['i_superuser'] = 'Superuser';
+$lang['i_problems'] = 'The installer found some problems, indicated below. You can not continue until you have fixed them.';
+$lang['i_modified'] = 'For security reasons this script will only work with a new and unmodified Dokuwiki installation.
+ You should either re-extract the files from the downloaded package or consult the complete
+ <a href="http://dokuwiki.org/install">Dokuwiki installation instructions</a>';
+$lang['i_funcna'] = 'PHP function <code>%s</code> is not available. Maybe your hosting provider disabled it for some reason?';
+$lang['i_phpver'] = 'Your PHP version <code>%s</code> is lower than the needed <code>%s</code>. You need to upgrade your PHP install.';
+$lang['i_permfail'] = '<code>%s</code> is not writable by DokuWiki. You need to fix the permission settings of this directory!';
+$lang['i_confexists'] = '<code>%s</code> already exists';
+$lang['i_writeerr'] = 'Unable to create <code>%s</code>. You will need to check directory/file permissions and create the file manually.';
+$lang['i_badhash'] = 'unrecognised or modified dokuwiki.php (hash=<code>%s</code>)';
+$lang['i_badval'] = '<code>%s</code> - illegal or empty value';
+$lang['i_success'] = 'The configuration was finished successfully. You may delete the install.php file now. Continue to
+ <a href="doku.php">your new DokuWiki</a>.';
+$lang['i_failure'] = 'Some errors occurred while writing the configuration files. You may need to fix them manually before
+ you can use <a href="doku.php">your new DokuWiki</a>.';
+$lang['i_policy'] = 'Initial ACL policy';
+$lang['i_pol0'] = 'Open Wiki (read, write, upload for everyone)';
+$lang['i_pol1'] = 'Public Wiki (read for everyone, write and upload for registered users)';
+$lang['i_pol2'] = 'Closed Wiki (read, write, upload for registered users only)';
+$lang['i_retry'] = 'Retry';
+$lang['i_license'] = 'Please choose the license you want to put your content under:';
+
+$lang['mu_intro'] = 'Here you can upload multiple files at once. Click the browse button to add them to the queue. Press upload when done.';
+$lang['mu_gridname'] = 'Filename';
+$lang['mu_gridsize'] = 'Size';
+$lang['mu_gridstat'] = 'Status';
+$lang['mu_namespace'] = 'Namespace';
+$lang['mu_browse'] = 'Browse';
+$lang['mu_toobig'] = 'too big';
+$lang['mu_ready'] = 'ready for upload';
+$lang['mu_done'] = 'complete';
+$lang['mu_fail'] = 'failed';
+$lang['mu_authfail'] = 'session expired';
+$lang['mu_progress'] = '@PCT@% uploaded';
+$lang['mu_filetypes'] = 'Allowed Filetypes';
+$lang['mu_info'] = 'files uploaded.';
+$lang['mu_lasterr'] = 'Last error:';
+
+$lang['recent_global'] = 'You\'re currently watching the changes inside the <b>%s</b> namespace. You can also <a href="%s">view the recent changes of the whole wiki</a>.';
+$lang['years'] = '%d years ago';
+$lang['months'] = '%d months ago';
+$lang['weeks'] = '%d weeks ago';
+$lang['days'] = '%d days ago';
+$lang['hours'] = '%d hours ago';
+$lang['minutes'] = '%d minutes ago';
+$lang['seconds'] = '%d seconds ago';
+
+$lang['wordblock'] = 'Your change was not saved because it contains blocked text (spam).';
+
+$lang['media_uploadtab'] = 'Upload';
+$lang['media_searchtab'] = 'Search';
+$lang['media_viewtab'] = 'View';
+$lang['media_edittab'] = 'Edit';
+$lang['media_historytab'] = 'History';
+$lang['media_thumbsview'] = 'Thumbnails';
+$lang['media_listview'] = 'List';
+$lang['media_sort'] = 'Sort';
+$lang['media_sort_name'] = 'by name';
+$lang['media_sort_date'] = 'by date';
+$lang['media_upload'] = 'Upload to the <strong>%s</strong> namespace.';
+$lang['media_search'] = 'Search in the <strong>%s</strong> namespace.';
+$lang['media_edit'] = 'Edit';
+$lang['media_history'] = 'These are the older revisions of the file.';
+$lang['media_meta_edited'] = 'metadata edited';
+$lang['media_perm_read'] = 'Sorry, you don\'t have enough rights to read files.';
+$lang['media_perm_upload'] = 'Sorry, you don\'t have enough rights to upload files.';
+$lang['media_update'] = 'Upload new version';
+$lang['media_restore'] = 'Restore this version';
+
+$lang['plugin_install_err'] = "Plugin installed incorrectly. Rename plugin directory '%s' to '%s'.";
+
+//Setup VIM: ex: et ts=2 : \ No newline at end of file
diff --git a/inc/lang/en/uploadmail.txt b/inc/lang/en/uploadmail.txt
index 6fa196730..16bb6989c 100644
--- a/inc/lang/en/uploadmail.txt
+++ b/inc/lang/en/uploadmail.txt
@@ -1,6 +1,7 @@
A file was uploaded to your DokuWiki. Here are the details:
File : @MEDIA@
+Old revision: @OLD@
Date : @DATE@
Browser : @BROWSER@
IP-Address : @IPADDRESS@
diff --git a/inc/media.php b/inc/media.php
index 731ba1668..451a205db 100644
--- a/inc/media.php
+++ b/inc/media.php
@@ -40,6 +40,7 @@ function media_filesinuse($data,$id){
* Handles the saving of image meta data
*
* @author Andreas Gohr <andi@splitbrain.org>
+ * @author Kate Arzamastseva <pshns@ukr.net>
*/
function media_metasave($id,$auth,$data){
if($auth < AUTH_UPLOAD) return false;
@@ -60,8 +61,19 @@ function media_metasave($id,$auth,$data){
}
}
+ $old = @filemtime($src);
+ if(!@file_exists(mediaFN($id, $old)) && @file_exists($src)) {
+ // add old revision to the attic
+ media_saveOldRevision($id);
+ }
+
if($meta->save()){
if($conf['fperm']) chmod($src, $conf['fperm']);
+
+ $new = @filemtime($src);
+ // add a log entry to the media changelog
+ addMediaLogEntry($new, $id, DOKU_CHANGE_TYPE_EDIT, $lang['media_meta_edited']);
+
msg($lang['metasaveok'],1);
return $id;
}else{
@@ -74,33 +86,35 @@ function media_metasave($id,$auth,$data){
* Display the form to edit image meta data
*
* @author Andreas Gohr <andi@splitbrain.org>
+ * @author Kate Arzamastseva <pshns@ukr.net>
*/
function media_metaform($id,$auth){
- if($auth < AUTH_UPLOAD) return false;
global $lang, $config_cascade;
+ if($auth < AUTH_UPLOAD) {
+ echo '<div class="nothing">'.$lang['media_perm_upload'].'</div>'.NL;
+ return false;
+ }
+
// load the field descriptions
static $fields = null;
if(is_null($fields)){
-
- foreach (array('default','local') as $config_group) {
- if (empty($config_cascade['mediameta'][$config_group])) continue;
- foreach ($config_cascade['mediameta'][$config_group] as $config_file) {
- if(@file_exists($config_file)){
- include($config_file);
- }
- }
+ $config_files = getConfigFiles('mediameta');
+ foreach ($config_files as $config_file) {
+ if(@file_exists($config_file)) include($config_file);
}
}
$src = mediaFN($id);
// output
- echo '<h1>'.hsc(noNS($id)).'</h1>'.NL;
- echo '<form action="'.DOKU_BASE.'lib/exe/mediamanager.php" accept-charset="utf-8" method="post" class="meta">'.NL;
+ $action = media_managerURL(array('tab_details' => 'view'));
+ echo '<form action="'.$action.'" id="mediamanager__save_meta" accept-charset="utf-8" method="post" class="meta">'.NL;
+
formSecurityToken();
foreach($fields as $key => $field){
// get current value
+ if (empty($field[0])) continue;
$tags = array($field[0]);
if(is_array($field[3])) $tags = array_merge($tags,$field[3]);
$value = tpl_img_getTag($tags,'',$src);
@@ -132,10 +146,11 @@ function media_metaform($id,$auth){
}
echo '<div class="buttons">'.NL;
echo '<input type="hidden" name="img" value="'.hsc($id).'" />'.NL;
- echo '<input name="do[save]" type="submit" value="'.$lang['btn_save'].
+ echo '<input type="hidden" name="mediado" value="save" />';
+
+ $do = 'mediado';
+ echo '<input name="'.$do.'[save]" type="submit" value="'.$lang['btn_save'].
'" title="'.$lang['btn_save'].' [S]" accesskey="s" class="button" />'.NL;
- echo '<input name="do[cancel]" type="submit" value="'.$lang['btn_cancel'].
- '" title="'.$lang['btn_cancel'].' [C]" accesskey="c" class="button" />'.NL;
echo '</div>'.NL;
echo '</form>'.NL;
}
@@ -178,6 +193,7 @@ define('DOKU_MEDIA_EMPTY_NS', 8);
DOKU_MEDIA_INUSE
*/
function media_delete($id,$auth){
+ global $lang;
if($auth < AUTH_DELETE) return DOKU_MEDIA_NOT_AUTH;
if(media_inuse($id)) return DOKU_MEDIA_INUSE;
@@ -193,9 +209,15 @@ function media_delete($id,$auth){
$data['del'] = false;
$evt = new Doku_Event('MEDIA_DELETE_FILE',$data);
if ($evt->advise_before()) {
+ $old = @filemtime($file);
+ if(!@file_exists(mediaFN($id, $old)) && @file_exists($file)) {
+ // add old revision to the attic
+ media_saveOldRevision($id);
+ }
+
$data['unl'] = @unlink($file);
if($data['unl']){
- addMediaLogEntry(time(), $id, DOKU_CHANGE_TYPE_DELETE);
+ addMediaLogEntry(time(), $id, DOKU_CHANGE_TYPE_DELETE, $lang['deleted']);
$data['del'] = io_sweepNS($id,'mediadir');
}
}
@@ -210,19 +232,58 @@ function media_delete($id,$auth){
}
/**
+ * Handle file uploads via XMLHttpRequest
+ *
+ * @return mixed false on error, id of the new file on success
+ */
+function media_upload_xhr($ns,$auth){
+ if(!checkSecurityToken()) return false;
+
+ $id = $_GET['qqfile'];
+ list($ext,$mime,$dl) = mimetype($id);
+ $input = fopen("php://input", "r");
+ $temp = tmpfile();
+ $realSize = stream_copy_to_stream($input, $temp);
+ fclose($input);
+ if ($realSize != (int)$_SERVER["CONTENT_LENGTH"]) return false;
+ if (!($tmp = io_mktmpdir())) return false;
+ $path = $tmp.'/'.md5($id);
+ $target = fopen($path, "w");
+ fseek($temp, 0, SEEK_SET);
+ stream_copy_to_stream($temp, $target);
+ fclose($target);
+ $res = media_save(
+ array('name' => $path,
+ 'mime' => $mime,
+ 'ext' => $ext),
+ $ns.':'.$id,
+ (($_REQUEST['ow'] == 'checked') ? true : false),
+ $auth,
+ 'copy'
+ );
+ unlink($path);
+ if ($tmp) dir_delete($tmp);
+ if (is_array($res)) {
+ msg($res[0], $res[1]);
+ return false;
+ }
+ return $res;
+}
+
+/**
* Handles media file uploads
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Michael Klier <chi@chimeric.de>
* @return mixed false on error, id of the new file on success
*/
-function media_upload($ns,$auth){
+function media_upload($ns,$auth,$file=false){
if(!checkSecurityToken()) return false;
global $lang;
// get file and id
- $id = $_POST['id'];
- $file = $_FILES['upload'];
+ $id = $_POST['mediaid'];
+ if (!$file) $file = $_FILES['upload'];
if(empty($id)) $id = $file['name'];
// check for errors (messages are done in lib/exe/mediamanager.php)
@@ -280,7 +341,7 @@ function media_save($file, $id, $ow, $auth, $move) {
}
}
- global $lang;
+ global $lang, $conf;
// get filename
$id = cleanID($id,false,true);
@@ -298,7 +359,8 @@ function media_save($file, $id, $ow, $auth, $move) {
//check for overwrite
$overwrite = @file_exists($fn);
- if($overwrite && (!$ow || $auth < AUTH_DELETE)) {
+ $auth_ow = (($conf['mediarevisions']) ? AUTH_UPLOAD : AUTH_DELETE);
+ if($overwrite && (!$ow || $auth < $auth_ow)) {
return array($lang['uploadexist'], 0);
}
// check for valid content
@@ -341,26 +403,38 @@ function _media_upload_action($data) {
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Michael Klier <chi@chimeric.de>
+ * @author Kate Arzamastseva <pshns@ukr.net>
*/
function media_upload_finish($fn_tmp, $fn, $id, $imime, $overwrite, $move = 'move_uploaded_file') {
global $conf;
global $lang;
+ global $REV;
+
+ $old = @filemtime($fn);
+ if(!@file_exists(mediaFN($id, $old)) && @file_exists($fn)) {
+ // add old revision to the attic if missing
+ media_saveOldRevision($id);
+ }
// prepare directory
io_createNamespace($id, 'media');
if($move($fn_tmp, $fn)) {
+ @clearstatcache(true,$fn);
+ $new = @filemtime($fn);
// Set the correct permission here.
// Always chmod media because they may be saved with different permissions than expected from the php umask.
// (Should normally chmod to $conf['fperm'] only if $conf['fperm'] is set.)
chmod($fn, $conf['fmode']);
msg($lang['uploadsucc'],1);
- media_notify($id,$fn,$imime);
+ media_notify($id,$fn,$imime,$old);
// add a log entry to the media changelog
- if ($overwrite) {
- addMediaLogEntry(time(), $id, DOKU_CHANGE_TYPE_EDIT);
+ if ($REV){
+ addMediaLogEntry($new, $id, DOKU_CHANGE_TYPE_REVERT, $lang['restored'], $REV);
+ } elseif ($overwrite) {
+ addMediaLogEntry($new, $id, DOKU_CHANGE_TYPE_EDIT);
} else {
- addMediaLogEntry(time(), $id, DOKU_CHANGE_TYPE_CREATE);
+ addMediaLogEntry($new, $id, DOKU_CHANGE_TYPE_CREATE, $lang['created']);
}
return $id;
}else{
@@ -369,6 +443,43 @@ function media_upload_finish($fn_tmp, $fn, $id, $imime, $overwrite, $move = 'mov
}
/**
+ * Moves the current version of media file to the media_attic
+ * directory
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ * @param string $id
+ * @return int - revision date
+ */
+function media_saveOldRevision($id){
+ global $conf, $lang;
+
+ $oldf = mediaFN($id);
+ if(!@file_exists($oldf)) return '';
+ $date = filemtime($oldf);
+ if (!$conf['mediarevisions']) return $date;
+
+ if (!getRevisionInfo($id, $date, 8192, true)) {
+ // there was an external edit,
+ // there is no log entry for current version of file
+ if (!@file_exists(mediaMetaFN($id,'.changes'))) {
+ addMediaLogEntry($date, $id, DOKU_CHANGE_TYPE_CREATE, $lang['created']);
+ } else {
+ addMediaLogEntry($date, $id, DOKU_CHANGE_TYPE_EDIT);
+ }
+ }
+
+ $newf = mediaFN($id,$date);
+ io_makeFileDir($newf);
+ if(copy($oldf, $newf)) {
+ // Set the correct permission here.
+ // Always chmod media because they may be saved with different permissions than expected from the php umask.
+ // (Should normally chmod to $conf['fperm'] only if $conf['fperm'] is set.)
+ chmod($newf, $conf['fmode']);
+ }
+ return $date;
+}
+
+/**
* This function checks if the uploaded content is really what the
* mimetype says it is. We also do spam checking for text types here.
*
@@ -416,7 +527,7 @@ function media_contentcheck($file,$mime){
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
-function media_notify($id,$file,$mime){
+function media_notify($id,$file,$mime,$old_rev=false){
global $lang;
global $conf;
global $INFO;
@@ -434,6 +545,11 @@ function media_notify($id,$file,$mime){
$text = str_replace('@MIME@',$mime,$text);
$text = str_replace('@MEDIA@',ml($id,'',true,'&',true),$text);
$text = str_replace('@SIZE@',filesize_h(filesize($file)),$text);
+ if ($old_rev && $conf['mediarevisions']) {
+ $text = str_replace('@OLD@', ml($id, "rev=$old_rev", true, '&', true), $text);
+ } else {
+ $text = str_replace('@OLD@', '', $text);
+ }
if(empty($conf['mailprefix'])) {
$subject = '['.$conf['title'].'] '.$lang['mail_upload'].' '.$id;
@@ -447,7 +563,7 @@ function media_notify($id,$file,$mime){
/**
* List all files in a given Media namespace
*/
-function media_filelist($ns,$auth=null,$jump=''){
+function media_filelist($ns,$auth=null,$jump='',$fullscreenview=false,$sort=false){
global $conf;
global $lang;
$ns = cleanID($ns);
@@ -455,26 +571,727 @@ function media_filelist($ns,$auth=null,$jump=''){
// check auth our self if not given (needed for ajax calls)
if(is_null($auth)) $auth = auth_quickaclcheck("$ns:*");
- echo '<h1 id="media__ns">:'.hsc($ns).'</h1>'.NL;
+ if (!$fullscreenview) echo '<h1 id="media__ns">:'.hsc($ns).'</h1>'.NL;
if($auth < AUTH_READ){
// FIXME: print permission warning here instead?
echo '<div class="nothing">'.$lang['nothingfound'].'</div>'.NL;
}else{
- media_uploadform($ns, $auth);
+ if (!$fullscreenview) media_uploadform($ns, $auth);
$dir = utf8_encodeFN(str_replace(':','/',$ns));
$data = array();
search($data,$conf['mediadir'],'search_media',
- array('showmsg'=>true,'depth'=>1),$dir);
+ array('showmsg'=>true,'depth'=>1),$dir,1,$sort);
if(!count($data)){
echo '<div class="nothing">'.$lang['nothingfound'].'</div>'.NL;
- }else foreach($data as $item){
- media_printfile($item,$auth,$jump);
+ }else {
+ if ($fullscreenview) {
+ $view = $_REQUEST['view'];
+ if ($view == 'list') {
+ echo '<ul class="mediamanager-list" id="mediamanager__file_list">';
+ } else {
+ echo '<ul class="mediamanager-thumbs" id="mediamanager__file_list">';
+ }
+ }
+ foreach($data as $item){
+ if (!$fullscreenview) {
+ media_printfile($item,$auth,$jump);
+ } else {
+ media_printfile_thumbs($item,$auth,$jump);
+ }
+ }
+ if ($fullscreenview) echo '</ul>';
+ }
+ }
+ if (!$fullscreenview) media_searchform($ns);
+}
+
+/**
+ * Prints mediamanager tab
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ * @param string $link - tab href
+ * @param string $class - tab css class
+ * @param string $name - tab caption
+ * @param boolean $selected - is tab selected
+ */
+function media_tab($link, $class, $name, $selected=false) {
+ if ($selected) $class .= ' selected';
+ $tab = '<a href="'.$link.'" class="'.$class.'" >'.$name.'</a>';
+ echo $tab;
+}
+
+/**
+ * Prints tabs for files list actions
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ * @param string $selected_tab - opened tab
+ */
+function media_tabs_files($selected_tab = ''){
+ global $lang;
+
+ echo '<div class="mediamanager-tabs" id="mediamanager__tabs_files">';
+
+ media_tab(media_managerURL(array('tab_files' => 'files')),
+ 'files', $lang['mediaselect'], ($selected_tab == 'files'));
+ media_tab(media_managerURL(array('tab_files' => 'upload')),
+ 'upload', $lang['media_uploadtab'], ($selected_tab == 'upload'));
+ media_tab(media_managerURL(array('tab_files' => 'search')),
+ 'search', $lang['media_searchtab'], ($selected_tab == 'search'));
+
+ echo '<div class="clearer"></div>';
+ echo '</div>';
+}
+
+/**
+ * Prints tabs for files details actions
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ * @param string $selected_tab - opened tab
+ */
+function media_tabs_details($image, $selected_tab = ''){
+ global $lang, $conf;
+
+ echo '<div class="mediamanager-tabs" id="mediamanager__tabs_details">';
+
+ media_tab(media_managerURL(array('tab_details' => 'view')),
+ 'view', $lang['media_viewtab'], ($selected_tab == 'view'));
+
+ list($ext, $mime) = mimetype($image);
+ if ($mime == 'image/jpeg' && @file_exists(mediaFN($image))) {
+ media_tab(media_managerURL(array('tab_details' => 'edit')),
+ 'edit', $lang['media_edittab'], ($selected_tab == 'edit'));
+ }
+ if ($conf['mediarevisions']) {
+ media_tab(media_managerURL(array('tab_details' => 'history')),
+ 'history', $lang['media_historytab'], ($selected_tab == 'history'));
+ }
+
+ echo '<div class="clearer"></div>';
+ echo '</div>';
+}
+
+/**
+ * Prints options for the tab that displays a list of all files
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ */
+function media_tab_files_options($ns, $sort){
+ global $lang;
+
+ echo '<div class="background-container">';
+
+ echo '<strong class="namespace">';
+ echo $ns ? $ns : '['.$lang['mediaroot'].']';
+ echo '</strong>';
+
+ echo '<div id="mediamanager__tabs_list">';
+
+ echo '<a href="'.media_managerURL(array('view' => 'thumbs')).'" id="mediamanager__link_thumbs" >';
+ echo $lang['media_thumbsview'];
+ echo '</a>';
+
+ echo '<a href="'.media_managerURL(array('view' => 'list')).'" id="mediamanager__link_list" >';
+ echo $lang['media_listview'];
+ echo '</a>';
+
+ echo '</div>';
+
+ echo '<div id="mediamanager__sort">';
+ $form = new Doku_Form(array('action'=>media_managerURL(array(), '&'), 'id' => 'mediamanager__form_sort'));
+ $form->addElement(form_makeListboxField(
+ 'sort',
+ array(
+ 'name' => $lang['media_sort_name'],
+ 'date' => $lang['media_sort_date']),
+ $sort,
+ $lang['media_sort']));
+ $form->addElement(form_makeButton('submit', '', $lang['btn_apply']));
+ $form->printForm();
+ echo '</div>';
+
+ echo '<div class="clearer"></div>';
+ echo '</div>';
+}
+
+/**
+ * Returns type of sorting for the list of files in media manager
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ * @return string - sort type
+ */
+function _media_get_sort_type() {
+ $sort = $_REQUEST['sort'];
+ if (!$sort && (strpos($_COOKIE['DOKU_PREFS'], 'sort') >= 0)) {
+ $parts = explode('#', $_COOKIE['DOKU_PREFS']);
+ for ($i = 0; $i < count($parts); $i+=2){
+ if ($parts[$i] == 'sort') $sort = $parts[$i+1];
+ }
+ }
+ return $sort;
+}
+
+/**
+ * Prints tab that displays a list of all files
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ */
+function media_tab_files($ns,$auth=null,$jump='') {
+ global $lang;
+ if(is_null($auth)) $auth = auth_quickaclcheck("$ns:*");
+
+ $sort = _media_get_sort_type();
+ media_tab_files_options($ns, $sort);
+
+ echo '<div class="scroll-container" >';
+ if($auth < AUTH_READ){
+ echo '<div class="nothing">'.$lang['media_perm_read'].'</div>'.NL;
+ }else{
+ media_filelist($ns,$auth,$jump,true,$sort);
+ }
+ echo '</div>';
+}
+
+/**
+ * Prints tab that displays uploading form
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ */
+function media_tab_upload($ns,$auth=null,$jump='') {
+ global $lang;
+ if(is_null($auth)) $auth = auth_quickaclcheck("$ns:*");
+
+ echo '<div class="background-container">';
+ echo sprintf($lang['media_upload'], $ns ? $ns : '['.$lang['mediaroot'].']');
+ echo '</div>';
+
+ echo '<div class="scroll-container">';
+ if ($auth >= AUTH_UPLOAD) echo '<div class="upload">' . $lang['mediaupload'] . '</div>';
+ media_uploadform($ns, $auth, true);
+ echo '</div>';
+}
+
+/**
+ * Prints tab that displays search form
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ */
+function media_tab_search($ns,$auth=null) {
+ global $lang;
+
+ $do = $_REQUEST['mediado'];
+ $query = $_REQUEST['q'];
+ if (!$query) $query = '';
+
+ $sort = _media_get_sort_type();
+ media_tab_files_options($ns, $sort);
+
+ echo '<div class="scroll-container">';
+ media_searchform($ns, $query, true);
+ if ($do == 'searchlist') media_searchlist($query,$ns,$auth,true,$sort);
+ echo '</div>';
+}
+
+/**
+ * Prints tab that displays mediafile details
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ */
+function media_tab_view($image, $ns, $auth=null, $rev=false) {
+ global $lang, $conf;
+ if(is_null($auth)) $auth = auth_quickaclcheck("$ns:*");
+
+ echo '<div class="background-container">';
+ list($ext,$mime,$dl) = mimetype($image,false);
+ $class = preg_replace('/[^_\-a-z0-9]+/i','_',$ext);
+ $class = 'select mediafile mf_'.$class;
+ echo '<span class="'.$class.'" >'.$image.'</span>';
+ echo '</div>';
+
+ echo '<div class="scroll-container">';
+ if ($image && $auth >= AUTH_READ) {
+ $meta = new JpegMeta(mediaFN($image, $rev));
+ media_preview($image, $auth, $rev, $meta);
+ media_preview_buttons($image, $auth, $rev);
+ media_details($image, $auth, $rev, $meta);
+
+ } else {
+ echo '<div class="nothing">'.$lang['media_perm_read'].'</div>';
+ }
+ echo '</div>';
+}
+
+/**
+ * Prints tab that displays form for editing mediafile metadata
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ */
+function media_tab_edit($image, $ns, $auth=null) {
+ global $lang;
+ if(is_null($auth)) $auth = auth_quickaclcheck("$ns:*");
+
+ echo '<div class="background-container">';
+ echo $lang['media_edit'];
+ echo '</div>';
+
+ echo '<div class="scroll-container">';
+ if ($image) {
+ list($ext, $mime) = mimetype($image);
+ if ($mime == 'image/jpeg') media_metaform($image,$auth);
+ }
+ echo '</div>';
+}
+
+/**
+ * Prints tab that displays mediafile revisions
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ */
+function media_tab_history($image, $ns, $auth=null) {
+ global $lang;
+ if(is_null($auth)) $auth = auth_quickaclcheck("$ns:*");
+ $do = $_REQUEST['mediado'];
+
+ echo '<div class="background-container">';
+ echo $lang['media_history'];
+ echo '</div>';
+
+ echo '<div class="scroll-container">';
+ if ($auth >= AUTH_READ && $image) {
+ if ($do == 'diff'){
+ media_diff($image, $ns, $auth);
+ } else {
+ $first = isset($_REQUEST['first']) ? intval($_REQUEST['first']) : 0;
+ html_revisions($first, $image);
+ }
+ } else {
+ echo '<div class="nothing">'.$lang['media_perm_read'].'</div>'.NL;
+ }
+ echo '</div>';
+}
+
+/**
+ * Prints mediafile details
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ */
+function media_preview($image, $auth, $rev=false, $meta=false) {
+ global $lang;
+
+ echo '<div class="mediamanager__preview">';
+
+ $size = media_image_preview_size($image, $rev, $meta);
+
+ if ($size) {
+ $more = array();
+ if ($rev) {
+ $more['rev'] = $rev;
+ } else {
+ $t = @filemtime(mediaFN($image));
+ $more['t'] = $t;
+ }
+
+ $more['w'] = $size[0];
+ $more['h'] = $size[1];
+ $src = ml($image, $more);
+ echo '<img src="'.$src.'" alt="'.$image.'" style="max-width: '.$size[0].'px;" />';
+ }
+
+ echo '</div>';
+}
+
+/**
+ * Prints mediafile action buttons
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ */
+function media_preview_buttons($image, $auth, $rev=false) {
+ global $lang, $conf;
+
+ echo '<div class="mediamanager__preview_buttons">';
+
+ $more = '';
+ if ($rev) {
+ $more = "rev=$rev";
+ } else {
+ $t = @filemtime(mediaFN($image));
+ $more = "t=$t";
+ }
+ $link = ml($image,$more,true,'&');
+
+ if (@file_exists(mediaFN($image, $rev))) {
+
+ // view original file button
+ $form = new Doku_Form(array('action'=>$link, 'target'=>'_blank'));
+ $form->addElement(form_makeButton('submit','',$lang['mediaview']));
+ $form->printForm();
+ }
+
+ if($auth >= AUTH_DELETE && !$rev && @file_exists(mediaFN($image))){
+
+ // delete button
+ $form = new Doku_Form(array('id' => 'mediamanager__btn_delete',
+ 'action'=>media_managerURL(array('delete' => $image), '&')));
+ $form->addElement(form_makeButton('submit','',$lang['btn_delete']));
+ $form->printForm();
+
+ }
+
+ $auth_ow = (($conf['mediarevisions']) ? AUTH_UPLOAD : AUTH_DELETE);
+ if($auth >= $auth_ow && !$rev){
+
+ // upload new version button
+ $form = new Doku_Form(array('id' => 'mediamanager__btn_update',
+ 'action'=>media_managerURL(array('image' => $image, 'mediado' => 'update'), '&')));
+ $form->addElement(form_makeButton('submit','',$lang['media_update']));
+ $form->printForm();
+ }
+
+ if($auth >= AUTH_UPLOAD && $rev && $conf['mediarevisions'] && @file_exists(mediaFN($image, $rev))){
+
+ // restore button
+ $form = new Doku_Form(array('id' => 'mediamanager__btn_restore',
+ 'action'=>media_managerURL(array('image' => $image), '&')));
+ $form->addHidden('mediado','restore');
+ $form->addHidden('rev',$rev);
+ $form->addElement(form_makeButton('submit','',$lang['media_restore']));
+ $form->printForm();
+ }
+
+ echo '</div>';
+}
+
+/**
+ * Returns image width and height for mediamanager preview panel
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ * @param string $image
+ * @param int $rev
+ * @param JpegMeta $meta
+ * @return array
+ */
+function media_image_preview_size($image, $rev, $meta, $size = 500) {
+ if (!preg_match("/\.(jpe?g|gif|png)$/", $image) || !file_exists(mediaFN($image, $rev))) return false;
+
+ $info = getimagesize(mediaFN($image, $rev));
+ $w = (int) $info[0];
+ $h = (int) $info[1];
+
+ if($meta && ($w > $size || $h > $size)){
+ $ratio = $meta->getResizeRatio($size, $size);
+ $w = floor($w * $ratio);
+ $h = floor($h * $ratio);
+ }
+ return array($w, $h);
+}
+
+/**
+ * Returns the requested EXIF/IPTC tag from the image meta
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ * @param array $tags
+ * @param JpegMeta $meta
+ * @param string $alt
+ * @return string
+ */
+function media_getTag($tags,$meta,$alt=''){
+ if($meta === false) return $alt;
+ $info = $meta->getField($tags);
+ if($info == false) return $alt;
+ return $info;
+}
+
+/**
+ * Returns mediafile tags
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ * @param JpegMeta $meta
+ * @return array
+ */
+function media_file_tags($meta) {
+ global $config_cascade;
+
+ // load the field descriptions
+ static $fields = null;
+ if(is_null($fields)){
+ $config_files = getConfigFiles('mediameta');
+ foreach ($config_files as $config_file) {
+ if(@file_exists($config_file)) include($config_file);
+ }
+ }
+
+ $tags = array();
+
+ foreach($fields as $key => $tag){
+ $t = array();
+ if (!empty($tag[0])) $t = array($tag[0]);
+ if(is_array($tag[3])) $t = array_merge($t,$tag[3]);
+ $value = media_getTag($t, $meta);
+ $tags[] = array('tag' => $tag, 'value' => $value);
+ }
+
+ return $tags;
+}
+
+/**
+ * Prints mediafile tags
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ */
+function media_details($image, $auth, $rev=false, $meta=false) {
+ global $lang;
+
+ if (!$meta) $meta = new JpegMeta(mediaFN($image, $rev));
+ $tags = media_file_tags($meta);
+
+ echo '<dl class="img_tags">';
+ foreach($tags as $tag){
+ if ($tag['value']) {
+ $value = cleanText($tag['value']);
+ echo '<dt>'.$lang[$tag['tag'][1]].':</dt><dd>';
+ if ($tag['tag'][2] == 'date') echo dformat($value);
+ else echo hsc($value);
+ echo '</dd>';
}
}
- media_searchform($ns);
+ echo '</dl>';
+}
+
+/**
+ * Shows difference between two revisions of file
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ */
+function media_diff($image, $ns, $auth, $fromajax = false) {
+ global $lang;
+ global $conf;
+
+ if ($auth < AUTH_READ || !$image || !$conf['mediarevisions']) return '';
+
+ $rev1 = (int) $_REQUEST['rev'];
+
+ if(is_array($_REQUEST['rev2'])){
+ $rev1 = (int) $_REQUEST['rev2'][0];
+ $rev2 = (int) $_REQUEST['rev2'][1];
+
+ if(!$rev1){
+ $rev1 = $rev2;
+ unset($rev2);
+ }
+ }else{
+ $rev2 = (int) $_REQUEST['rev2'];
+ }
+
+ if ($rev1 && !file_exists(mediaFN($image, $rev1))) $rev1 = false;
+ if ($rev2 && !file_exists(mediaFN($image, $rev2))) $rev2 = false;
+
+ if($rev1 && $rev2){ // two specific revisions wanted
+ // make sure order is correct (older on the left)
+ if($rev1 < $rev2){
+ $l_rev = $rev1;
+ $r_rev = $rev2;
+ }else{
+ $l_rev = $rev2;
+ $r_rev = $rev1;
+ }
+ }elseif($rev1){ // single revision given, compare to current
+ $r_rev = '';
+ $l_rev = $rev1;
+ }else{ // no revision was given, compare previous to current
+ $r_rev = '';
+ $revs = getRevisions($image, 0, 1, 8192, true);
+ if (file_exists(mediaFN($image, $revs[0]))) {
+ $l_rev = $revs[0];
+ } else {
+ $l_rev = '';
+ }
+ }
+
+ // prepare event data
+ $data[0] = $image;
+ $data[1] = $l_rev;
+ $data[2] = $r_rev;
+ $data[3] = $ns;
+ $data[4] = $auth;
+ $data[5] = $fromajax;
+
+ // trigger event
+ return trigger_event('MEDIA_DIFF', $data, '_media_file_diff', true);
+
+}
+
+function _media_file_diff($data) {
+ if(is_array($data) && count($data)===6) {
+ return media_file_diff($data[0], $data[1], $data[2], $data[3], $data[4], $data[5]);
+ } else {
+ return false;
+ }
+}
+
+/**
+ * Shows difference between two revisions of image
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ */
+function media_file_diff($image, $l_rev, $r_rev, $ns, $auth, $fromajax){
+ global $lang, $config_cascade;
+
+ $l_meta = new JpegMeta(mediaFN($image, $l_rev));
+ $r_meta = new JpegMeta(mediaFN($image, $r_rev));
+
+ $is_img = preg_match("/\.(jpe?g|gif|png)$/", $image);
+ if ($is_img) {
+ $l_size = media_image_preview_size($image, $l_rev, $l_meta);
+ $r_size = media_image_preview_size($image, $r_rev, $r_meta);
+ $is_img = ($l_size && $r_size && ($l_size[0] >= 30 || $r_size[0] >= 30));
+
+ $difftype = $_REQUEST['difftype'];
+
+ if (!$fromajax) {
+ $form = new Doku_Form(array('action'=>media_managerURL(array(), '&'),
+ 'id' => 'mediamanager__form_diffview'));
+ $form->addElement('<input type="hidden" name="rev2[]" value="'.$l_rev.'" ></input>');
+ $form->addElement('<input type="hidden" name="rev2[]" value="'.$r_rev.'" ></input>');
+ $form->addHidden('mediado', 'diff');
+ $form->printForm();
+
+ echo '<div id="mediamanager__diff" >';
+ }
+
+ if ($difftype == 'opacity' || $difftype == 'portions') {
+ media_image_diff($image, $l_rev, $r_rev, $l_size, $r_size, $difftype);
+ if (!$fromajax) echo '</div>';
+ return '';
+ }
+ }
+
+ echo '<div class="mediamanager-preview">';
+ echo '<ul id="mediamanager__diff_table">';
+
+ echo '<li>';
+ media_preview($image, $auth, $l_rev, $l_meta);
+ echo '</li>';
+
+ echo '<li>';
+ media_preview($image, $auth, $r_rev, $r_meta);
+ echo '</li>';
+
+ echo '<li>';
+ media_preview_buttons($image, $auth, $l_rev);
+ echo '</li>';
+
+ echo '<li>';
+ media_preview_buttons($image, $auth, $r_rev);
+ echo '</li>';
+
+ $l_tags = media_file_tags($l_meta);
+ $r_tags = media_file_tags($r_meta);
+ foreach ($l_tags as $key => $l_tag) {
+ if ($l_tag['value'] != $r_tags[$key]['value']) {
+ $r_tags[$key]['class'] = 'highlighted';
+ $l_tags[$key]['class'] = 'highlighted';
+ } else if (!$l_tag['value'] || !$r_tags[$key]['value']) {
+ unset($r_tags[$key]);
+ unset($l_tags[$key]);
+ }
+ }
+
+ foreach(array($l_tags,$r_tags) as $tags){
+ echo '<li><div>';
+
+ echo '<dl class="img_tags">';
+ foreach($tags as $tag){
+ $value = cleanText($tag['value']);
+ if (!$value) $value = '-';
+ echo '<dt>'.$lang[$tag['tag'][1]].':</dt>';
+ echo '<dd class="'.$tag['class'].'" >';
+ if ($tag['tag'][2] == 'date') echo dformat($value);
+ else echo hsc($value);
+ echo '</dd>';
+ }
+ echo '</dl>';
+
+ echo '</div></li>';
+ }
+
+ echo '</ul>';
+ echo '</div>';
+
+ if ($is_img && !$fromajax) echo '</div>';
+}
+
+/**
+ * Prints two images side by side
+ * and slider
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ * @param string $image
+ * @param int $l_rev
+ * @param int $r_rev
+ * @param array $l_size
+ * @param array $r_size
+ * @param string $type
+ */
+function media_image_diff($image, $l_rev, $r_rev, $l_size, $r_size, $type) {
+ if ($l_size != $r_size) {
+ if ($r_size[0] > $l_size[0]) {
+ $l_size = $r_size;
+ }
+ }
+
+ echo '<div class="mediamanager-preview">';
+
+ $l_more = array('rev' => $l_rev, 'h' => $l_size[1], 'w' => $l_size[0]);
+ $r_more = array('rev' => $r_rev, 'h' => $l_size[1], 'w' => $l_size[0]);
+
+ $l_src = ml($image, $l_more);
+ $r_src = ml($image, $r_more);
+
+ // slider
+ echo '<div id="mediamanager__'.$type.'_slider" style="max-width: '.($l_size[0]-20).'px;" ></div>';
+
+ // two image's in div's
+ echo '<div id="mediamanager__diff_layout">';
+ echo '<div id="mediamanager__diff_'.$type.'_image1" style="max-width: '.$l_size[0].'px;">';
+ echo '<img src="'.$l_src.'" alt="" />';
+ echo '</div>';
+ echo '<div id="mediamanager__diff_'.$type.'_image2" style="max-width: '.$l_size[0].'px;">';
+ echo '<img src="'.$r_src.'" alt="" />';
+ echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
+}
+
+/**
+ * Restores an old revision of a media file
+ *
+ * @param string $image
+ * @param int $rev
+ * @param int $auth
+ * @return string - file's id
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ */
+function media_restore($image, $rev, $auth){
+ global $conf;
+ if ($auth < AUTH_UPLOAD || !$conf['mediarevisions']) return false;
+ $removed = (!file_exists(mediaFN($image)) && file_exists(mediaMetaFN($image, '.changes')));
+ if (!$image || (!file_exists(mediaFN($image)) && !$removed)) return false;
+ if (!$rev || !file_exists(mediaFN($image, $rev))) return false;
+ list($iext,$imime,$dl) = mimetype($image);
+ $res = media_upload_finish(mediaFN($image, $rev),
+ mediaFN($image),
+ $image,
+ $imime,
+ true,
+ 'copy');
+ if (is_array($res)) {
+ msg($res[0], $res[1]);
+ return false;
+ }
+ return $res;
}
/**
@@ -482,11 +1299,13 @@ function media_filelist($ns,$auth=null,$jump=''){
*
* @author Tobias Sarnowski <sarnowski@cosmocode.de>
* @author Andreas Gohr <gohr@cosmocode.de>
+ * @author Kate Arzamastseva <pshns@ukr.net>
* @triggers MEDIA_SEARCH
*/
-function media_searchlist($query,$ns,$auth=null){
+function media_searchlist($query,$ns,$auth=null,$fullscreen=false,$sort=''){
global $conf;
global $lang;
+
$ns = cleanID($ns);
if ($query) {
@@ -505,50 +1324,39 @@ function media_searchlist($query,$ns,$auth=null){
array('showmsg'=>false,'pattern'=>$pattern),
$dir);
}
+
+ $data = array();
+ foreach ($evdata['data'] as $k => $v) {
+ $data[$k] = ($sort == 'date') ? $v['mtime'] : $v['id'];
+ }
+ array_multisort($data, SORT_DESC, SORT_NUMERIC, $evdata['data']);
+
$evt->advise_after();
unset($evt);
}
- echo '<h1 id="media__ns">'.sprintf($lang['searchmedia_in'],hsc($ns).':*').'</h1>'.NL;
- media_searchform($ns,$query);
+ if (!$fullscreen) {
+ echo '<h1 id="media__ns">'.sprintf($lang['searchmedia_in'],hsc($ns).':*').'</h1>'.NL;
+ media_searchform($ns,$query);
+ }
if(!count($evdata['data'])){
echo '<div class="nothing">'.$lang['nothingfound'].'</div>'.NL;
- }else foreach($evdata['data'] as $item){
- media_printfile($item,$item['perm'],'',true);
- }
-}
-
-/**
- * Print action links for a file depending on filetype
- * and available permissions
- */
-function media_fileactions($item,$auth){
- global $lang;
-
- // view button
- $link = ml($item['id'],'',true);
- echo ' <a href="'.$link.'" target="_blank"><img src="'.DOKU_BASE.'lib/images/magnifier.png" '.
- 'alt="'.$lang['mediaview'].'" title="'.$lang['mediaview'].'" class="btn" /></a>';
-
- // no further actions if not writable
- if(!$item['writable']) return;
-
- // delete button
- if($auth >= AUTH_DELETE){
- echo ' <a href="'.DOKU_BASE.'lib/exe/mediamanager.php?delete='.rawurlencode($item['id']).
- '&amp;sectok='.getSecurityToken().'" class="btn_media_delete" title="'.$item['id'].'">'.
- '<img src="'.DOKU_BASE.'lib/images/trash.png" alt="'.$lang['btn_delete'].'" '.
- 'title="'.$lang['btn_delete'].'" class="btn" /></a>';
- }
-
- // edit button
- if($auth >= AUTH_UPLOAD && $item['isimg'] && $item['meta']->getField('File.Mime') == 'image/jpeg'){
- echo ' <a href="'.DOKU_BASE.'lib/exe/mediamanager.php?edit='.rawurlencode($item['id']).'">'.
- '<img src="'.DOKU_BASE.'lib/images/pencil.png" alt="'.$lang['metaedit'].'" '.
- 'title="'.$lang['metaedit'].'" class="btn" /></a>';
+ }else {
+ if ($fullscreen) {
+ $view = $_REQUEST['view'];
+ if ($view == 'list') {
+ echo '<ul class="mediamanager-list" id="mediamanager__file_list">';
+ } else {
+ echo '<ul class="mediamanager-thumbs" id="mediamanager__file_list">';
+ }
+ }
+ foreach($evdata['data'] as $item){
+ if (!$fullscreen) media_printfile($item,$item['perm'],'',true);
+ else media_printfile_thumbs($item,$item['perm'],false,true);
+ }
+ if ($fullscreen) echo '</ul>';
}
-
}
/**
@@ -599,7 +1407,12 @@ function media_printfile($item,$auth,$jump,$display_namespace=false){
echo '<a name="h_:'.$item['id'].'" class="'.$class.'">'.hsc($item['id']).'</a><br/>';
}
echo '<span class="info">('.$info.')</span>'.NL;
- media_fileactions($item,$auth);
+
+ // view button
+ $link = ml($item['id'],'',true);
+ echo ' <a href="'.$link.'" target="_blank"><img src="'.DOKU_BASE.'lib/images/magnifier.png" '.
+ 'alt="'.$lang['mediaview'].'" title="'.$lang['mediaview'].'" class="btn" /></a>';
+
echo '<div class="example" id="ex_'.str_replace(':','_',$item['id']).'">';
echo $lang['mediausage'].' <code>{{:'.$item['id'].'}}</code>';
echo '</div>';
@@ -608,27 +1421,113 @@ function media_printfile($item,$auth,$jump,$display_namespace=false){
echo '</div>'.NL;
}
+function media_printicon($filename){
+ list($ext,$mime,$dl) = mimetype(mediaFN($filename),false);
+
+ if (@file_exists(DOKU_INC.'lib/images/fileicons/'.$ext.'.png')) {
+ $icon = DOKU_BASE.'lib/images/fileicons/'.$ext.'.png';
+ } else {
+ $icon = DOKU_BASE.'lib/images/fileicons/file.png';
+ }
+
+ return '<img src="'.$icon.'" alt="'.$filename.'" class="icon" />';
+
+}
+
+/**
+ * Formats and prints one file in the list in the thumbnails view
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ */
+function media_printfile_thumbs($item,$auth,$jump=false,$display_namespace=false){
+ global $lang;
+ global $conf;
+
+ // Prepare filename
+ $file = utf8_decodeFN($item['file']);
+
+ // output
+ echo '<li><div>';
+
+ if($item['isimg']) {
+ media_printimgdetail($item, true);
+
+ } else {
+ echo '<a name="d_:'.$item['id'].'" class="image" title="'.$item['id'].'" href="'.
+ media_managerURL(array('image' => hsc($item['id']), 'ns' => getNS($item['id']),
+ 'tab_details' => 'view')).'"><span>';
+ echo media_printicon($item['id']);
+ echo '</span></a>';
+ }
+ //echo '<input type=checkbox />';
+ if (!$display_namespace) {
+ $name = hsc($file);
+ } else {
+ $name = hsc($item['id']);
+ }
+ echo '<a href="'.media_managerURL(array('image' => hsc($item['id']), 'ns' => getNS($item['id']),
+ 'tab_details' => 'view')).'" name="h_:'.$item['id'].'" class="name">'.$name.'</a>';
+
+ if($item['isimg']){
+ $size = '';
+ $size .= (int) $item['meta']->getField('File.Width');
+ $size .= '&#215;';
+ $size .= (int) $item['meta']->getField('File.Height');
+ echo '<span class="size">'.$size.'</span>';
+ } else {
+ echo '<span class="size">&nbsp;</span>';
+ }
+ $date = dformat($item['mtime']);
+ echo '<span class="date">'.$date.'</span>';
+ $filesize = filesize_h($item['size']);
+ echo '<span class="filesize">'.$filesize.'</span>';
+ echo '<div class="clearer"></div>';
+ echo '</div></li>'.NL;
+}
+
/**
* Prints a thumbnail and metainfos
*/
-function media_printimgdetail($item){
+function media_printimgdetail($item, $fullscreen=false){
// prepare thumbnail
- $w = (int) $item['meta']->getField('File.Width');
- $h = (int) $item['meta']->getField('File.Height');
- if($w>120 || $h>120){
- $ratio = $item['meta']->getResizeRatio(120);
- $w = floor($w * $ratio);
- $h = floor($h * $ratio);
+ if (!$fullscreen) {
+ $size_array[] = 120;
+ } else {
+ $size_array = array(90, 40);
+ }
+ foreach ($size_array as $index => $size) {
+ $w = (int) $item['meta']->getField('File.Width');
+ $h = (int) $item['meta']->getField('File.Height');
+ if($w>$size || $h>$size){
+ if (!$fullscreen) {
+ $ratio = $item['meta']->getResizeRatio($size);
+ } else {
+ $ratio = $item['meta']->getResizeRatio($size,$size);
+ }
+ $w = floor($w * $ratio);
+ $h = floor($h * $ratio);
+ }
+ $src = ml($item['id'],array('w'=>$w,'h'=>$h,'t'=>$item['mtime']));
+ $p = array();
+ if (!$fullscreen) {
+ $p['width'] = $w;
+ $p['height'] = $h;
+ }
+ $p['alt'] = $item['id'];
+ $p['class'] = 'thumb';
+ $att = buildAttributes($p);
+
+ // output
+ if ($fullscreen) {
+ echo '<a name="'.($index ? 'd' : 'l').'_:'.$item['id'].'" class="image'.$index.'" title="'.$item['id'].'" href="'.
+ media_managerURL(array('image' => hsc($item['id']), 'ns' => getNS($item['id']), 'tab_details' => 'view')).'">';
+ echo '<span><img src="'.$src.'" '.$att.' /></span>';
+ echo '</a>';
+ }
}
- $src = ml($item['id'],array('w'=>$w,'h'=>$h));
- $p = array();
- $p['width'] = $w;
- $p['height'] = $h;
- $p['alt'] = $item['id'];
- $p['class'] = 'thumb';
- $att = buildAttributes($p);
- // output
+ if ($fullscreen) return '';
+
echo '<div class="detail">';
echo '<div class="thumb">';
echo '<a name="d_:'.$item['id'].'" class="select">';
@@ -656,90 +1555,118 @@ function media_printimgdetail($item){
}
/**
+ * Build link based on the current, adding/rewriting
+ * parameters
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ * @param array $params
+ * @param string $amp - separator
+ * @return string - link
+ */
+function media_managerURL($params=false, $amp='&amp;', $abs=false, $params_array=false) {
+ global $conf;
+ global $ID;
+
+ $gets = array('do' => 'media');
+ $media_manager_params = array('tab_files', 'tab_details', 'image', 'ns', 'view');
+ foreach ($media_manager_params as $x) {
+ if (isset($_REQUEST[$x])) $gets[$x] = $_REQUEST[$x];
+ }
+
+ if ($params) {
+ foreach ($params as $k => $v) {
+ $gets[$k] = $v;
+ }
+ }
+ unset($gets['id']);
+ if ($gets['delete']) {
+ unset($gets['image']);
+ unset($gets['tab_details']);
+ }
+
+ if ($params_array) return $gets;
+
+ return wl($ID,$gets,$abs,$amp);
+}
+
+/**
* Print the media upload form if permissions are correct
*
* @author Andreas Gohr <andi@splitbrain.org>
+ * @author Kate Arzamastseva <pshns@ukr.net>
*/
-function media_uploadform($ns, $auth){
- global $lang;
+function media_uploadform($ns, $auth, $fullscreen = false){
+ global $lang, $conf;
- if($auth < AUTH_UPLOAD) return; //fixme print info on missing permissions?
+ if($auth < AUTH_UPLOAD) {
+ echo '<div class="nothing">'.$lang['media_perm_upload'].'</div>'.NL;
+ return;
+ }
+ $auth_ow = (($conf['mediarevisions']) ? AUTH_UPLOAD : AUTH_DELETE);
+
+ $update = false;
+ $id = '';
+ if ($auth >= $auth_ow && $fullscreen && $_REQUEST['mediado'] == 'update') {
+ $update = true;
+ $id = cleanID($_REQUEST['image']);
+ }
// The default HTML upload form
- $form = new Doku_Form(array('id' => 'dw__upload',
- 'action' => DOKU_BASE.'lib/exe/mediamanager.php',
- 'enctype' => 'multipart/form-data'));
- $form->addElement('<div class="upload">' . $lang['mediaupload'] . '</div>');
+ $params = array('id' => 'dw__upload',
+ 'enctype' => 'multipart/form-data');
+ if (!$fullscreen) {
+ $params['action'] = DOKU_BASE.'lib/exe/mediamanager.php';
+ } else {
+ $params['action'] = media_managerURL(array('tab_files' => 'files',
+ 'tab_details' => 'view'), '&');
+ }
+
+ $form = new Doku_Form($params);
+ if (!$fullscreen) echo '<div class="upload">' . $lang['mediaupload'] . '</div>';
$form->addElement(formSecurityToken());
$form->addHidden('ns', hsc($ns));
$form->addElement(form_makeOpenTag('p'));
$form->addElement(form_makeFileField('upload', $lang['txt_upload'].':', 'upload__file'));
$form->addElement(form_makeCloseTag('p'));
$form->addElement(form_makeOpenTag('p'));
- $form->addElement(form_makeTextField('id', '', $lang['txt_filename'].':', 'upload__name'));
+ $form->addElement(form_makeTextField('mediaid', noNS($id), $lang['txt_filename'].':', 'upload__name'));
$form->addElement(form_makeButton('submit', '', $lang['btn_upload']));
$form->addElement(form_makeCloseTag('p'));
- if($auth >= AUTH_DELETE){
+ if($auth >= $auth_ow){
$form->addElement(form_makeOpenTag('p'));
- $form->addElement(form_makeCheckboxField('ow', 1, $lang['txt_overwrt'], 'dw__ow', 'check'));
+ $attrs = array();
+ if ($update) $attrs['checked'] = 'checked';
+ $form->addElement(form_makeCheckboxField('ow', 1, $lang['txt_overwrt'], 'dw__ow', 'check', $attrs));
$form->addElement(form_makeCloseTag('p'));
}
- html_form('upload', $form);
- // prepare flashvars for multiupload
- $opt = array(
- 'L_gridname' => $lang['mu_gridname'] ,
- 'L_gridsize' => $lang['mu_gridsize'] ,
- 'L_gridstat' => $lang['mu_gridstat'] ,
- 'L_namespace' => $lang['mu_namespace'] ,
- 'L_overwrite' => $lang['txt_overwrt'],
- 'L_browse' => $lang['mu_browse'],
- 'L_upload' => $lang['btn_upload'],
- 'L_toobig' => $lang['mu_toobig'],
- 'L_ready' => $lang['mu_ready'],
- 'L_done' => $lang['mu_done'],
- 'L_fail' => $lang['mu_fail'],
- 'L_authfail' => $lang['mu_authfail'],
- 'L_progress' => $lang['mu_progress'],
- 'L_filetypes' => $lang['mu_filetypes'],
- 'L_info' => $lang['mu_info'],
- 'L_lasterr' => $lang['mu_lasterr'],
-
- 'O_ns' => ":$ns",
- 'O_backend' => 'mediamanager.php?'.session_name().'='.session_id(),
- 'O_maxsize' => php_to_byte(ini_get('upload_max_filesize')),
- 'O_extensions'=> join('|',array_keys(getMimeTypes())),
- 'O_overwrite' => ($auth >= AUTH_DELETE),
- 'O_sectok' => getSecurityToken(),
- 'O_authtok' => auth_createToken(),
- );
- $var = buildURLparams($opt);
- // output the flash uploader
- ?>
- <div id="dw__flashupload" style="display:none">
- <div class="upload"><?php echo $lang['mu_intro']?></div>
- <?php echo html_flashobject('multipleUpload.swf','500','190',null,$opt); ?>
- </div>
- <?php
+ echo '<div id="mediamanager__uploader">';
+ html_form('upload', $form);
+ echo '</div>';
}
/**
* Print the search field form
*
* @author Tobias Sarnowski <sarnowski@cosmocode.de>
+ * @author Kate Arzamastseva <pshns@ukr.net>
*/
-function media_searchform($ns,$query=''){
+function media_searchform($ns,$query='',$fullscreen=false){
global $lang;
// The default HTML search form
- $form = new Doku_Form(array('id' => 'dw__mediasearch', 'action' => DOKU_BASE.'lib/exe/mediamanager.php'));
- $form->addElement('<div class="upload">' . $lang['mediasearch'] . '</div>');
+ $params = array('id' => 'dw__mediasearch');
+ if (!$fullscreen) $params['action'] = DOKU_BASE.'lib/exe/mediamanager.php';
+ else $params['action'] = media_managerURL(array(), '&');
+ $form = new Doku_Form($params);
+ if (!$fullscreen) $form->addElement('<div class="upload">' . $lang['mediasearch'] . '</div>');
$form->addElement(formSecurityToken());
$form->addHidden('ns', $ns);
- $form->addHidden('do', 'searchlist');
+ if (!$fullscreen) $form->addHidden('do', 'searchlist');
+ else $form->addHidden('mediado', 'searchlist');
$form->addElement(form_makeOpenTag('p'));
- $form->addElement(form_makeTextField('q', $query,$lang['searchmedia'],'','',array('title'=>sprintf($lang['searchmedia_in'],hsc($ns).':*'))));
+ $form->addElement(form_makeTextField('q', $query,$lang['searchmedia'],'mediamanager__sort_textfield','',array('title'=>sprintf($lang['searchmedia_in'],hsc($ns).':*'))));
$form->addElement(form_makeButton('submit', '', $lang['btn_search']));
$form->addElement(form_makeCloseTag('p'));
html_form('searchmedia', $form);
@@ -786,7 +1713,10 @@ function media_nstree_item($item){
if(!$item['label']) $item['label'] = $label;
$ret = '';
+ if (!($_REQUEST['do'] == 'media'))
$ret .= '<a href="'.DOKU_BASE.'lib/exe/mediamanager.php?ns='.idfilter($item['id']).'" class="idx_dir">';
+ else $ret .= '<a href="'.media_managerURL(array('ns' => idfilter($item['id']), 'tab_files' => 'files'))
+ .'" class="idx_dir">';
$ret .= $item['label'];
$ret .= '</a>';
return $ret;
diff --git a/inc/pageutils.php b/inc/pageutils.php
index c9bf60135..81dcb66e7 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -295,8 +295,6 @@ function wikiLockFN($id) {
/**
* returns the full path to the meta file specified by ID and extension
*
- * The filename is URL encoded to protect Unicode chars
- *
* @author Steven Danz <steven-danz@kc.rr.com>
*/
function metaFN($id,$ext){
@@ -308,6 +306,19 @@ function metaFN($id,$ext){
}
/**
+ * returns the full path to the media's meta file specified by ID and extension
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ */
+function mediaMetaFN($id,$ext){
+ global $conf;
+ $id = cleanID($id);
+ $id = str_replace(':','/',$id);
+ $fn = $conf['mediametadir'].'/'.utf8_encodeFN($id).$ext;
+ return $fn;
+}
+
+/**
* returns an array of full paths to all metafiles of a given ID
*
* @author Esther Brunner <esther@kaffeehaus.ch>
@@ -326,12 +337,19 @@ function metaFiles($id){
* The filename is URL encoded to protect Unicode chars
*
* @author Andreas Gohr <andi@splitbrain.org>
+ * @author Kate Arzamastseva <pshns@ukr.net>
*/
-function mediaFN($id){
+function mediaFN($id, $rev=''){
global $conf;
$id = cleanID($id);
$id = str_replace(':','/',$id);
- $fn = $conf['mediadir'].'/'.utf8_encodeFN($id);
+ if(empty($rev)){
+ $fn = $conf['mediadir'].'/'.utf8_encodeFN($id);
+ }else{
+ $ext = mimetype($id);
+ $name = substr($id,0, -1*strlen($ext[0])-1);
+ $fn = $conf['mediaolddir'].'/'.utf8_encodeFN($name .'.'.( (int) $rev ).'.'.$ext[0]);
+ }
return $fn;
}
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index 83359cd55..ea1756803 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -805,8 +805,10 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
if($hash) $link['url'] .= '#'.$hash;
//markup non existing files
- if (!$exists)
- $link['class'] .= ' wikilink2';
+ if (!$exists) {
+ $link['class'] .= ' wikilink2';
+ $link['url'] = media_managerURL(array('tab_details' => 'view', 'image' => $src, 'ns' => getNS($src)), '&');
+ }
//output formatted
if ($linking == 'nolink' || $noLink) $this->doc .= $link['name'];
diff --git a/inc/plugincontroller.class.php b/inc/plugincontroller.class.php
index ea5725d47..734331c94 100644
--- a/inc/plugincontroller.class.php
+++ b/inc/plugincontroller.class.php
@@ -11,11 +11,16 @@ if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
class Doku_Plugin_Controller {
- var $list_enabled = array();
- var $list_disabled = array();
var $list_bytype = array();
+ var $tmp_plugins = array();
+ var $plugin_cascade = array('default'=>array(),'local'=>array(),'protected'=>array());
+ var $last_local_config_file = '';
- function Doku_Plugin_Controller() {
+ /**
+ * Populates the master list of plugins
+ */
+ function __construct() {
+ $this->loadConfig();
$this->_populateMasterList();
}
@@ -37,7 +42,7 @@ class Doku_Plugin_Controller {
// request the complete list
if (!$type) {
- return $all ? array_merge($this->list_enabled,$this->list_disabled) : $this->list_enabled;
+ return $all ? array_keys($this->tmp_plugins) : array_keys(array_filter($this->tmp_plugins));
}
if (!isset($this->list_bytype[$type]['enabled'])) {
@@ -61,9 +66,11 @@ class Doku_Plugin_Controller {
* @param $disabled bool true to load even disabled plugins
* @return objectreference the plugin object or null on failure
*/
- function &load($type,$name,$new=false,$disabled=false){
+ function load($type,$name,$new=false,$disabled=false){
+
//we keep all loaded plugins available in global scope for reuse
global $DOKU_PLUGINS;
+ global $lang;
list($plugin,$component) = $this->_splitName($name);
@@ -85,12 +92,12 @@ class Doku_Plugin_Controller {
//construct class and instantiate
if (!class_exists($class, true)) {
+
# the plugin might be in the wrong directory
$dir = $this->get_directory($plugin);
$inf = confToHash(DOKU_PLUGIN."$dir/plugin.info.txt");
if($inf['base'] && $inf['base'] != $plugin){
- msg("Plugin installed incorrectly. Rename plugin directory '".
- hsc($plugin)."' to '".hsc($inf['base'])."'.",-1);
+ msg(sprintf($lang['plugin_install_err'],hsc($plugin),hsc($inf['base'])),-1);
}
return null;
}
@@ -100,30 +107,28 @@ class Doku_Plugin_Controller {
}
function isdisabled($plugin) {
- return (array_search($plugin, $this->list_enabled) === false);
+ return empty($this->tmp_plugins[$plugin]);
}
- function enable($plugin) {
- if (array_search($plugin, $this->list_disabled) !== false) {
- return @unlink(DOKU_PLUGIN.$plugin.'/disabled');
- }
- return false;
+ function disable($plugin) {
+ if(array_key_exists($plugin,$this->plugin_cascade['protected'])) return false;
+ $this->tmp_plugins[$plugin] = 0;
+ return $this->saveList();
}
- function disable($plugin) {
- if (array_search($plugin, $this->list_enabled) !== false) {
- return @touch(DOKU_PLUGIN.$plugin.'/disabled');
- }
- return false;
+ function enable($plugin) {
+ if(array_key_exists($plugin,$this->plugin_cascade['protected'])) return false;
+ $this->tmp_plugins[$plugin] = 1;
+ return $this->saveList();
}
function get_directory($plugin) {
return $plugin;
}
- function _populateMasterList() {
- global $conf;
- if ($dh = opendir(DOKU_PLUGIN)) {
+ protected function _populateMasterList() {
+ if ($dh = @opendir(DOKU_PLUGIN)) {
+ $all_plugins = array();
while (false !== ($plugin = readdir($dh))) {
if ($plugin[0] == '.') continue; // skip hidden entries
if (is_file(DOKU_PLUGIN.$plugin)) continue; // skip files, we're only interested in directories
@@ -132,19 +137,119 @@ class Doku_Plugin_Controller {
// the plugin was disabled by rc2009-01-26
// disabling mechanism was changed back very soon again
// to keep everything simple we just skip the plugin completely
- }elseif(@file_exists(DOKU_PLUGIN.$plugin.'/disabled') ||
- ($plugin === 'plugin' && isset($conf['pluginmanager']) &&
- !$conf['pluginmanager'])){
- $this->list_disabled[] = $plugin;
+ } elseif (@file_exists(DOKU_PLUGIN.$plugin.'/disabled')) {
+ // treat this as a default disabled plugin(over-rideable by the plugin manager)
+ // deprecated 2011-09-10 (usage of disabled files)
+ if (empty($this->plugin_cascade['local'][$plugin])) {
+ $all_plugins[$plugin] = 0;
+ } else {
+ $all_plugins[$plugin] = 1;
+ }
+ $this->plugin_cascade['default'][$plugin] = 0;
+
+ } elseif ((array_key_exists($plugin,$this->tmp_plugins) && $this->tmp_plugins[$plugin] == 0) ||
+ ($plugin === 'plugin' && isset($conf['pluginmanager']) && !$conf['pluginmanager'])){
+ $all_plugins[$plugin] = 0;
+
+ } elseif ((array_key_exists($plugin,$this->tmp_plugins) && $this->tmp_plugins[$plugin] == 1)) {
+ $all_plugins[$plugin] = 1;
} else {
- $this->list_enabled[] = $plugin;
+ $all_plugins[$plugin] = 1;
}
}
+ $this->tmp_plugins = $all_plugins;
+ if (!file_exists($this->last_local_config_file)) {
+ $this->saveList(true);
+ }
+ }
+ }
+
+ protected function checkRequire($files) {
+ $plugins = array();
+ foreach($files as $file) {
+ if(file_exists($file)) {
+ @include_once($file);
+ }
+ }
+ return $plugins;
+ }
+
+ function getCascade() {
+ return $this->plugin_cascade;
+ }
+
+ /**
+ * Save the current list of plugins
+ */
+ function saveList($forceSave = false) {
+ global $conf;
+
+ if (empty($this->tmp_plugins)) return false;
+
+ // Rebuild list of local settings
+ $local_plugins = $this->rebuildLocal();
+ if($local_plugins != $this->plugin_cascade['local'] || $forceSave) {
+ $file = $this->last_local_config_file;
+ $out = "<?php\n/*\n * Local plugin enable/disable settings\n * Auto-generated through plugin/extension manager\n *\n".
+ " * NOTE: Plugins will not be added to this file unless there is a need to override a default setting. Plugins are\n".
+ " * enabled by default, unless having a 'disabled' file in their plugin folder.\n */\n";
+ foreach ($local_plugins as $plugin => $value) {
+ $out .= "\$plugins['$plugin'] = $value;\n";
+ }
+ // backup current file (remove any existing backup)
+ if (@file_exists($file)) {
+ $backup = $file.'.bak';
+ if (@file_exists($backup)) @unlink($backup);
+ if (!@copy($file,$backup)) return false;
+ if ($conf['fperm']) chmod($backup, $conf['fperm']);
+ }
+ //check if can open for writing, else restore
+ return io_saveFile($file,$out);
+ }
+ return false;
+ }
+
+ /**
+ * Rebuild the set of local plugins
+ * @return array array of plugins to be saved in end($config_cascade['plugins']['local'])
+ */
+ function rebuildLocal() {
+ //assign to local variable to avoid overwriting
+ $backup = $this->tmp_plugins;
+ //Can't do anything about protected one so rule them out completely
+ $local_default = array_diff_key($backup,$this->plugin_cascade['protected']);
+ //Diff between local+default and default
+ //gives us the ones we need to check and save
+ $diffed_ones = array_diff_key($local_default,$this->plugin_cascade['default']);
+ //The ones which we are sure of (list of 0s not in default)
+ $sure_plugins = array_filter($diffed_ones,array($this,'negate'));
+ //the ones in need of diff
+ $conflicts = array_diff_key($local_default,$diffed_ones);
+ //The final list
+ return array_merge($sure_plugins,array_diff_assoc($conflicts,$this->plugin_cascade['default']));
+ }
+
+ /**
+ * Build the list of plugins and cascade
+ *
+ */
+ function loadConfig() {
+ global $config_cascade;
+ foreach(array('default','protected') as $type) {
+ if(array_key_exists($type,$config_cascade['plugins']))
+ $this->plugin_cascade[$type] = $this->checkRequire($config_cascade['plugins'][$type]);
}
+ $local = $config_cascade['plugins']['local'];
+ $this->last_local_config_file = array_pop($local);
+ $this->plugin_cascade['local'] = $this->checkRequire(array($this->last_local_config_file));
+ if(is_array($local)) {
+ $this->plugin_cascade['default'] = array_merge($this->plugin_cascade['default'],$this->checkRequire($local));
+ }
+ $this->tmp_plugins = array_merge($this->plugin_cascade['default'],$this->plugin_cascade['local'],$this->plugin_cascade['protected']);
}
function _getListByType($type, $enabled) {
- $master_list = $enabled ? $this->list_enabled : $this->list_disabled;
+ $master_list = $enabled ? array_keys(array_filter($this->tmp_plugins)) : array_keys(array_filter($this->tmp_plugins,array($this,'negate')));
$plugins = array();
foreach ($master_list as $plugin) {
@@ -169,11 +274,13 @@ class Doku_Plugin_Controller {
}
function _splitName($name) {
- if (array_search($name, $this->list_enabled + $this->list_disabled) === false) {
+ if (array_search($name, array_keys($this->tmp_plugins)) === false) {
return explode('_',$name,2);
}
return array($name,'');
}
-
+ function negate($input) {
+ return !(bool) $input;
+ }
}
diff --git a/inc/pluginutils.php b/inc/pluginutils.php
index 85bcaee1e..53cfedf82 100644
--- a/inc/pluginutils.php
+++ b/inc/pluginutils.php
@@ -16,7 +16,7 @@ function plugin_list($type='',$all=false) {
global $plugin_controller;
return $plugin_controller->getList($type,$all);
}
-function &plugin_load($type,$name,$new=false,$disabled=false) {
+function plugin_load($type,$name,$new=false,$disabled=false) {
global $plugin_controller;
return $plugin_controller->load($type,$name,$new,$disabled);
}
@@ -36,3 +36,7 @@ function plugin_directory($plugin) {
global $plugin_controller;
return $plugin_controller->get_directory($plugin);
}
+function plugin_getcascade() {
+ global $plugin_controller;
+ return $plugin_controller->getCascade();
+}
diff --git a/inc/search.php b/inc/search.php
index 7b53edabe..a26ae4808 100644
--- a/inc/search.php
+++ b/inc/search.php
@@ -21,9 +21,10 @@ if(!defined('DOKU_INC')) die('meh.');
* @param int $lvl Recursion Level
* @author Andreas Gohr <andi@splitbrain.org>
*/
-function search(&$data,$base,$func,$opts,$dir='',$lvl=1){
+function search(&$data,$base,$func,$opts,$dir='',$lvl=1,$sort=false){
$dirs = array();
$files = array();
+ $filepaths = array();
//read in directories and files
$dh = @opendir($base.'/'.$dir);
@@ -35,9 +36,14 @@ function search(&$data,$base,$func,$opts,$dir='',$lvl=1){
continue;
}
$files[] = $dir.'/'.$file;
+ $filepaths[] = $base.'/'.$dir.'/'.$file;
}
closedir($dh);
- sort($files);
+ if ($sort == 'date') {
+ @array_multisort(array_map('filemtime', $filepaths), SORT_NUMERIC, SORT_DESC, $files);
+ } else {
+ sort($files);
+ }
sort($dirs);
//give directories to userfunction then recurse
@@ -78,8 +84,8 @@ function search_callback($func,&$data,$base,$file,$type,$lvl,$opts){
* return values for files are ignored
*
* All functions should check the ACL for document READ rights
- * namespaces (directories) are NOT checked as this would break
- * the recursion (You can have an nonreadable dir over a readable
+ * namespaces (directories) are NOT checked (when sneaky_index is 0) as this
+ * would break the recursion (You can have an nonreadable dir over a readable
* one deeper nested) also make sure to check the file type (for example
* in case of lockfiles).
*/
@@ -101,45 +107,22 @@ function search_qsearch(&$data,$base,$file,$type,$lvl,$opts){
/**
* Build the browsable index of pages
*
- * $opts['ns'] is the current namespace
+ * $opts['ns'] is the currently viewed namespace
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function search_index(&$data,$base,$file,$type,$lvl,$opts){
global $conf;
- $return = true;
-
- $item = array();
-
- if($type == 'd' && !preg_match('#^'.$file.'(/|$)#','/'.$opts['ns'])){
- //add but don't recurse
- $return = false;
- }elseif($type == 'f' && ($opts['nofiles'] || substr($file,-4) != '.txt')){
- //don't add
- return false;
- }
-
- $id = pathID($file,($type == 'd'));
-
- if($type=='d' && $conf['sneaky_index'] && auth_quickaclcheck($id.':') < AUTH_READ){
- return false;
- }
-
- //check hidden
- if(isHiddenPage($id)){
- return false;
- }
-
- //check ACL
- if($type=='f' && auth_quickaclcheck($id) < AUTH_READ){
- return false;
- }
-
- $data[]=array( 'id' => $id,
- 'type' => $type,
- 'level' => $lvl,
- 'open' => $return );
- return $return;
+ $opts = array(
+ 'pagesonly' => true,
+ 'listdirs' => true,
+ 'listfiles' => !$opts['nofiles'],
+ 'sneakyacl' => $conf['sneaky_index'],
+ // Hacky, should rather use recmatch
+ 'depth' => preg_match('#^'.$file.'(/|$)#','/'.$opts['ns']) ? 0 : -1
+ );
+
+ return search_universal($data, $base, $file, $type, $lvl, $opts);
}
/**
diff --git a/inc/template.php b/inc/template.php
index 5184929b8..96e0668c2 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;
@@ -1103,9 +1109,7 @@ function tpl_mediaContent($fromajax=false){
$evt = new Doku_Event('MEDIAMANAGER_CONTENT_OUTPUT', $data);
if ($evt->advise_before()) {
$do = $data['do'];
- if($do == 'metaform'){
- media_metaform($IMG,$AUTH);
- }elseif($do == 'filesinuse'){
+ if($do == 'filesinuse'){
media_filesinuse($INUSE,$IMG);
}elseif($do == 'filelist'){
media_filelist($NS,$AUTH,$JUMPTO);
@@ -1122,6 +1126,93 @@ 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_mediaFileList(){
+ global $AUTH;
+ global $NS;
+ global $JUMPTO;
+
+ $opened_tab = $_REQUEST['tab_files'];
+ if (!$opened_tab || !in_array($opened_tab, array('files', 'upload', 'search'))) $opened_tab = 'files';
+ if ($_REQUEST['mediado'] == 'update') $opened_tab = 'upload';
+
+ media_tabs_files($opened_tab);
+
+ if ($opened_tab == 'files') {
+ echo '<div id="mediamanager__files">';
+ media_tab_files($NS,$AUTH,$JUMPTO);
+ echo '</div>';
+
+ } elseif ($opened_tab == 'upload') {
+ echo '<div id="mediamanager__files">';
+ media_tab_upload($NS,$AUTH,$JUMPTO);
+ echo '</div>';
+
+ } elseif ($opened_tab == 'search') {
+ echo '<div 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_mediaFileDetails($image, $rev){
+ global $AUTH, $NS, $conf, $DEL;
+
+ $removed = (!file_exists(mediaFN($image)) && file_exists(mediaMetaFN($image, '.changes')) && $conf['mediarevisions']);
+ if (!$image || (!file_exists(mediaFN($image)) && !$removed) || $DEL) return '';
+ if ($rev && !file_exists(mediaFN($image, $rev))) $rev = false;
+ if (isset($NS) && getNS($image) != $NS) return '';
+ $do = $_REQUEST['mediado'];
+
+ $opened_tab = $_REQUEST['tab_details'];
+
+ $tab_array = array('view');
+ list($ext, $mime) = mimetype($image);
+ if ($mime == 'image/jpeg') {
+ $tab_array[] = 'edit';
+ }
+ if ($conf['mediarevisions']) {
+ $tab_array[] = 'history';
+ }
+
+ if (!$opened_tab || !in_array($opened_tab, $tab_array)) $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 id="mediamanager__details">';
+ media_tab_view($image, $NS, $AUTH, $rev);
+ echo '</div>';
+
+ } elseif ($opened_tab == 'edit' && !$removed) {
+ echo '<div id="mediamanager__details">';
+ media_tab_edit($image, $NS, $AUTH);
+ echo '</div>';
+
+ } elseif ($opened_tab == 'history' && $conf['mediarevisions']) {
+ echo '<div id="mediamanager__details">';
+ media_tab_history($image,$NS,$AUTH);
+ echo '</div>';
+ }
+}
+
+/**
* prints the namespace tree in the mediamanger popup
*
* Only allowed in mediamanager.php
@@ -1130,7 +1221,6 @@ function tpl_mediaContent($fromajax=false){
*/
function tpl_mediaTree(){
global $NS;
-
ptln('<div id="media__tree">');
media_nstree($NS);
ptln('</div>');
@@ -1386,6 +1476,52 @@ function tpl_favicon($types=array('favicon')) {
return $return;
}
+/**
+ * Prints full-screen media manager
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ */
+function tpl_media() {
+ //
+ global $DEL, $NS, $IMG, $AUTH, $JUMPTO, $REV, $lang, $fullscreen, $conf;
+ $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 id="mediamanager__page">';
+ echo '<h1>'.$lang['btn_media'].'</h1>';
+ echo '<div id="mediamanager__layout">';
+
+ echo '<div id="mediamanager__layout_namespaces" class="layout-resizable" >';
+ 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();
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div id="mediamanager__layout_list" class="layout-resizable" >';
+ tpl_mediaFileList();
+ echo '</div>';
+
+ echo '<div id="mediamanager__layout_detail" class="layout" >';
+ tpl_mediaFileDetails($image, $rev);
+ echo '</div>';
+
+ echo '<div class="clearer"></div>';
+ echo '</div>';
+ echo '</div>';
+}
//Setup VIM: ex: et ts=4 :