[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/cms/src/fetcher/ -> lmbCmsNodeBreadcrumbsFetcher.class.php (source)

   1  <?php
   2  /*
   3   * Limb PHP Framework
   4   *
   5   * @link http://limb-project.com 
   6   * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
   7   * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
   8   */
   9  
  10  lmb_require('limb/web_app/src/fetcher/lmbFetcher.class.php');
  11  lmb_require('limb/active_record/src/lmbActiveRecord.class.php');
  12  
  13  /**

  14   * class lmbCmsNodeBreadcrumbsFetcher.

  15   *

  16   * @package cms

  17   * @version $Id: lmbCmsNodeBreadcrumbsFetcher.class.php 5945 2007-06-06 08:31:43Z pachanga $

  18   */
  19  class lmbCmsNodeBreadcrumbsFetcher extends lmbFetcher
  20  {
  21    function _createDataSet()
  22    {
  23      $path = lmbToolkit :: instance()->getRequest()->getUri()->getPath();
  24  
  25      if(!$node = lmbCmsNode :: findByPath($path))
  26        return new lmbCollection();
  27  
  28      $parents = $node->getParents();
  29  
  30      $result = array();
  31      $skip_root = true;
  32      $path = '';
  33  
  34      foreach($parents as $parent)
  35      {
  36        if($skip_root)
  37        {
  38          $skip_root = false;
  39          continue;
  40        }
  41        $path .= '/' . $parent->get('identifier');
  42        $parent->setUrlPath($path);
  43        $result[] = $parent;
  44      }
  45  
  46      $node->setUrlPath($path . '/' . $node->getIdentifier());
  47      $node->setIsLast(true);
  48      $result[] = $node;
  49  
  50      return new lmbCollection($result);
  51    }
  52  
  53  }
  54  
  55  ?>


Generated: Fri Aug 29 04:49:26 2008 Cross-referenced by PHPXref 0.7