Example #1
0
 /**
  * Standard modular render function for profile tabs edit hooks.
  *
  * @param  MEMBER			The ID of the member who is being viewed
  * @param  MEMBER			The ID of the member who is doing the viewing
  * @param  boolean		Whether to leave the tab contents NULL, if tis hook supports it, so that AJAX can load it later
  * @return ?array			A tuple: The tab title, the tab body text (may be blank), the tab fields, extra Javascript (may be blank) the suggested tab order, hidden fields (optional) (NULL: if $leave_to_ajax_if_possible was set)
  */
 function render_tab($member_id_of, $member_id_viewing, $leave_to_ajax_if_possible = false)
 {
     require_lang('notifications');
     $title = do_lang_tempcode('NOTIFICATIONS');
     $order = 100;
     if (strtoupper(ocp_srv('REQUEST_METHOD')) == 'POST') {
         $auto_monitor_contrib_content = post_param_integer('auto_monitor_contrib_content', 0);
         $GLOBALS['FORUM_DB']->query_update('f_members', array('m_auto_monitor_contrib_content' => $auto_monitor_contrib_content), array('id' => $member_id_of), '', 1);
         // Decache from run-time cache
         unset($GLOBALS['FORUM_DRIVER']->MEMBER_ROWS_CACHED[$member_id_of]);
         unset($GLOBALS['MEMBER_CACHE_FIELD_MAPPINGS'][$member_id_of]);
     }
     if ($leave_to_ajax_if_possible && strtoupper(ocp_srv('REQUEST_METHOD')) != 'POST') {
         return NULL;
     }
     require_code('notifications2');
     $text = notifications_ui($member_id_of);
     if ($text->is_empty()) {
         return NULL;
     }
     $javascript = '';
     return array($title, new ocp_tempcode(), $text, $javascript, $order);
 }
Example #2
0
 /**
  * Show an overall notifications UI.
  *
  * @return tempcode	The result of execution.
  */
 function overall()
 {
     $title = get_page_title('NOTIFICATIONS');
     $interface = notifications_ui(get_member());
     return do_template('NOTIFICATIONS_MANAGE_SCREEN', array('TITLE' => $title, 'INTERFACE' => $interface, 'ACTION_URL' => get_self_url()));
 }