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.

Revisions

  1. dennisoehme created this gist Aug 1, 2011.
    59 changes: 59 additions & 0 deletions gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,59 @@
    <?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();
    }
    }