system/modules/DocumentManagementSystem/dca/tl_dms_categories.php
public function addBreadcrumb(\DataContainer $dc)
  {
    // Set a new cat
    if (isset($_GET['cat']))
    {
      $this->Session->set('tl_category_id', $this->Input->get('cat'));
      $this->redirect(preg_replace('/&cat=[^&]*/', '', $this->Environment->request));
    }

    $intCategoryId = $this->Session->get('tl_category_id');

    if ($intCategoryId < 1)
    {
      return;
    }

    $arrIds = array();
    $arrLinks = array();

    // Generate breadcrumb trail
    $category = $this->getCategoryForId($intCategoryId, true, false);

    if ($category == null)
    {
      $this->Session->set('tl_category_id', 0);
      return;
    }

    // Add root link
    $arrLinks[] = '<img src="system/modules/DocumentManagementSystem/assets/dms.png" width="16" height="16" alt=""> <a href="' . $this->addToUrl('cat=0') . '">' . $GLOBALS['TL_LANG']['MSC']['filterAll'] . '</a>';
    foreach ($category->getPath(false) as $eachCategory)
    {
      $image = 'category.png';
      if (!$eachCategory->isPublished())
      {
        $image = 'category_1.png';
      }
      if ($eachCategory->id == $intCategoryId)
      {
        $arrLinks[] = $this->generateImage('system/modules/DocumentManagementSystem/assets/' . $image, '', "") . ' ' . $eachCategory->name;
      }
      else
      {
        $arrLinks[] = $this->generateImage('system/modules/DocumentManagementSystem/assets/' . $image, '', "") . ' <a href="' . $this->addToUrl('cat='.$eachCategory->id) . '">' . $eachCategory->name . '</a>';
      }
    }

    // Limit tree
    $GLOBALS['TL_DCA']['tl_dms_categories']['list']['sorting']['root'] = array($intCategoryId);

    // Insert breadcrumb menu
    $GLOBALS['TL_DCA']['tl_dms_categories']['list']['sorting']['breadcrumb'] .= '

<ul id="tl_breadcrumb">
  <li>' . implode(' &gt; </li><li>', $arrLinks) . '</li>
</ul>';
  }
public function addBreadcrumb(\DataContainer $dc)
  {
    // Set a new cat
    if (isset($_GET['cat']))
    {
      $this->Session->set('tl_category_id', $this->Input->get('cat'));
      $this->redirect(preg_replace('/&cat=[^&]*/', '', $this->Environment->request));
    }

    $intCategoryId = $this->Session->get('tl_category_id');

    if ($intCategoryId < 1)
    {
      return;
    }

    $arrIds = array();
    $arrLinks = array();

    // Generate breadcrumb trail
    $category = $this->getCategoryForId($intCategoryId, true, false);

    if ($category == null)
    {
      $this->Session->set('tl_category_id', 0);
      return;
    }

    // Add root link
    $arrLinks[] = '<img src="system/modules/DocumentManagementSystem/assets/dms.png" width="16" height="16" alt=""> <a href="' . $this->addToUrl('cat=0') . '">' . $GLOBALS['TL_LANG']['MSC']['filterAll'] . '</a>';
    foreach ($category->getPath(false) as $eachCategory)
    {
      $image = 'category.png';
      if (!$eachCategory->isPublished())
      {
        $image = 'category_1.png';
      }
      if ($eachCategory->id == $intCategoryId)
      {
        $arrLinks[] = $this->generateImage('system/modules/DocumentManagementSystem/assets/' . $image, '', "") . ' ' . $eachCategory->name;
      }
      else
      {
        $arrLinks[] = $this->generateImage('system/modules/DocumentManagementSystem/assets/' . $image, '', "") . ' <a href="' . $this->addToUrl('cat='.$eachCategory->id) . '">' . $eachCategory->name . '</a>';
      }
    }

    // Limit tree
    $GLOBALS['TL_DCA']['tl_dms_categories']['list']['sorting']['root'] = array($intCategoryId);

    // Insert breadcrumb menu
    $GLOBALS['TL_DCA']['tl_dms_categories']['list']['sorting']['breadcrumb'] .= '

<ul id="tl_breadcrumb">
  <li>' . implode(' &gt; </li><li>', $arrLinks) . '</li>
</ul>';
  }
public function addBreadcrumb ( \ DataContainer $ dc ) { // Set a new cat if ( isset ( $ _GET [ 'cat' ] ) ) { $ this -> Session -> set ( 'tl_category_id' , $ this -> Input -> get ( 'cat' ) ) ; $ this -> redirect ( preg_replace ( '/&cat=[^&]*/' , '' , $ this -> Environment -> request ) ) ; } $ intCategoryId = $ this -> Session -> get ( 'tl_category_id' ) ; if ( $ intCategoryId < 1 ) { return ; } $ arrIds = array ( ) ; $ arrLinks = array ( ) ; // Generate breadcrumb trail $ category = $ this -> getCategoryForId ( $ intCategoryId , true , false ) ; if ( $ category == null ) { $ this -> Session -> set ( 'tl_category_id' , 0 ) ; return ; } // Add root link $ arrLinks [ ] = '<img src="system/modules/DocumentManagementSystem/assets/dms.png" width="16" height="16" alt=""> <a href="' . $ this -> addToUrl ( 'cat=0' ) . '">' . $ GLOBALS [ 'TL_LANG' ] [ 'MSC' ] [ 'filterAll' ] . '</a>' ; foreach ( $ category -> getPath ( false ) as $ eachCategory ) { $ image = 'category.png' ; if ( ! $ eachCategory -> isPublished ( ) ) { $ image = 'category_1.png' ; } if ( $ eachCategory -> id == $ intCategoryId ) { $ arrLinks [ ] = $ this -> generateImage ( 'system/modules/DocumentManagementSystem/assets/' . $ image , '' , "" ) . ' ' . $ eachCategory -> name ; } else { $ arrLinks [ ] = $ this -> generateImage ( 'system/modules/DocumentManagementSystem/assets/' . $ image , '' , "" ) . ' <a href="' . $ this -> addToUrl ( 'cat=' . $ eachCategory -> id ) . '">' . $ eachCategory -> name . '</a>' ; } } // Limit tree $ GLOBALS [ 'TL_DCA' ] [ 'tl_dms_categories' ] [ 'list' ] [ 'sorting' ] [ 'root' ] = array ( $ intCategoryId ) ; // Insert breadcrumb menu $ GLOBALS [ 'TL_DCA' ] [ 'tl_dms_categories' ] [ 'list' ] [ 'sorting' ] [ 'breadcrumb' ] .= '

<ul id="tl_breadcrumb">
  <li>' . implode ( ' &gt; </li><li>' , $ arrLinks ) . '</li>
</ul>' ; }
Add the breadcrumb menu
Add the breadcrumb menu