You are here

class AuthcacheForumNumNewSetting in Authenticated User Page Caching (Authcache) 7.2

Setting for retrieving new-flags on a list of forum topics.

Hierarchy

Expanded class hierarchy of AuthcacheForumNumNewSetting

1 string reference to 'AuthcacheForumNumNewSetting'
authcache_forum_authcache_p13n_setting in modules/authcache_forum/authcache_forum.module
Implements hook_authcache_p13n_setting().

File

modules/authcache_forum/includes/AuthcacheForumNumNewSetting.inc, line 11
Defines a personalization setting for retrieving the number of new topics on the forum list.

View source
class AuthcacheForumNumNewSetting implements AuthcacheP13nSettingInterface {

  /**
   * Number of new forum topics for user.
   *
   * @see forum.module
   */
  public function get($params, $context) {
    global $user;

    // Include node.module for NODE_NEW_LIMIT.
    include_once DRUPAL_ROOT . '/modules/node/node.module';
    include_once DRUPAL_ROOT . '/modules/forum/forum.module';
    $result = array();
    foreach ($params as $tid) {
      $result[$tid] = (int) _forum_topics_unread($tid, $user->uid);
    }
    return array_filter($result);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AuthcacheForumNumNewSetting::get public function Number of new forum topics for user. Overrides AuthcacheP13nSettingInterface::get