http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72167
Revision: 72167
Author: kaldari
Date: 2010-09-01 22:18:10 +0000 (Wed, 01 Sep 2010)
Log Message:
-----------
adding templateExists() function
Modified Paths:
--------------
trunk/extensions/CentralNotice/SpecialNoticeTemplate.php
Modified: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php
===================================================================
--- trunk/extensions/CentralNotice/SpecialNoticeTemplate.php 2010-09-01
21:06:42 UTC (rev 72166)
+++ trunk/extensions/CentralNotice/SpecialNoticeTemplate.php 2010-09-01
22:18:10 UTC (rev 72167)
@@ -818,4 +818,15 @@
$wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>",
$message );
$this->centralNoticeError = true;
}
+
+ public static function templateExists( $templateName ) {
+ $dbr = wfGetDB( DB_SLAVE );
+ $eTemplateName = htmlspecialchars( $templateName );
+ $row = $dbr->selectRow( 'cn_templates', 'tmp_name', array(
'tmp_name' => $eTemplateName ) );
+ if ( $row ) {
+ return true;
+ } else {
+ return false;
+ }
+ }
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs