Skip to content

Commit

Permalink
added breadcrumbs widget
Browse files Browse the repository at this point in the history
  • Loading branch information
anton committed Nov 4, 2012
1 parent ac1d69a commit e168a5e
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions components/entity/AmEntityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,6 @@ class AmEntityController extends AmController
protected $entity;
protected $baseEntity;

/**
* @return array
*/
public function getBreadcrumbs()
{
$breadcrumbs = array_reverse(parent::getBreadcrumbs());
$entity = $this->getEntity();
if ('update' === $this->action->id) {
$breadcrumbs[] = 'Update';
$breadcrumbs[$entity->getTitle()] = array('view', 'id' => $entity->getId());
} elseif ('view' === $this->action->id) {
$breadcrumbs[] = $entity->getTitle();
}
$model = $this->getModel();
while ($entity = $entity->getParent()) {
if ($entity->getId() === $model->getId()) {
$url = array($this->defaultAction);
} else {
$action = $entity->canList() ? 'list' : 'view';
$url = array($action, 'id' => $entity->getId());
}
$breadcrumbs[$entity->getTitle()] = $url;
}
return array_reverse($breadcrumbs);
}

public function actionList()
{
$this->render('list', array(
Expand Down

0 comments on commit e168a5e

Please sign in to comment.