Skip to content

Instantly share code, notes, and snippets.

@dennisoehme
Created August 1, 2011 15:04
Show Gist options
  • Select an option

  • Save dennisoehme/1118297 to your computer and use it in GitHub Desktop.

Select an option

Save dennisoehme/1118297 to your computer and use it in GitHub Desktop.
SitemapHandling
<?php
class DetailsController extends Controller
{
public function overviewAction($id)
{
$contact = $this->_loadContact($id);
$bookings = $this->_loadBookings($id);
$this->getSitemap()->register($contact);
//$this->getSitemap()->register($bookings);
$contact->delete();
$values = array('customer' => $contact,
'bookings' => array());
if ($this->get('request')->query->has('ajax')) {
return $this->render('AdticketElvisContactBundle::Details/_overview.html.twig', $values);
}
return $values;
}
}
class Sitemap_Details_Overview extends Sitemap_Details_Abstract
{
public function configure()
{
$contact = $this->get('contact');
if ($contact->hasAttribute('vvk')) {
$this->addTab('Vorverkaufsstelle', 'contact_details_vvk');
}
if ($this->acl->isAllowed('edit', $contact))
{
$this->add('action', array('label' => 'Kontakt editieren', 'show'=> $this->isDeleteable()));
}
}
public function __call($name, $attr)
{
$type= "Tab";
$type = $this->container->get('goc_menu.type'.$type, $attr);
}
public function add($typeName, $attr)
{
}
public function isDeleteable()
{
$this->container->get('contact_acl')->isDeletable();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment