/** * Prepare the variables for the html head * * @param string $title Page title for <head> * @return array * @access private */ function _elgg_views_prepare_head($title) { $params = array('links' => array(), 'metas' => array()); if (empty($title)) { $params['title'] = elgg_get_config('sitename'); } else { $params['title'] = $title . ' : ' . elgg_get_config('sitename'); } $params['metas']['content-type'] = array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=utf-8'); $params['metas']['description'] = array('name' => 'description', 'content' => elgg_get_config('sitedescription')); // https://developer.chrome.com/multidevice/android/installtohomescreen $params['metas']['viewport'] = array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0'); $params['metas']['mobile-web-app-capable'] = array('name' => 'mobile-web-app-capable', 'content' => 'yes'); $params['metas']['apple-mobile-web-app-capable'] = array('name' => 'apple-mobile-web-app-capable', 'content' => 'yes'); // RSS feed link if (_elgg_has_rss_link()) { $url = current_page_url(); if (substr_count($url, '?')) { $url .= "&view=rss"; } else { $url .= "?view=rss"; } $params['links']['rss'] = array('rel' => 'alternative', 'type' => 'application/rss+xml', 'title' => 'RSS', 'href' => elgg_format_url($url)); } return $params; }
/** * Add the RSS link to the extras menu * @access private */ function _elgg_extras_menu_setup($hook, $type, $return, $params) { if (!elgg_is_logged_in()) { return; } if (!_elgg_has_rss_link()) { return; } $url = current_page_url(); $return[] = ElggMenuItem::factory(['name' => 'rss', 'text' => elgg_echo('feed:rss'), 'icon' => 'rss', 'href' => elgg_http_add_url_query_elements($url, ['view' => 'rss']), 'title' => elgg_echo('feed:rss')]); return $return; }