*/
function Image( $name, $recache = false ) {
- global $wgUseSharedUploads, $wgUseLatin1, $wgSharedLatin1, $wgLang, $wgMemc, $wgDBname;
+ global $wgUseSharedUploads, $wgUseLatin1, $wgSharedLatin1, $wgLang, $wgMemc, $wgDBname,
+ $wgSharedUploadDBname;
$this->name = $name;
$this->title = Title::makeTitleSafe( NS_IMAGE, $this->name );
if ( $id == 0 ) {
$article = new Article( $descTitle );
- $article->insertNewArticle( $textdesc, $desc, false, false );
+ $article->insertNewArticle( $textdesc, $desc, false, false, true );
}
} else {
# Collision, this is an update of an image
/**
* @static
*/
- function actionText( $type, $action, $titleLink = NULL, $params = array() ) {
+ function actionText( $type, $action, $titleLink = NULL, $params = array(), $filterWikilinks=false ) {
static $actions = array(
'block/block' => 'blocklogentry',
'block/unblock' => 'unblocklogentry',
$key = "$type/$action";
if( isset( $actions[$key] ) ) {
if( is_null( $titleLink ) ) {
- return wfMsgForContent( $actions[$key] );
+ $rv=wfMsgForContent( $actions[$key] );
} elseif ( count( $params ) == 0 ) {
- return wfMsgForContent( $actions[$key], $titleLink );
+ $rv=wfMsgForContent( $actions[$key], $titleLink );
} else {
array_unshift( $params, $titleLink );
- return wfMsgReal( $actions[$key], $params, true, true );
+ $rv=wfMsgReal( $actions[$key], $params, true, true );
}
} else {
wfDebug( "LogPage::actionText - unknown action $key\n" );
- return "$action $titleLink";
+ $rv="$action $titleLink";
}
+ if($filterWikilinks) {
+ $rv=str_replace("[[","",$rv);
+ $rv=str_replace("]]","",$rv);
+ }
+ return $rv;
}
/**
$comment = $this->skin->commentBlock( $s->log_comment );
$paramArray = LogPage::extractParams( $s->log_params );
- $action = LogPage::actionText( $s->log_type, $s->log_action, $titleLink, $paramArray );
+ $action = LogPage::actionText( $s->log_type, $s->log_action, $titleLink, $paramArray, true );
$out = "<li>$time $userLink $action $comment</li>\n";
return $out;
}