From db959ae30700e3924a73350a3a43a2c36b431de7 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 20 Oct 2009 23:23:38 +0200 Subject: Coding Standard Cleanup Ignore-this: 259cb5773c3144c6c706d87298dcf674 darcs-hash:20091020212338-7ad00-6bf1c5c403491f136a1c02af5ecd9f84d7227107.gz --- inc/media.php | 555 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 276 insertions(+), 279 deletions(-) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index 2a45b6d80..c9b7cfc56 100644 --- a/inc/media.php +++ b/inc/media.php @@ -32,10 +32,10 @@ function media_filesinuse($data,$id){ echo ''.hsc($row).''; echo ''; }else - $hidden++; + $hidden++; } if ($hidden){ - print '
'.$lang['ref_hidden'].'
'; + print '
'.$lang['ref_hidden'].'
'; } } @@ -86,14 +86,14 @@ function media_metaform($id,$auth){ 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); - } + 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); + } + } } - } } $src = mediaFN($id); @@ -136,9 +136,9 @@ function media_metaform($id,$auth){ echo '
'.NL; echo ''.NL; echo ''.NL; + '" title="'.$lang['btn_save'].' [S]" accesskey="s" class="button" />'.NL; echo ''.NL; + '" title="'.$lang['btn_cancel'].' [C]" accesskey="c" class="button" />'.NL; echo '
'.NL; echo ''.NL; } @@ -446,7 +446,7 @@ function media_filelist($ns,$auth=null,$jump=''){ $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); if(!count($data)){ echo '
'.$lang['nothingfound'].'
'.NL; @@ -471,19 +471,19 @@ function media_searchlist($query,$ns,$auth=null){ if ($query) { $evdata = array( - 'ns' => $ns, - 'data' => array(), - 'query' => $query - ); + 'ns' => $ns, + 'data' => array(), + 'query' => $query + ); $evt = new Doku_Event('MEDIA_SEARCH', $evdata); if ($evt->advise_before()) { $dir = utf8_encodeFN(str_replace(':','/',$evdata['ns'])); $pattern = '/'.preg_quote($evdata['query'],'/').'/i'; search($evdata['data'], - $conf['mediadir'], - 'search_media', - array('showmsg'=>false,'pattern'=>$pattern), - $dir); + $conf['mediadir'], + 'search_media', + array('showmsg'=>false,'pattern'=>$pattern), + $dir); } $evt->advise_after(); unset($evt); @@ -502,8 +502,6 @@ function media_searchlist($query,$ns,$auth=null){ /** * Print action links for a file depending on filetype * and available permissions - * - * @todo contains inline javascript */ function media_fileactions($item,$auth){ global $lang; @@ -511,8 +509,7 @@ function media_fileactions($item,$auth){ // view button $link = ml($item['id'],'',true); echo ' '; - + 'alt="'.$lang['mediaview'].'" title="'.$lang['mediaview'].'" class="btn" />'; // no further actions if not writable if(!$item['writable']) return; @@ -520,16 +517,16 @@ function media_fileactions($item,$auth){ // delete button if($auth >= AUTH_DELETE){ echo ' '. - ''.$lang['btn_delete'].''; + '&sectok='.getSecurityToken().'" class="btn_media_delete" title="'.$item['id'].'">'. + ''.$lang['btn_delete'].''; } // edit button if($auth >= AUTH_UPLOAD && $item['isimg'] && $item['meta']->getField('File.Mime') == 'image/jpeg'){ echo ' '. - ''.$lang['metaedit'].''; + ''.$lang['metaedit'].''; } } @@ -622,8 +619,8 @@ function media_printimgdetail($item){ // read EXIF/IPTC data $t = $item['meta']->getField(array('IPTC.Headline','xmp.dc:title')); $d = $item['meta']->getField(array('IPTC.Caption','EXIF.UserComment', - 'EXIF.TIFFImageDescription', - 'EXIF.TIFFUserComment')); + 'EXIF.TIFFImageDescription', + 'EXIF.TIFFUserComment')); if(utf8_strlen($d) > 250) $d = utf8_substr($d,0,250).'...'; $k = $item['meta']->getField(array('IPTC.Keywords','IPTC.Category','xmp.dc:subject')); @@ -662,47 +659,47 @@ function media_uploadform($ns, $auth){ $form->addElement(form_makeCloseTag('p')); if($auth >= AUTH_DELETE){ - $form->addElement(form_makeOpenTag('p')); - $form->addElement(form_makeCheckboxField('ow', 1, $lang['txt_overwrt'], 'dw__ow', 'check')); - $form->addElement(form_makeCloseTag('p')); + $form->addElement(form_makeOpenTag('p')); + $form->addElement(form_makeCheckboxField('ow', 1, $lang['txt_overwrt'], 'dw__ow', 'check')); + $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(), - ); + '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 ?> - - +
+ + + 0, 'id' => '', - 'open' =>'true', 'label' => '['.$lang['mediaroot'].']'); + 'open' =>'true', 'label' => '['.$lang['mediaroot'].']'); echo '