From: <var...@us...> - 2013-04-16 14:29:40
|
Revision: 8750 http://sourceforge.net/p/phpwiki/code/8750 Author: vargenau Date: 2013-04-16 14:29:36 +0000 (Tue, 16 Apr 2013) Log Message: ----------- Remove underscore for private functions Modified Paths: -------------- trunk/lib/plugin/CreateToc.php Modified: trunk/lib/plugin/CreateToc.php =================================================================== --- trunk/lib/plugin/CreateToc.php 2013-04-16 14:17:35 UTC (rev 8749) +++ trunk/lib/plugin/CreateToc.php 2013-04-16 14:29:36 UTC (rev 8750) @@ -72,14 +72,14 @@ } // Initialisation of toc counter - private function _initTocCounter() + private function initTocCounter() { $counter = array(1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0); return $counter; } // Update toc counter with a new title - private function _tocCounter(&$counter, $level) + private function tocCounter(&$counter, $level) { $counter[$level]++; for ($i = $level + 1; $i <= 5; $i++) { @@ -87,7 +87,7 @@ } } - private function _roman_counter($number) + private function roman_counter($number) { $n = intval($number); @@ -104,7 +104,7 @@ return $result; } - private function _letter_counter($number) + private function letter_counter($number) { if ($number <= 26) { return chr(ord("A") + $number - 1); @@ -114,12 +114,12 @@ } // Get string corresponding to the current title - private function _getCounter(&$counter, $level, $firstlevelstyle) + private function getCounter(&$counter, $level, $firstlevelstyle) { if ($firstlevelstyle == 'roman') { - $str = $this->_roman_counter($counter[1]); + $str = $this->roman_counter($counter[1]); } elseif ($firstlevelstyle == 'letter') { - $str = $this->_letter_counter($counter[1]); + $str = $this->letter_counter($counter[1]); } else { $str = $counter[1]; } @@ -131,7 +131,7 @@ } // Get HTML header corresponding to current level (level is set of ! or =) - private function _getHeader($level) + private function getHeader($level) { $count = substr_count($level, '!'); @@ -159,7 +159,7 @@ return ""; } - private function _quote($heading) + private function quote($heading) { if (TOC_FULL_SYNTAX) { $theading = TransformInline($heading); @@ -181,8 +181,8 @@ { $hstart = 0; $hend = 0; - $h = $this->_getHeader($level); - $qheading = $this->_quote($heading); + $h = $this->getHeader($level); + $qheading = $this->quote($heading); for ($j = $start_index; $j < count($content); $j++) { if (is_string($content[$j])) { if (preg_match("/<$h>$qheading<\/$h>/", @@ -234,7 +234,7 @@ /** prevent from duplicate anchors, * beautify spaces: " " => "_" and not "x20." */ - private function _nextAnchor($s) + private function nextAnchor($s) { static $anchors = array(); @@ -258,7 +258,7 @@ $counter = 0, $levels = false, $firstlevelstyle = 'number', $basepage = '') { if (!$levels) $levels = array(1, 2); - $tocCounter = $this->_initTocCounter(); + $tocCounter = $this->initTocCounter(); reset($levels); sort($levels); $headers = array(); @@ -299,7 +299,7 @@ or (((strpos($trim, '!') === 0)) && ((preg_match('/^\s*(!{' . $phpwikiclassiclevel . ',' . $phpwikiclassiclevel . '})([^!].*)$/', $content[$i], $match)))) ) { - $this->_tocCounter($tocCounter, $level); + $this->tocCounter($tocCounter, $level); if (!strstr($content[$i], '#[')) { $s = trim($match[2]); // If it is Wikicreole syntax, remove '='s at the end @@ -307,11 +307,11 @@ $s = trim($s, "="); $s = trim($s); } - $anchor = $this->_nextAnchor($s); + $anchor = $this->nextAnchor($s); $manchor = MangleXmlIdentifier($anchor); $texts = $s; if ($counter) { - $texts = $this->_getCounter($tocCounter, $level, $firstlevelstyle) . ' ' . $s; + $texts = $this->getCounter($tocCounter, $level, $firstlevelstyle) . ' ' . $s; } $headers[] = array('text' => $texts, 'anchor' => $anchor, @@ -328,9 +328,9 @@ $markup->_basepage); if ($j and isset($markup->_content[$j])) { $x = $markup->_content[$j]; - $qheading = $this->_quote($s); + $qheading = $this->quote($s); if ($counter) - $counterString = $this->_getCounter($tocCounter, $level, $firstlevelstyle); + $counterString = $this->getCounter($tocCounter, $level, $firstlevelstyle); if (($hstart === 0) && is_string($markup->_content[$j])) { if ($backlink) { if ($counter) @@ -354,7 +354,7 @@ } } else { $x = $markup->_content[$hstart]; - $h = $this->_getHeader($match[1]); + $h = $this->getHeader($match[1]); if ($backlink) { if ($counter) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |