Changeset 11164
- Timestamp:
- 08/26/08 21:55:02 (10 months ago)
- Files:
-
- branches/1.2/lib/debug/sfWebDebug.class.php (modified) (3 diffs)
- branches/1.2/lib/debug/sfWebDebugPanel.class.php (modified) (3 diffs)
- branches/1.2/lib/debug/sfWebDebugPanelCache.class.php (modified) (2 diffs)
- branches/1.2/lib/debug/sfWebDebugPanelConfig.class.php (modified) (2 diffs)
- branches/1.2/lib/debug/sfWebDebugPanelLogs.class.php (modified) (2 diffs)
- branches/1.2/lib/debug/sfWebDebugPanelMemory.class.php (modified) (2 diffs)
- branches/1.2/lib/debug/sfWebDebugPanelPropel.class.php (modified) (3 diffs)
- branches/1.2/lib/debug/sfWebDebugPanelSymfonyVersion.class.php (modified) (2 diffs)
- branches/1.2/lib/debug/sfWebDebugPanelTimer.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.2/lib/debug/sfWebDebug.class.php
r11121 r11164 167 167 public function asHtml() 168 168 { 169 $ links= array();169 $titles = array(); 170 170 $panels = array(); 171 171 foreach ($this->panels as $name => $panel) 172 172 { 173 if ($ link = $panel->getLinkText())173 if ($title = $panel->getTitle()) 174 174 { 175 if ($content = $panel->getPanelContent() || $panel->get LinkUrl())175 if ($content = $panel->getPanelContent() || $panel->getTitleUrl()) 176 176 { 177 177 $id = sprintf('sfWebDebug%sDetails', $name); 178 $ links[] = sprintf('<li><a title="%s" alt="%s" href="%s"%s>%s</a></li>',179 $panel->get Title(),180 $panel->get Title(),181 $panel->get LinkUrl() ? $panel->getLinkUrl() : '#',182 $panel->get LinkUrl() ? '' : ' onclick="sfWebDebugShowDetailsFor(\''.$id.'\'); return false;"',183 $ link178 $titles[] = sprintf('<li><a title="%s" alt="%s" href="%s"%s>%s</a></li>', 179 $panel->getPanelTitle(), 180 $panel->getPanelTitle(), 181 $panel->getTitleUrl() ? $panel->getTitleUrl() : '#', 182 $panel->getTitleUrl() ? '' : ' onclick="sfWebDebugShowDetailsFor(\''.$id.'\'); return false;"', 183 $title 184 184 ); 185 185 $panels[] = sprintf('<div id="%s" class="sfWebDebugTop" style="display: none"><h1>%s</h1>%s</div>', 186 186 $id, 187 $panel->get Title(),187 $panel->getPanelTitle(), 188 188 $panel->getPanelContent() 189 189 ); … … 191 191 else 192 192 { 193 $ links[] = sprintf('<li>%s</li>', $link);193 $titles[] = sprintf('<li>%s</li>', $title); 194 194 } 195 195 } … … 202 202 203 203 <ul id="sfWebDebugDetails" class="menu"> 204 '.implode("\n", $ links).'204 '.implode("\n", $titles).' 205 205 </ul> 206 206 <a href="#" onclick="document.getElementById(\'sfWebDebug\').style.display=\'none\'; return false;"><img src="'.$this->options['image_root_path'].'/close.png" /></a> branches/1.2/lib/debug/sfWebDebugPanel.class.php
r11049 r11164 37 37 * @return string The URL link 38 38 */ 39 public function get LinkUrl()39 public function getTitleUrl() 40 40 { 41 41 } … … 46 46 * @return string The link text 47 47 */ 48 abstract public function getLinkText(); 48 abstract public function getTitle(); 49 50 /** 51 * Gets the title of the panel. 52 * 53 * @return string The panel title 54 */ 55 abstract public function getPanelTitle(); 49 56 50 57 /** … … 54 61 */ 55 62 abstract public function getPanelContent(); 56 57 /**58 * Gets the title of the panel.59 *60 * @return string The panel title61 */62 abstract public function getTitle();63 63 } branches/1.2/lib/debug/sfWebDebugPanelCache.class.php
r11048 r11164 20 20 class sfWebDebugPanelCache extends sfWebDebugPanel 21 21 { 22 public function get LinkText()22 public function getTitle() 23 23 { 24 24 return '<img src="'.$this->webDebug->getOption('image_root_path').'/reload.png'.'" />'; 25 25 } 26 26 27 public function get LinkUrl()27 public function getTitleUrl() 28 28 { 29 29 return $_SERVER['PHP_SELF'].((strpos($_SERVER['PHP_SELF'], '_sf_ignore_cache') === false) ? '?_sf_ignore_cache=1' : ''); 30 } 31 32 public function getPanelTitle() 33 { 34 return 'reload and ignore cache'; 30 35 } 31 36 … … 33 38 { 34 39 } 35 36 public function getTitle()37 {38 return 'reload and ignore cache';39 }40 40 } branches/1.2/lib/debug/sfWebDebugPanelConfig.class.php
r11052 r11164 19 19 class sfWebDebugPanelConfig extends sfWebDebugPanel 20 20 { 21 public function get LinkText()21 public function getTitle() 22 22 { 23 23 return '<img src="'.$this->webDebug->getOption('image_root_path').'/config.png" /> config'; 24 } 25 26 public function getPanelTitle() 27 { 28 return 'Configuration'; 24 29 } 25 30 … … 55 60 56 61 return $html; 57 }58 59 public function getTitle()60 {61 return 'Configuration';62 62 } 63 63 branches/1.2/lib/debug/sfWebDebugPanelLogs.class.php
r11076 r11164 19 19 class sfWebDebugPanelLogs extends sfWebDebugPanel 20 20 { 21 public function get LinkText()21 public function getTitle() 22 22 { 23 23 return '<img src="'.$this->webDebug->getOption('image_root_path').'/comment.png" /> logs'; 24 } 25 26 public function getPanelTitle() 27 { 28 return 'Logs'; 24 29 } 25 30 … … 89 94 } 90 95 91 public function getTitle()92 {93 return 'Logs';94 }95 96 96 /** 97 97 * Formats a log line. branches/1.2/lib/debug/sfWebDebugPanelMemory.class.php
r11048 r11164 19 19 class sfWebDebugPanelMemory extends sfWebDebugPanel 20 20 { 21 public function get LinkText()21 public function getTitle() 22 22 { 23 23 if (function_exists('memory_get_usage')) … … 29 29 } 30 30 31 public function getPanelTitle() 32 { 33 } 34 31 35 public function getPanelContent() 32 36 { 33 37 } 34 35 public function getTitle()36 {37 }38 38 } branches/1.2/lib/debug/sfWebDebugPanelPropel.class.php
r11076 r11164 31 31 } 32 32 33 public function get LinkText()33 public function getTitle() 34 34 { 35 35 if ($sqlLogs = $this->getSqlLogs()) … … 37 37 return '<img src="'.$this->webDebug->getOption('image_root_path').'/database.png" /> '.count($sqlLogs); 38 38 } 39 } 40 41 public function getPanelTitle() 42 { 43 return 'SQL queries'; 39 44 } 40 45 … … 46 51 </div> 47 52 '; 48 }49 50 public function getTitle()51 {52 return 'SQL queries';53 53 } 54 54 branches/1.2/lib/debug/sfWebDebugPanelSymfonyVersion.class.php
r11041 r11164 19 19 class sfWebDebugPanelSymfonyVersion extends sfWebDebugPanel 20 20 { 21 public function get LinkText()21 public function getTitle() 22 22 { 23 23 return SYMFONY_VERSION; 24 } 25 26 public function getPanelTitle() 27 { 24 28 } 25 29 … … 27 31 { 28 32 } 29 30 public function getTitle()31 {32 }33 33 } branches/1.2/lib/debug/sfWebDebugPanelTimer.class.php
r11083 r11164 31 31 } 32 32 33 public function get LinkText()33 public function getTitle() 34 34 { 35 35 return '<img src="'.$this->webDebug->getOption('image_root_path').'/time.png" /> '.$this->getTotalTime().' ms'; 36 } 37 38 public function getPanelTitle() 39 { 40 return 'Timers'; 36 41 } 37 42 … … 50 55 return $panel; 51 56 } 52 }53 54 public function getTitle()55 {56 return 'Timers';57 57 } 58 58

