Changeset 601
- Timestamp:
- 2007-07-31 11:30:39 (18 months ago)
- Location:
- MediaWiki/trunk/extensions/FCKeditor
- Files:
-
- 3 modified
-
FCKeditorParser.body.php (modified) (1 diff)
-
FCKeditorSajax.body.php (modified) (3 diffs)
-
FCKeditorSkin.body.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
MediaWiki/trunk/extensions/FCKeditor/FCKeditorParser.body.php
r583 r601 170 170 } 171 171 172 function parse( $text, &$title, $options, $linestart = true, $clearState = true, $revid = null ) { 173 $parserOutput = parent::parse($text, &$title, $options, $linestart , $clearState , $revid ); 174 175 $categories = $parserOutput->getCategories(); 176 if ($categories) { 177 $appendString = ""; 178 foreach ($categories as $cat=>$val) { 179 $appendString .= "<a href=\"Category:" . $cat ."\">Category:" . $cat ."</a> "; 180 } 181 $parserOutput->setText($parserOutput->getText() . $appendString); 182 } 183 184 return $parserOutput; 185 } 186 172 187 /* 173 188 function replaceVariables( $text, $args = array(), $argsOnly = false ) { -
MediaWiki/trunk/extensions/FCKeditor/FCKeditorSajax.body.php
r579 r601 75 75 { 76 76 global $wgContLang, $wgOut; 77 $limit = 10; 78 77 $limit = 10; 78 $ns = NS_MAIN; 79 79 80 $term = $wgContLang->checkTitleEncoding( $wgContLang->recodeInput( js_unescape( $term ) ) ); 81 82 if (strpos($term, "Category:") === 0) { 83 $ns = NS_CATEGORY; 84 $term = substr($term, 9); 85 $prefix = "Category:"; 86 } 87 else if (strpos($term, ":Category:") === 0) { 88 $ns = NS_CATEGORY; 89 $term = substr($term, 10); 90 $prefix = ":Category:"; 91 } 92 80 93 $term1 = str_replace( ' ', '_', $wgContLang->ucfirst( $term ) ); 81 94 $term2 = str_replace( ' ', '_', $wgContLang->lc( $term ) ); … … 83 96 $term = $term1; 84 97 85 if ( strlen( str_replace( '_', '', $term ) )<3 ) 86 return ""; 98 if ( strlen( str_replace( '_', '', $term ) )<3 ) { 99 return ""; 100 } 87 101 88 102 $db =& wfGetDB( DB_SLAVE ); 89 103 $res = $db->select( 'page', 'page_title', 90 array( 'page_namespace' => NS_MAIN,104 array( 'page_namespace' => $ns, 91 105 "LCASE(page_title) LIKE '%". $db->strencode( $term2 ) ."%'" ), 92 106 "wfSajaxSearch", … … 97 111 $i=0; 98 112 while ( ( $row = $db->fetchObject( $res ) ) && ( ++$i <= $limit ) ) { 113 if (!is_null($prefix)) { 114 $ret .= $prefix; 115 } 99 116 $ret .= $row->page_title ."\n"; 100 117 } -
MediaWiki/trunk/extensions/FCKeditor/FCKeditorSkin.body.php
r582 r601 123 123 $text = htmlspecialchars( $nt->getPrefixedText() ); 124 124 } 125 126 if ($nt->getNamespace() == NS_CATEGORY) { 127 $u = ':' . $u; 128 } 125 129 126 130 list( $inside, $trail ) = Linker::splitTrail( $trail ); … … 141 145 wfProfileIn( $fname ); 142 146 143 //$u = $nt->escapeLocalURL( $query );144 //$u = $nt->getText();145 //$u = $nt->getEscapedText();146 147 $u = $nt->getFullText(); 147 //print_r($nt);148 148 149 149 if ( '' == $text ) { 150 150 $text = htmlspecialchars( $nt->getPrefixedText() ); 151 } 152 if ($nt->getNamespace() == NS_CATEGORY) { 153 $u = ':' . $u; 151 154 } 152 155