예제 #1
0
 /**
  * Handle the tree segments.
  *
  * @param PageTreeBuilder $builder
  */
 public function handle(PageTreeBuilder $builder)
 {
     $builder->setSegments(['entry.edit_link', ['class' => 'text-muted', 'value' => function (PageInterface $entry) {
         return '<span class="small" style="padding-right:10px;">' . $entry->type->name . '</span>';
     }], ['data-toggle' => 'tooltip', 'class' => 'text-success', 'value' => '<i class="fa fa-home"></i>', 'attributes' => ['title' => 'module::message.home'], 'enabled' => function (PageInterface $entry) {
         return $entry->isHome();
     }], ['data-toggle' => 'tooltip', 'class' => 'text-muted', 'value' => '<i class="fa fa-chain-broken"></i>', 'attributes' => ['title' => 'module::message.hidden'], 'enabled' => function (PageInterface $entry) {
         return !$entry->isVisible();
     }], ['data-toggle' => 'tooltip', 'class' => 'text-muted', 'value' => '<i class="fa fa-lock"></i>', 'attributes' => ['title' => 'module::message.restricted'], 'enabled' => function (PageInterface $entry) {
         $roles = $entry->getAllowedRoles();
         return !$roles->isEmpty();
     }], ['data-toggle' => 'tooltip', 'class' => 'text-danger', 'value' => '<i class="fa fa-ban"></i>', 'attributes' => ['title' => 'module::message.disabled'], 'enabled' => function (PageInterface $entry) {
         return !$entry->isEnabled();
     }]]);
 }
예제 #2
0
 /**
  * Return a tree of existing pages.
  *
  * @param PageTreeBuilder $tree
  * @return \Illuminate\Http\Response
  */
 public function index(PageTreeBuilder $tree)
 {
     return $tree->render();
 }