Example #1
0
 public function __construct()
 {
     parent::__construct();
     // Lets see if the user is logged in
     if ($this->rightsObj->isLoggedIn() && !$this->rightsObj->isCalAdmin() && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('wec_map') && $this->conf['view.']['calendar.']['nearbyDistance'] > 0) {
         require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('wec_map') . 'class.tx_wecmap_cache.php';
         $user = $GLOBALS['TSFE']->fe_user->user;
         /* Geocode the address */
         $latlong = \tx_wecmap_cache::lookup($user['street'], $user['city'], $user['state'], $user['zip'], $user['country']);
         if (isset($latlong['long']) && isset($latlong['lat'])) {
             $this->internalAdditionTable = ',' . $this->conf['view.']['calendar.']['nearbyAdditionalTable'];
             $this->internalAdditionWhere = ' ' . str_replace(array('###LONGITUDE###', '###LATITUDE###', '###DISTANCE###'), array($latlong['long'], $latlong['lat'], $this->conf['view.']['calendar.']['nearbyDistance']), $this->conf['view.']['calendar.']['nearbyAdditionalWhere']);
         } else {
             $this->internalAdditionWhere = ' AND 1=2';
         }
     } else {
         // not logged in -> we can't localize
         $this->internalAdditionWhere = ' AND 1=2';
     }
 }
Example #2
0
 function unsetPiVars()
 {
     parent::unsetPivars();
     unset($this->controller->piVars['priority']);
     unset($this->controller->piVars['completed']);
     unset($this->controller->piVars['status']);
 }