Ejemplo n.º 1
0
 /**
  * @test
  * @group breadcrumbs
  */
 public function test_should_clear_all_breadcrumbs()
 {
     Breadcrumbs::add(Breadcrumb::factory()->set_title("Crumb 1")->set_url("http://example.com/"));
     Breadcrumbs::add(Breadcrumb::factory()->set_title("Crumb 2"));
     Breadcrumbs::clear();
     $this->assertSame(array(), Breadcrumbs::get());
 }
Ejemplo n.º 2
0
 public function get_list($id = 0)
 {
     $breadcrumbs = Breadcrumbs::get($id);
     $categories = $id ? Category::find($id)->children : Category::where('parent', '=', 0)->get();
     $products = $id ? Category::find($id)->products : array();
     $this->layout->page_title = "Admin - Categories - List";
     $this->layout->page_content = View::make('admin.categories.list')->with('id', $id)->with('breadcrumbs', $breadcrumbs)->with('categories', $categories)->with('products', $products);
 }
Ejemplo n.º 3
0
 /**
  * Set item name.
  *
  * @param   integer  $id    The id of the item on which to set the name.
  * @param   string   $name  The name to set.
  *
  * @return  boolean  True on success
  *
  * @since   11.1
  */
 public function setItemName($id, $name)
 {
     // [!] HUBzero compatibility
     if (class_exists('\\Breadcrumbs')) {
         return \Breadcrumbs::get($id)->name = $name;
     }
     // Initialize variables
     $ret = false;
     if (isset($this->_pathway[$id])) {
         $this->_pathway[$id]->name = $name;
         $ret = true;
     }
     return $ret;
 }