getModel('alert'); $application =& JFactory :: getApplication(); $option = JRequest :: getVar('option'); $view = JRequest :: getVar('view'); $itemId = JRequest :: getVar('Itemid'); if (JFactory :: getUser() -> guest) JFactory :: getApplication() -> redirect(JRoute :: _('index.php?option=com_user&view=login&return=' . base64_encode(JRoute :: _('index.php?option=' . $option . '&view=' . $view . '&Itemid=' . $itemId, false)), false)); switch (JRequest :: getVar('action')) { case 'add': $model -> addSubscription(JRequest :: getVar('templateId'), JRequest :: getVar('notificationService'), JRequest :: getVar('queryId'), JRequest :: getVar('resultId'), JRequest :: getVar('alertMode'), JRequest :: getVar('batchPeriod')); $application -> redirect(JRoute :: _('index.php?option=' . $option . '&view=' . $view . '&Itemid=' . $itemId, false)); break; case 'remove': $model -> removeSubscription(JRequest :: getVar('templateId'), JRequest :: getVar('notificationService'), JRequest :: getVar('queryId'), JRequest :: getVar('resultId'), JRequest :: getVar('alertMode'), JRequest :: getVar('subscriber')); $application -> redirect(JRoute :: _('index.php?option=' . $option . '&view=' . $view . '&Itemid=' . $itemId, false)); break; default: $this -> assign('alertModes', $model -> getAlertModes()); $this -> assign('subscriptions', $model -> getSubscriptions()); parent :: display($template); return; } } } ?>