setHeaders(); $this->mPosted=$wgRequest->wasPosted(); $this->mAction=$wgRequest->getText( "action" ); if(count($ArrayLanguageArticles)==0) { $dbr =& wfGetDB( DB_SLAVE ); $sql="SELECT page_title FROM page, categorylinks WHERE page.page_id = categorylinks.cl_from AND categorylinks.cl_to = 'Texte' AND page.page_namespace =100 ORDER BY page_title DESC"; $res=$dbr->query($sql,$fname); while($row=$dbr->fetchObject($res)) $this->ArrayLanguageArticles[$row->page_title]=TRUE; $dbr->freeResult($res); //read, if available, the not selected titles from the user, and deselect it again $UserID=$wgUser->idForName(); if($UserID>0) { $sql="SELECT user_not_selected_langfiles FROM user_miranda_lang WHERE user_id=$UserID"; $res=$dbr->query($sql,$fname); $row=$dbr->fetchRow($res); if($row!==FALSE) { $arrNotSelected=unserialize($row[0]); foreach($this->ArrayLanguageArticles as $key=>$value) { if(in_array($key,$arrNotSelected)===TRUE) $this->ArrayLanguageArticles[$key]=FALSE; } } } } if($this->mPosted==true && $this->mAction=="submit") { if($wgRequest->getCheck("CreateFile")) $this->DownloadLanguagepack(); If($wgRequest->getCheck("SelectAll")) $this->MakeSelection("SelectAll"); If($wgRequest->getCheck("SelectNone")) $this->MakeSelection("SelectNone"); If($wgRequest->getCheck("TextVersionsinfo")) { $this->MakeSelection("TextVersionsinfo"); $this->ShowLanguagepackSelection(); } If($wgRequest->getCheck("FileVersionsinfo")) { $this->MakeSelection("FileVersionsinfo"); $this->ShowLanguagepackSelection(); } } else { $this->ShowLanguagepackSelection(); } } //Display the Buttons, the list with languagearticles and selection, selection is loaded from a special user DB Table function ShowLanguagepackSelection() { global $wgOut, $wgRequest, $wgUser; $dbr =& wfGetDB( DB_SLAVE ); $fname = "MirandaLanguagepack::ShowLanguagepackSelect"; $titleObj = Title::makeTitle( NS_SPECIAL, 'MirandaLanguagepack' ); $action = $titleObj->escapeLocalURL( "action=submit" ); $wgOut->addWikiText("[[Sprachdatei:Quellcode MirandaLanguagepack.php]]"); $wgOut->addWikiText("{{Sprachdatei erstellen}}"); $text="
(.*)#Us", $Text,$arrTextBlocks); $Text=""; foreach($arrTextBlocks[1] as $TextBlock) $Text.=$TextBlock; } } SpecialPage::addPage( new MirandaLanguagepack ); $wgMessageCache->addMessages( array("mirandalanguagepack" => "Sprachdatei erstellen und downloaden")); } //===================================================== //Specialpage to display the assign dll-name versionsinfo - Language file //used NEW Table in DB: // function wfExtensionAsignMirandaVersionsinfo() { global $IP, $wgMessageCache; require_once( "$IP/includes/SpecialPage.php" ); class MirandaVersionsinfo extends SpecialPage { var $mAction,$mPosted; var $ArrayLanguageArticlesVersinfo=Array(); function MirandaVersionsinfo() { SpecialPage::SpecialPage( "MirandaVersionsinfo" ); } function execute( $par ) { global $wgRequest,$wgOut; $fname = "MirandaVersionsinfo::execute"; $this->setHeaders(); $this->mPosted=$wgRequest->wasPosted(); $this->mAction=$wgRequest->getText( "action" ); if(count($ArrayLanguageArticlesVersinfo)==0) { $dbr =& wfGetDB( DB_SLAVE ); //$sql="SELECT page.page_title FROM page, categorylinks WHERE page.page_id = categorylinks.cl_from AND categorylinks.cl_to = 'Texte' AND page.page_namespace =100 ORDER BY page_title DESC"; $sql="SELECT page.page_title, user_miranda_versinfo.dll_name1, user_miranda_versinfo.dll_name2, user_miranda_versinfo.dll_name3, user_miranda_versinfo.dll_name4 FROM page, categorylinks LEFT JOIN user_miranda_versinfo ON user_miranda_versinfo.page_title = page.page_title WHERE page.page_id = categorylinks.cl_from AND categorylinks.cl_to = 'Texte'AND page.page_namespace =100 ORDER BY page_title ASC"; $res=$dbr->query($sql,$fname); while($row=$dbr->fetchRow($res)) $this->ArrayLanguageArticlesVersinfo[$row[0]]=array($row[1],$row[2],$row[3],$row[4]); $dbr->freeResult($res); } if($this->mPosted==true && $this->mAction=="submit") { $this->StoreNamesInDB(); } else { $this->ShowVersionsinfoTable(); } } function ShowVersionsinfoTable() { global $wgOut; $fname = "MirandaVersionsinfo::ShowVersionsinfoTable"; $title = Title::makeTitle( NS_SPECIAL, 'MirandaVersionsinfo' ); $action = $title->escapeLocalURL( "action=submit" ); $wgOut->addWikiText("{{Sprachdatei Versionsinfo zuweisen}}"); $text="