/** * @function getAllLocations() * * Returns everything necessary to build a map/modal in frontend * TODO: Response-data, especially those regarding additional Html-Head-files, * should be caplsulated in a more native function/automated process (in both, JS and Drupal) */ public function getAllLocations() { $akteure = new akteure(); $events = new events(); # We only want future events to be shown... $start = array('0' => array('date' => (new \DateTime(date()))->format('Y-m-d 00:00:00'), 'operator' => '>=')); $resultAkteure = $akteure->getAkteure(array('filter' => array('mustHaveGps' => 1)), 'minimal'); $resultEvents = $events->getEvents(array('start' => $start, 'filter' => array('mustHaveGps' => 1), 'parent_EID' => NULL), 'complete'); drupal_add_http_header('Content-Type', 'application/json'); echo '{ "response" : { "akteure" : ' . json_encode($resultAkteure) . ', "events" : ' . json_encode($resultEvents) . ', "htmlHeaders" : { "css" : "' . $this->mapboxCss . '", "js" : "' . $this->mapboxJs . '", "jsInline" : "' . $this->mapboxJsInline . '", "mapName" : "' . $this->mapboxMap . '" } }}'; drupal_exit(); }
function __construct($action) { parent::__construct(); $explodedpath = explode('/', current_path()); $this->akteur_id = $this->clearContent($explodedpath[1]); if (!user_is_logged_in() || $action == 'update' && !$this->akteurExists($this->akteur_id)) { drupal_access_denied(); drupal_exit(); } // Sollen die Werte im Anschluss gespeichert oder geupdatet werden? if ($action == 'update') { $this->target = 'update'; } }
public function __construct() { parent::__construct(); $explodedpath = explode("/", current_path()); $this->akteur_id = $this->clearContent($explodedpath[1]); }