Development

Changeset 11164

You must first sign up to be able to contribute.

Changeset 11164

Show
Ignore:
Timestamp:
08/26/08 21:55:02 (10 months ago)
Author:
fabien
Message:

[1.2] changed the sfWebDebugPanel method names

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.2/lib/debug/sfWebDebug.class.php

    r11121 r11164  
    167167  public function asHtml() 
    168168  { 
    169     $links = array(); 
     169    $titles = array(); 
    170170    $panels = array(); 
    171171    foreach ($this->panels as $name => $panel) 
    172172    { 
    173       if ($link = $panel->getLinkText()) 
     173      if ($title = $panel->getTitle()) 
    174174      { 
    175         if ($content = $panel->getPanelContent() || $panel->getLinkUrl()) 
     175        if ($content = $panel->getPanelContent() || $panel->getTitleUrl()) 
    176176        { 
    177177          $id = sprintf('sfWebDebug%sDetails', $name); 
    178           $links[]  = sprintf('<li><a title="%s" alt="%s" href="%s"%s>%s</a></li>', 
    179             $panel->getTitle(), 
    180             $panel->getTitle(), 
    181             $panel->getLinkUrl() ? $panel->getLinkUrl() : '#', 
    182             $panel->getLinkUrl() ? '' : ' onclick="sfWebDebugShowDetailsFor(\''.$id.'\'); return false;"', 
    183             $link 
     178          $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 
    184184          ); 
    185185          $panels[] = sprintf('<div id="%s" class="sfWebDebugTop" style="display: none"><h1>%s</h1>%s</div>', 
    186186            $id, 
    187             $panel->getTitle(), 
     187            $panel->getPanelTitle(), 
    188188            $panel->getPanelContent() 
    189189          ); 
     
    191191        else 
    192192        { 
    193           $links[] = sprintf('<li>%s</li>', $link); 
     193          $titles[] = sprintf('<li>%s</li>', $title); 
    194194        } 
    195195      } 
     
    202202 
    203203          <ul id="sfWebDebugDetails" class="menu"> 
    204             '.implode("\n", $links).' 
     204            '.implode("\n", $titles).' 
    205205          </ul> 
    206206          <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  
    3737   * @return string The URL link 
    3838   */ 
    39   public function getLinkUrl() 
     39  public function getTitleUrl() 
    4040  { 
    4141  } 
     
    4646   * @return string The link text 
    4747   */ 
    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(); 
    4956 
    5057  /** 
     
    5461   */ 
    5562  abstract public function getPanelContent(); 
    56  
    57   /** 
    58    * Gets the title of the panel. 
    59    * 
    60    * @return string The panel title 
    61    */ 
    62   abstract public function getTitle(); 
    6363} 
  • branches/1.2/lib/debug/sfWebDebugPanelCache.class.php

    r11048 r11164  
    2020class sfWebDebugPanelCache extends sfWebDebugPanel 
    2121{ 
    22   public function getLinkText() 
     22  public function getTitle() 
    2323  { 
    2424    return '<img src="'.$this->webDebug->getOption('image_root_path').'/reload.png'.'" />'; 
    2525  } 
    2626 
    27   public function getLinkUrl() 
     27  public function getTitleUrl() 
    2828  { 
    2929    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'; 
    3035  } 
    3136 
     
    3338  { 
    3439  } 
    35  
    36   public function getTitle() 
    37   { 
    38     return 'reload and ignore cache'; 
    39   } 
    4040} 
  • branches/1.2/lib/debug/sfWebDebugPanelConfig.class.php

    r11052 r11164  
    1919class sfWebDebugPanelConfig extends sfWebDebugPanel 
    2020{ 
    21   public function getLinkText() 
     21  public function getTitle() 
    2222  { 
    2323    return '<img src="'.$this->webDebug->getOption('image_root_path').'/config.png" /> config'; 
     24  } 
     25 
     26  public function getPanelTitle() 
     27  { 
     28    return 'Configuration'; 
    2429  } 
    2530 
     
    5560 
    5661    return $html; 
    57   } 
    58  
    59   public function getTitle() 
    60   { 
    61     return 'Configuration'; 
    6262  } 
    6363 
  • branches/1.2/lib/debug/sfWebDebugPanelLogs.class.php

    r11076 r11164  
    1919class sfWebDebugPanelLogs extends sfWebDebugPanel 
    2020{ 
    21   public function getLinkText() 
     21  public function getTitle() 
    2222  { 
    2323    return '<img src="'.$this->webDebug->getOption('image_root_path').'/comment.png" /> logs'; 
     24  } 
     25 
     26  public function getPanelTitle() 
     27  { 
     28    return 'Logs'; 
    2429  } 
    2530 
     
    8994  } 
    9095 
    91   public function getTitle() 
    92   { 
    93     return 'Logs'; 
    94   } 
    95  
    9696  /** 
    9797   * Formats a log line. 
  • branches/1.2/lib/debug/sfWebDebugPanelMemory.class.php

    r11048 r11164  
    1919class sfWebDebugPanelMemory extends sfWebDebugPanel 
    2020{ 
    21   public function getLinkText() 
     21  public function getTitle() 
    2222  { 
    2323    if (function_exists('memory_get_usage')) 
     
    2929  } 
    3030 
     31  public function getPanelTitle() 
     32  { 
     33  } 
     34 
    3135  public function getPanelContent() 
    3236  { 
    3337  } 
    34  
    35   public function getTitle() 
    36   { 
    37   } 
    3838} 
  • branches/1.2/lib/debug/sfWebDebugPanelPropel.class.php

    r11076 r11164  
    3131  } 
    3232 
    33   public function getLinkText() 
     33  public function getTitle() 
    3434  { 
    3535    if ($sqlLogs = $this->getSqlLogs()) 
     
    3737      return '<img src="'.$this->webDebug->getOption('image_root_path').'/database.png" /> '.count($sqlLogs); 
    3838    } 
     39  } 
     40 
     41  public function getPanelTitle() 
     42  { 
     43    return 'SQL queries'; 
    3944  } 
    4045 
     
    4651      </div> 
    4752    '; 
    48   } 
    49  
    50   public function getTitle() 
    51   { 
    52     return 'SQL queries'; 
    5353  } 
    5454 
  • branches/1.2/lib/debug/sfWebDebugPanelSymfonyVersion.class.php

    r11041 r11164  
    1919class sfWebDebugPanelSymfonyVersion extends sfWebDebugPanel 
    2020{ 
    21   public function getLinkText() 
     21  public function getTitle() 
    2222  { 
    2323    return SYMFONY_VERSION; 
     24  } 
     25 
     26  public function getPanelTitle() 
     27  { 
    2428  } 
    2529 
     
    2731  { 
    2832  } 
    29  
    30   public function getTitle() 
    31   { 
    32   } 
    3333} 
  • branches/1.2/lib/debug/sfWebDebugPanelTimer.class.php

    r11083 r11164  
    3131  } 
    3232 
    33   public function getLinkText() 
     33  public function getTitle() 
    3434  { 
    3535    return '<img src="'.$this->webDebug->getOption('image_root_path').'/time.png" /> '.$this->getTotalTime().' ms'; 
     36  } 
     37 
     38  public function getPanelTitle() 
     39  { 
     40    return 'Timers'; 
    3641  } 
    3742 
     
    5055      return $panel; 
    5156    } 
    52   } 
    53  
    54   public function getTitle() 
    55   { 
    56     return 'Timers'; 
    5757  } 
    5858 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.