Esempio n. 1
0
 /**
  *  Display the widget
  */
 public function widget($args, $instance)
 {
     // check api access
     if (glome_check_app() == false) {
         return;
     }
     // request Glome key
     if (isset($_SESSION['glome']) === false) {
         $_SESSION['glome'] = array();
     }
     if (!isset($_SESSION['glome']['glomeid'])) {
         $instance['key'] = glome_get_key();
     }
     //Hide the widget for logged in users?
     if (isset($instance['key']['code']) and (empty($instance['widget_hide_for_logged_in_users']) or !is_user_logged_in())) {
         //Before Widget
         echo $args['before_widget'];
         //Title
         if (!empty($instance['widget_title'])) {
             echo $args['before_title'] . apply_filters('widget_title', $instance['widget_title']) . $args['after_title'];
         }
         //Content
         echo render_key_login('widget', $instance);
         //After Widget
         echo $args['after_widget'];
     }
 }
Esempio n. 2
0
 /**
  *  Display the widget
  */
 public function widget($args, $instance)
 {
     //Hide the widget for not logged in visitors if configured so
     if (!empty($instance['widget_hide_for_visitors']) && !is_user_logged_in()) {
         return;
     }
     //Hide the widget for logged in users if configured so
     if (!empty($instance['widget_hide_for_logged_in_users']) && is_user_logged_in()) {
         return;
     }
     // check api access
     if (glome_check_app() == false) {
         return;
     }
     //Before Widget
     echo $args['before_widget'];
     //Title
     if (!empty($instance['widget_title'])) {
         echo $args['before_title'] . apply_filters('widget_title', $instance['widget_title']) . $args['after_title'];
     }
     //Content
     echo render_enter_key('widget', $instance);
     //After Widget
     echo $args['after_widget'];
 }
Esempio n. 3
0
 /**
  *  Display the widget
  */
 public function widget($args, $instance)
 {
     if (!is_user_logged_in()) {
         return;
     }
     // check api access
     if (glome_check_app() == false) {
         return;
     }
     //Before Widget
     echo $args['before_widget'];
     //Title
     if (!empty($instance['widget_title'])) {
         echo $args['before_title'] . apply_filters('widget_title', $instance['widget_title']) . $args['after_title'];
     }
     //Content
     echo render_show_qr('widget', $instance);
     //After Widget
     echo $args['after_widget'];
 }