C_Widget_MediaRSS

The NextGEN Gallery C Widget MediaRSS class.

Defined (1)

The class is defined in the following location(s).

/products/photocrati_nextgen/modules/widget/package.module.widget.php  
  1. class C_Widget_MediaRSS extends WP_Widget 
  2. var $options; 
  3. function __construct() 
  4. $widget_ops = array('classname' => 'ngg_mrssw', 'description' => __('Widget that displays Media RSS links for NextGEN Gallery.', 'nggallery')); 
  5. parent::__construct('ngg-mrssw', __('NextGEN Media RSS', 'nggallery'), $widget_ops); 
  6. function form($instance) 
  7. // used for rendering utilities 
  8. $parent = C_Widget::get_instance(); 
  9. // defaults 
  10. $instance = wp_parse_args((array) $instance, array('mrss_text' => __('Media RSS', 'nggallery'), 'mrss_title' => __('Link to the main image feed', 'nggallery'), 'show_global_mrss' => TRUE, 'show_icon' => TRUE, 'title' => 'Media RSS')); 
  11. $parent->render_partial('photocrati-widget#form_mediarss', array('self' => $this, 'instance' => $instance, 'title' => esc_attr($instance['title']), 'mrss_text' => esc_attr($instance['mrss_text']), 'mrss_title' => esc_attr($instance['mrss_title']))); 
  12. function update($new_instance, $old_instance) 
  13. $instance = $old_instance; 
  14. $instance['title'] = strip_tags($new_instance['title']); 
  15. $instance['show_global_mrss'] = $new_instance['show_global_mrss']; 
  16. $instance['show_icon'] = $new_instance['show_icon']; 
  17. $instance['mrss_text'] = $new_instance['mrss_text']; 
  18. $instance['mrss_title'] = $new_instance['mrss_title']; 
  19. return $instance; 
  20. function widget($args, $instance) 
  21. // these are handled by extract() but I want to silence my IDE warnings that these vars don't exist 
  22. $before_widget = NULL; 
  23. $before_title = NULL; 
  24. $after_widget = NULL; 
  25. $after_title = NULL; 
  26. $widget_id = NULL; 
  27. extract($args); 
  28. $settings = C_NextGen_Settings::get_instance(); 
  29. $parent = C_Component_Registry::get_instance()->get_utility('I_Widget'); 
  30. $title = apply_filters('widget_title', empty($instance['title']) ? ' ' : $instance['title'], $instance, $this->id_base); 
  31. $parent->render_partial('photocrati-widget#display_mediarss', array('self' => $this, 'instance' => $instance, 'title' => $title, 'settings' => $settings, 'before_widget' => $before_widget, 'before_title' => $before_title, 'after_widget' => $after_widget, 'after_title' => $after_title, 'widget_id' => $widget_id)); 
  32. function get_mrss_link($mrss_url, $show_icon = TRUE, $title, $text) 
  33. $out = ''; 
  34. if ($show_icon) { 
  35. $icon_url = NGGALLERY_URLPATH . 'images/mrss-icon.gif'; 
  36. $out .= "<a href='{$mrss_url}' title='{$title}' class='ngg-media-rss-link'>"; 
  37. $out .= "<img src='{$icon_url}' alt='MediaRSS Icon' title='" . $title . "' class='ngg-media-rss-icon' />"; 
  38. $out .= "</a> "; 
  39. if ($text != '') { 
  40. $out .= "<a href='{$mrss_url}' title='{$title}' class='ngg-media-rss-link'>"; 
  41. $out .= $text; 
  42. $out .= "</a>"; 
  43. return $out;