From: Magnus Manske Date: Wed, 17 Sep 2003 13:48:08 +0000 (+0000) Subject: upload add-on X-Git-Tag: 1.1.0~259 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=2afd409ebba1cf0639af1596063a12ff4b11b360;p=lhc%2Fweb%2Fwiklou.git upload add-on --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 845cba124a..3991eec58f 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -406,6 +406,8 @@ function wfImageArchiveDir( $fname ) function wfRecordUpload( $name, $oldver, $size, $desc ) { global $wgUser, $wgLang, $wgTitle, $wgOut, $wgDeferredUpdateList; + global $wgUseCopyrightUpload , $wpUploadCopyStatus , $wpUploadSource ; + $fname = "wfRecordUpload"; $sql = "SELECT img_name,img_size,img_timestamp,img_description,img_user," . @@ -415,6 +417,14 @@ function wfRecordUpload( $name, $oldver, $size, $desc ) $now = wfTimestampNow(); $won = wfInvertTimestamp( $now ); + if ( $wgUseCopyrightUpload ) + { + $textdesc = "== " . wfMsg ( "filedesc" ) . " ==\n" . $desc . "\n" . + "== " . wfMsg ( "filestatus" ) . " ==\n" . $wpUploadCopyStatus . "\n" . + "== " . wfMsg ( "filesource" ) . " ==\n" . $wpUploadSource ; + } + else $textdesc = $desc ; + if ( 0 == wfNumRows( $res ) ) { $sql = "INSERT INTO image (img_name,img_size,img_timestamp," . "img_description,img_user,img_user_text) VALUES ('" . @@ -438,7 +448,7 @@ function wfRecordUpload( $name, $oldver, $size, $desc ) "cur_comment,cur_user,cur_user_text,cur_timestamp,cur_is_new," . "cur_text,inverse_timestamp,cur_touched) VALUES (" . $common . - ",'" . wfStrencode( $desc ) . "','{$won}','{$now}')"; + ",'" . wfStrencode( $textdesc ) . "','{$won}','{$now}')"; wfQuery( $sql, $fname ); $id = wfInsertId() or 0; # We should throw an error instead $sql = "INSERT INTO recentchanges (rc_namespace,rc_title, diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index 4dbe15a1ef..cb08a423f9 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -33,6 +33,14 @@ function processUpload() global $HTTP_POST_FILES, $wgUploadDirectory; global $wpUploadSaveName, $wpUploadTempName, $wpUploadSize; global $wgSavedFile, $wgUploadOldVersion, $wpUploadOldVersion; + global $wgUseCopyrightUpload , $wpUploadCopyStatus , $wpUploadSource ; + + if ( $wgUseCopyrightUpload ) + { + $wpUploadAffirm = 1 ; + if ( trim ( $wpUploadCopyStatus ) == "" || trim ( $wpUploadSource ) == "" ) + $wpUploadAffirm = 0 ; + } if ( 1 != $wpUploadAffirm ) { mainUploadForm( WfMsg( "noaffirmation" ) ); @@ -201,6 +209,7 @@ function mainUploadForm( $msg ) global $wgOut, $wgUser, $wgLang, $wgUploadDirectory; global $wpUpload, $wpUploadAffirm, $wpUploadFile; global $wpUploadDescription, $wpIgnoreWarning; + global $wgUseCopyrightUpload , $wpUploadSource , $wpUploadCopyStatus ; if ( "" != $msg ) { $sub = wfMsg( "uploaderror" ); @@ -223,6 +232,25 @@ function mainUploadForm( $msg ) $iw = wfMsg( "ignorewarning" ); $action = wfLocalUrl( $wgLang->specialPage( "Upload" ) ); + + $source = " + + + +" ; + if ( $wgUseCopyrightUpload ) + { + $source = " +" . wfMsg ( "filestatus" ) . ": + + +". wfMsg ( "filesource" ) . ": + +" ; + } + $wgOut->addHTML( "
@@ -235,9 +263,8 @@ action=\"{$action}\"> - - - +{$source} +  
\n" ); diff --git a/languages/Language.php b/languages/Language.php index 3593b9e28c..82fdfad8e4 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -826,6 +826,8 @@ All times shown are server time (UTC). ", "filename" => "Filename", "filedesc" => "Summary", +"filestatus" => "Copyright status", +"filesource" => "Source", "affirmation" => "I affirm that the copyright holder of this file agrees to license it under the terms of the $1.", "copyrightpage" => "Wikipedia:Copyrights", diff --git a/languages/LanguageDe.php b/languages/LanguageDe.php index 8add393e61..5de2b16ebc 100644 --- a/languages/LanguageDe.php +++ b/languages/LanguageDe.php @@ -697,6 +697,8 @@ Alle Zeiten sind UTC. "uploadlogtext" => "Hochgeladene und gelöschte Dateien werden im $1 verzeichnet.", "filename" => "Dateiname", "filedesc" => "Beschreibung", +"filestatus" => "Copyright-Status", +"filesource" => "Quelle", "affirmation" => "Hiermit bestätige ich, dass ich das Copyright dieser Datei habe, und diese hiermit unter $1 veröffentliche, bzw. dass die Datei 'Public Domain' ist.", "copyrightpage" => "Wikipedia:Copyright", "copyrightpagename" => "Wikipedia copyright",