Index: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php |
— | — | @@ -818,4 +818,15 @@ |
819 | 819 | $wgOut->wrapWikiMsg( "<div class='cn-error'>\n$1\n</div>", $message ); |
820 | 820 | $this->centralNoticeError = true; |
821 | 821 | } |
| 822 | + |
| 823 | + public static function templateExists( $templateName ) { |
| 824 | + $dbr = wfGetDB( DB_SLAVE ); |
| 825 | + $eTemplateName = htmlspecialchars( $templateName ); |
| 826 | + $row = $dbr->selectRow( 'cn_templates', 'tmp_name', array( 'tmp_name' => $eTemplateName ) ); |
| 827 | + if ( $row ) { |
| 828 | + return true; |
| 829 | + } else { |
| 830 | + return false; |
| 831 | + } |
| 832 | + } |
822 | 833 | } |