Exemplo n.º 1
0
 public static function updateCrumb($label, $crumb = array('status' => 'current'), $newLabel = '')
 {
     if (array_key_exists($label, self::$_crumbs)) {
         if ($newLabel == '') {
             self::$_crumbs[$label] = $crumb;
         } else {
             $newCrumbs = array();
             foreach (self::$_crumbs as $oldLabel => $oldCrumb) {
                 if ($oldLabel == $label) {
                     $newCrumbs[$newLabel] = $crumb;
                 } else {
                     $newCrumbs[$oldLabel] = $oldCrumb;
                 }
             }
             self::$_crumbs = $newCrumbs;
         }
     } else {
         self::pushCrumb($newLabel !== '' ? $newLabel : $label, $crumb);
     }
 }