Example #1
0
 /**
  * Display the whole thang
  *
  * @param array $data
  */
 public function display($data = array())
 {
     $template = new \SimpleSubscribe\Template('adminApi.latte');
     $templateGuts = $this->hasMessages() ? $this->getMessages() : \SimpleSubscribe\FrontEnd::unsubscriptionForm();
     $templateAction = $this->hasMessages() ? 'Confirm Subscription' : 'Unsubscribe';
     $templateBackUrl = $this->settings->getBackLinkUrl();
     $defaults = array('action' => $templateAction, 'stylesheetUrl' => SUBSCRIBE_ASSETS . 'styleApi.css', 'guts' => $templateGuts, 'backLink' => '<a href="' . $templateBackUrl . '">Back to homepage &raquo;</a>');
     $template->prepareTemplate($defaults, $data);
     echo $template->getTemplate();
 }
Example #2
0
 /**
  * Unsubscription form shortcode
  */
 public static function unsubscriptionForm()
 {
     $template = \SimpleSubscribe\FrontEnd::unsubscriptionForm(FALSE);
     echo $template;
 }
Example #3
0
 /**
  * Front-end display of widget.
  *
  * @see WP_Widget::widget()
  *
  * @param array $args     Widget arguments.
  * @param array $instance Saved values from database.
  */
 public function widget($args, $instance)
 {
     $template = FrontEnd::unsubscriptionForm(TRUE, array_merge($args, $instance));
     echo $template;
 }