diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/lang/en/lang.php | 2 | ||||
-rw-r--r-- | inc/media.php | 27 | ||||
-rw-r--r-- | inc/template.php | 3 |
3 files changed, 27 insertions, 5 deletions
diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php index 6fb387a89..a55981983 100644 --- a/inc/lang/en/lang.php +++ b/inc/lang/en/lang.php @@ -338,5 +338,7 @@ $lang['media_view'] = 'View'; $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.'; //Setup VIM: ex: et ts=2 : diff --git a/inc/media.php b/inc/media.php index 461a13665..fc7f72941 100644 --- a/inc/media.php +++ b/inc/media.php @@ -89,9 +89,13 @@ function media_metasave($id,$auth,$data){ * @author Kate Arzamastseva <pshns@ukr.net> */ function media_metaform($id,$auth,$fullscreen = false){ - 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)){ @@ -637,7 +641,7 @@ function media_tab_files($ns,$auth=null,$jump='') { $view = $_REQUEST['view']; if($auth < AUTH_READ){ - echo '<div class="nothing">'.$lang['nothingfound'].'</div>'.NL; + echo '<div class="nothing">'.$lang['media_perm_read'].'</div>'.NL; }else{ if ($view == 'list') { echo '<ul class="mediamanager-file-list mediamanager-list" id="id-mediamanager-file-list">'; @@ -766,6 +770,8 @@ function media_tab_history($image, $ns, $auth=null) { $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>'; echo '</div>'; @@ -778,7 +784,11 @@ function media_tab_history($image, $ns, $auth=null) { */ function media_preview($image, $auth, $rev=false) { global $lang; - if ($auth < AUTH_READ || !$image) return ''; + if (!$image) return ''; + if ($auth < AUTH_READ) { + echo '<div class="nothing">'.$lang['media_perm_read'].'</div>'.NL; + return ''; + } $info = getimagesize(mediaFN($image)); $w = (int) $info[0]; @@ -810,6 +820,12 @@ function media_preview($image, $auth, $rev=false) { function media_details($image, $auth, $rev=false) { global $lang, $config_cascade;; + if (!$image) return ''; + if ($auth < AUTH_READ) { + echo '<div class="nothing">'.$lang['media_perm_read'].'</div>'.NL; + return ''; + } + // load the field descriptions static $tags = null; if(is_null($tags)){ @@ -1196,7 +1212,10 @@ function media_managerURL($params=false, $amp='&') { function media_uploadform($ns, $auth, $fullscreen = false){ global $lang; - 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; + } // The default HTML upload form $params = array('id' => 'dw__upload', diff --git a/inc/template.php b/inc/template.php index 5d29f6950..051679fb9 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1423,7 +1423,8 @@ function tpl_getFavicon($abs=false) { */ function tpl_media() { // - global $DEL, $NS, $IMG, $AUTH, $JUMPTO, $lang; + global $DEL, $NS, $IMG, $AUTH, $JUMPTO, $lang, $fullscreen; + $fullscreen = true; require_once(DOKU_INC.'lib/exe/mediamanager.php'); echo '<div class="mediamanager" id="id-mediamanager">'; |