Development

Changeset 25165

You must first sign up to be able to contribute.

Changeset 25165

Show
Ignore:
Timestamp:
12/10/09 03:42:00 (3 years ago)
Author:
weaverryan
Message:

updating the documentation plugin to hold the more with symfony book

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/ac2009WebDebugPlugin/lib/debug/acWebDebugPanelDocumentation.class.php

    r25164 r25165  
    3434  ); 
    3535   
     36  protected $moreWithSymfonyChapters = array( 
     37    'Day 1 - Introduction'                      => 'http://www.symfony-project.org/advent_calendar/1/en', 
     38    'Day 2 - Advanced Routing (part 1)'         => 'http://www.symfony-project.org/advent_calendar/2/en', 
     39    'Day 3 - Advanced Routing (part 2)'         => 'http://www.symfony-project.org/advent_calendar/3/en', 
     40    'Day 4 - Enhance your Productivity'         => 'http://www.symfony-project.org/advent_calendar/4/en', 
     41    'Day 5 - Emails (part 1)'                   => 'http://www.symfony-project.org/advent_calendar/5/en', 
     42    'Day 6 - Emails (part 2)'                   => 'http://www.symfony-project.org/advent_calendar/6/en', 
     43    'Day 7 - Custom Widgets and Validators'     => 'http://www.symfony-project.org/advent_calendar/7/en', 
     44    'Day 8 - Advanced Forms (part 1)'           => 'http://www.symfony-project.org/advent_calendar/8/en', 
     45    'Day 9 - Advanced Forms (part 2)'           => 'http://www.symfony-project.org/advent_calendar/9/en', 
     46    'Day 10 - Extending the Web Debug Toolbar'  => 'http://www.symfony-project.org/advent_calendar/10/en', 
     47    'Day 11 - Advanced Doctrine Usage (part 1)' => 'http://www.symfony-project.org/advent_calendar/11/en', 
     48    'Day 12 - Advanced Doctrine Usage (part 2)' => 'http://www.symfony-project.org/advent_calendar/12/en', 
     49    'Day 13 - The Lazy Day'                     => 'http://www.symfony-project.org/advent_calendar/13/en', 
     50    'Day 14 - Taking Advantage of Doctrine Table Inheritance (part 1)' => 'http://www.symfony-project.org/advent_calendar/14/en', 
     51    'Day 15 - Taking Advantage of Doctrine Table Inheritance (part 2)' => 'http://www.symfony-project.org/advent_calendar/15/en', 
     52    'Day 16 - Symfony Internals'                => 'http://www.symfony-project.org/advent_calendar/16/en', 
     53    'Day 17 - Windows and symfony'              => 'http://www.symfony-project.org/advent_calendar/17/en', 
     54    'Day 18 - Developing for Facebook (part 1)' => 'http://www.symfony-project.org/advent_calendar/18/en', 
     55    'Day 19 - Developing for Facebook (part 2)' => 'http://www.symfony-project.org/advent_calendar/19/en', 
     56    'Day 20 - Leveraging the Power of the Command Line (part 1)' => 'http://www.symfony-project.org/advent_calendar/20/en', 
     57    'Day 21 - Leveraging the Power of the Command Line (part 2)' => 'http://www.symfony-project.org/advent_calendar/21/en', 
     58    'Day 22 - Playing with symfony\'s Config Cache (part 1)' => 'http://www.symfony-project.org/advent_calendar/22/en', 
     59    'Day 23 - Playing with symfony\'s Config Cache (part 2)' => 'http://www.symfony-project.org/advent_calendar/23/en', 
     60    'Day 24 - Working with the symfony Community' => 'http://www.symfony-project.org/advent_calendar/24/en', 
     61  ); 
     62   
     63  /** 
     64   * @see sfWebDebugPanel 
     65   */ 
    3666  public function getTitle() 
    3767  { 
     
    3969  } 
    4070 
     71  /** 
     72   * @see sfWebDebugPanel 
     73   */ 
    4174  public function getPanelTitle() 
    4275  { 
     
    4477  } 
    4578   
     79  /** 
     80   * @see sfWebDebugPanel 
     81   */ 
    4682  public function getPanelContent() 
    4783  { 
    48     $content = sprintf('<h3>The Definitive Guide to symfony %s</h3>', $this->getToggler('definitive_guide', 'The Definitive Guide to symfony')); 
     84    return sprintf( 
     85      '<table><tbody><tr><td>%s</td><td width="50">&nbsp;</td><td>%s</td></tr></tbody></table>', 
     86      $this->getBookContent('The Definitive Guide to symfony', $this->definitiveGuideChapters, 'ac2009_definitive_guide'), 
     87      $this->getBookContent('More with Symfony', $this->moreWithSymfonyChapters, 'ac2009_more_with_symfony') 
     88    ); 
     89  } 
     90   
     91  /** 
     92   * Returns the content that outlines a specific book 
     93   *  
     94   * @param   string  $title      The title of the book we're highlighting 
     95   * @param   array   $chapters   An array of chapter titles and urls 
     96   *  
     97   * @return  string 
     98   */ 
     99  protected function getBookContent($title, $chapters, $domId) 
     100  { 
     101    $content = sprintf('<h3>%s %s</h3>', $title, $this->getToggler($domId, $title)); 
    49102     
    50103    $chptContent = ''; 
    51     foreach($this->definitiveGuideChapters as $title => $url) 
     104    foreach($chapters as $chapter => $url) 
    52105    { 
    53       $chptContent .= sprintf('<li><a href="%s" title="Read %s" target="_blank">%s</a></li>', $url, $title, $title); 
     106      $chptContent .= sprintf('<li><a href="%s" title="Read %s" target="_blank">%s</a></li>', $url, $chapter, $chapter); 
    54107    } 
    55     $content .= sprintf('<style type="text/css">#definitive_guide a:hover { text-decoration: underline; }</style><ul id="definitive_guide" style="display: none; list-style-type: none;">%s</ul>', $chptContent); 
     108    $content .= sprintf(' 
     109      <style type="text/css"> 
     110        #%s { list-style-type: none; } 
     111        #%s li { margin: 0 } 
     112        #%s a:hover { text-decoration: underline; } 
     113      </style> 
     114      <ul id="%s" style="display: none; ">%s</ul>', 
     115      $domId, 
     116      $domId, 
     117      $domId, 
     118      $domId, 
     119      $chptContent 
     120    ); 
    56121     
    57122    return $content;