Development

Changeset 3985

You must first sign up to be able to contribute.

Changeset 3985

Show
Ignore:
Timestamp:
05/09/07 17:49:56 (1 year ago)
Author:
superhaggis
Message:

Added category check; error message is presented if no live categories found.
Added initial docblocks.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfBBPlugin/modules/sfBB/lib/sfBBPlugin_sfBBActions.class.php

    r3959 r3985  
    2020class sfBBPlugin_sfBBActions extends sfActions 
    2121{ 
     22  /** 
     23   * Determines the CSS theme, using default value if relevant config value  
     24   * hasn't been set. 
     25   */ 
    2226  public function preExecute() 
    2327  { 
     
    2731  } 
    2832 
     33  /** 
     34   * The homepage action of sfBB. 
     35   * Grabs a list of live categories. 
     36   */ 
    2937  public function executeIndex() 
    3038  { 
     39    $this->categories = array(); 
     40 
    3141    $c = new Criteria(); 
    3242    $c->add(sfBBCategoryPeer::IS_LIVE, true); 
    33     $this->categories = sfBBCategoryPeer::doSelect($c); 
     43 
     44    if ($categories = sfBBCategoryPeer::doSelect($c)) 
     45    { 
     46      $this->categories = $categories; 
     47    } 
    3448  } 
    3549 
     50  /** 
     51   * Grabs a live forum based on the request parameter. 
     52   * Invalid forum IDs result in a 404. 
     53   */ 
    3654  public function executeViewForum() 
    3755  { 
  • plugins/sfBBPlugin/modules/sfBB/templates/indexSuccess.php

    r3677 r3985  
    11<?php use_helper('sfBB', 'Text') ?> 
    22 
     3<?php if (count($categories) > 0): ?> 
    34<div id="categories"> 
    45  <?php foreach ($categories as $category): ?> 
     
    2728  <?php endforeach ?> 
    2829</div> 
     30<?php else: ?> 
     31<div id="error"> 
     32  There are no categories; please log into the admin section and add some. 
     33</div> 
     34<?php endif ?>