Beispiel #1
0
 function init()
 {
     parent::init();
     RSSFeed::linkToFeed($this->Link() . "rss");
     Requirements::css('jobs/css/jobs.css');
     Requirements::javascript('jobs/js/jobs.js');
 }
Beispiel #2
0
 function init()
 {
     parent::init();
     RSSFeed::linkToFeed($this->Link() . "rss");
     Requirements::css('jobs/css/jobs.css');
     Requirements::javascript('jobs/js/jobs.js');
     $this->repository = new SapphireJobRepository();
 }
 function init()
 {
     RSSFeed::linkToFeed($this->Link() . "rss");
     if (Director::fileExists(project() . "/css/news.css")) {
         Requirements::css(project() . "/css/news.css");
     } else {
         Requirements::css("basic-news/css/news.css");
     }
     parent::init();
 }
 /**
  *
  */
 function init()
 {
     RSSFeed::linkToFeed(Director::baseURL() . $this->URLSegment . "/episodesRSS");
     if (Director::is_ajax()) {
         $this->isAjax = true;
     } else {
         $this->isAjax = false;
     }
     parent::init();
 }
 public function init()
 {
     // Adds the requirements for the Podcast and Episode Page in the correct order
     Requirements::javascript('framework/thirdparty/jquery/jquery.js');
     Requirements::javascript('podcast/thirdparty/mediaelement/mediaelement-and-player.min.js');
     Requirements::javascript('podcast/javascript/podcast-page.js');
     Requirements::css('podcast/thirdparty/mediaelement/mediaelementplayer.min.css');
     Requirements::css('podcast/css/podcast-page.css');
     // Provides a link to the Podcast RSS in the HTML head
     RSSFeed::linkToFeed($this->Link('rss'));
     parent::init();
 }
 /**
  * Overrides the ContentControllerSearchExtension and adds snippets to results.
  */
 function results($data, $form, $request)
 {
     $this->linkToAllSiteRSSFeed();
     $results = $form->getResults();
     $query = $form->getSearchQuery();
     // Add context summaries based on the queries.
     foreach ($results as $result) {
         $contextualTitle = new Text();
         $contextualTitle->setValue($result->MenuTitle ? $result->MenuTitle : $result->Title);
         $result->ContextualTitle = $contextualTitle->ContextSummary(300, $query);
         if (!$result->Content && $result->ClassName == 'File') {
             // Fake some content for the files.
             $result->ContextualContent = "A file named \"{$result->Name}\" ({$result->Size}).";
         } else {
             $result->ContextualContent = $result->obj('Content')->ContextSummary(300, $query);
         }
     }
     $rssLink = HTTP::setGetVar('rss', '1');
     // Render the result.
     $data = array('Results' => $results, 'Query' => $query, 'Title' => _t('SearchForm.SearchResults', 'Search Results'), 'RSSLink' => $rssLink);
     // Choose the delivery method - rss or html.
     if (!$this->owner->request->getVar('rss')) {
         // Add RSS feed to normal search.
         RSSFeed::linkToFeed($rssLink, "Search results for query \"{$query}\".");
         return $this->owner->customise($data)->renderWith(array('Page_results', 'Page'));
     } else {
         // De-paginate and reorder. Sort-by-relevancy doesn't make sense in RSS context.
         $fullList = $results->getList()->sort('LastEdited', 'DESC');
         // Get some descriptive strings
         $siteName = SiteConfig::current_site_config()->Title;
         $siteTagline = SiteConfig::current_site_config()->Tagline;
         if ($siteName) {
             $title = "{$siteName} search results for query \"{$query}\".";
         } else {
             $title = "Search results for query \"{$query}\".";
         }
         // Generate the feed content.
         $rss = new RSSFeed($fullList, $this->owner->request->getURL(), $title, $siteTagline, "Title", "ContextualContent", null);
         $rss->setTemplate('Page_results_rss');
         return $rss->outputToBrowser();
     }
 }
	function init() {
		parent::init();
		RSSFeed::linkToFeed($this->Link() . 'rss');
	}
Beispiel #8
0
 /**
  * The search action
  *
  * @return array Returns an array to render the search results.
  */
 function search()
 {
     $keywords = isset($_REQUEST['Search']) ? Convert::raw2xml($_REQUEST['Search']) : null;
     $order = isset($_REQUEST['order']) ? Convert::raw2xml($_REQUEST['order']) : null;
     $start = isset($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0;
     $abstract = $keywords ? "<p>" . sprintf(_t('ForumHolder.SEARCHEDFOR', "You searched for '%s'."), $keywords) . "</p>" : null;
     // get the results of the query from the current search engine
     $search = ForumSearch::get_search_engine();
     if ($search) {
         $engine = new $search();
         $results = $engine->getResults($this->ID, $keywords, $order, $start);
     } else {
         $results = false;
     }
     // if the user has requested this search as an RSS feed then output the contents as xml
     // rather than passing it to the template
     if (isset($_REQUEST['rss'])) {
         $rss = new RSSFeed($results, $this->Link(), _t('ForumHolder.SEARCHRESULTS', 'Search results'), "", "Title", "RSSContent", "RSSAuthor");
         return $rss->outputToBrowser();
     }
     // attach a link to a RSS feed version of the search results
     $rssLink = $this->Link() . "search/?Search=" . urlencode($keywords) . "&amp;order=" . urlencode($order) . "&amp;rss";
     RSSFeed::linkToFeed($rssLink, _t('ForumHolder.SEARCHRESULTS', 'Search results'));
     return array("Subtitle" => DBField::create('Text', _t('ForumHolder.SEARCHRESULTS', 'Search results')), "Abstract" => DBField::create('HTMLText', $abstract), "Query" => DBField::create('Text', $_REQUEST['Search']), "Order" => DBField::create('Text', $order ? $order : "relevance"), "RSSLink" => DBField::create('HTMLText', $rssLink), "SearchResults" => $results);
 }
 public function init()
 {
     // Provides a link to the Podcast RSS in the HTML head
     RSSFeed::linkToFeed($this->Link('rss'));
     parent::init();
 }
Beispiel #10
0
 public function init()
 {
     parent::init();
     Requirements::themedCSS('news');
     RSSFeed::linkToFeed("{$this->data()->RSSHolder()->Link()}rss");
 }
Beispiel #11
0
 /**
  * Show will get the selected thread to the user. Also increments the forums view count.
  * 
  * If the thread does not exist it will pass the user to the 404 error page
  *
  * @return array|SS_HTTPResponse_Exception
  */
 function show()
 {
     $title = Convert::raw2xml($this->Title);
     if ($thread = $this->getForumThread()) {
         $thread->incNumViews();
         $posts = sprintf(_t('Forum.POSTTOTOPIC', "Posts to the %s topic"), $thread->Title);
         RSSFeed::linkToFeed($this->Link("rss") . '/thread/' . (int) $this->urlParams['ID'], $posts);
         $title = Convert::raw2xml($thread->Title) . ' &raquo; ' . $title;
         return array('Thread' => $thread, 'Title' => DBField::create('HTMLText', $title));
     } else {
         // if redirecting post ids to thread id is enabled then we need
         // to check to see if this matches a post and if it does redirect
         if (Forum::$redirect_post_urls_to_thread && isset($this->urlParams['ID'])) {
             if ($post = DataObject::get_by_id('Post', $this->urlParams['ID'])) {
                 return $this->redirect($post->Link(), 301);
             }
         }
     }
     return $this->httpError(404);
 }
 /**
  * Initialise the controller to include requirements and sort out the rss feed
  */
 public function init()
 {
     parent::init();
     // Include the DateRangeForm JS manually. We use custom form and $DateRangeForm is never invoked directly.
     //Requirements::javascript('framework/javascript/DateField.js');
     //Requirements::css('framework/thirdparty/jquery-ui-themes/smoothness/jquery-ui.css');
     RSSFeed::linkToFeed($this->Link() . 'rss', $this->getSubscriptionTitle());
 }
Beispiel #13
0
	function init() {
		parent::init();
		
		// This will create a <link> tag point to the RSS feed
		RSSFeed::linkToFeed($this->Link() . "rss", _t('BlogHolder.RSSFEED',"RSS feed of this blog"));
		Requirements::themedCSS("blog");
		Requirements::themedCSS("bbcodehelp");

	}
 public function init()
 {
     parent::init();
     RSSFeed::linkToFeed($this->Link() . 'rss', SiteConfig::current_site_config()->Title . ' news');
 }
 public function init()
 {
     RSSFeed::linkToFeed($this->Parent()->Link() . "rss", _t("CalendarEvent.RSSFEED", "RSS Feed of this calendar"));
     parent::init();
     Requirements::css('event_calendar/css/calendar.css');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
     Requirements::javascript('event_calendar/javascript/calendar_core.js');
 }
 public function init()
 {
     parent::init();
     Requirements::CSS("news/css/news.css");
     RSSFeed::linkToFeed($this->Link() . "rss", $this->SiteConfig->Title . " News");
 }
 function init()
 {
     parent::init();
     // Create a <link> tag point to the RSS feed
     RSSFeed::linkToFeed('http://' . $_SERVER['HTTP_HOST'] . $this->Link() . 'rss', $this->RSSTitle);
 }
Beispiel #18
0
 /**
  * This will create a <link> tag point to the RSS feed
  */
 function IncludeBlogRSS()
 {
     RSSFeed::linkToFeed($this->Link('rss'), _t('BlogHolder.RSSFEED', "RSS feed of these blogs"));
 }
 function init()
 {
     RSSFeed::linkToFeed($this->Link() . "rss", "RSS feed of the OpenStack Conference");
     parent::init();
 }
 /**
  * Generates and embeds the RSS header link for the page-specific version rss feed
  */
 public function linkToPageRSSFeed()
 {
     if (!Config::inst()->get('VersionFeed', 'changes_enabled') || !$this->owner->PublicHistory) {
         return;
     }
     RSSFeed::linkToFeed($this->owner->Link('changes'), sprintf(_t('RSSHistory.SINGLEPAGEFEEDTITLE', 'Updates to %s page'), $this->owner->Title));
 }
 public function init()
 {
     RSSFeed::linkToFeed($this->owner->Link() . "rss", _t('News.RSSLINK', "RSS feed for the News"));
     parent::init();
 }
 /**
  * Show will get the selected thread to the user. Also increments the forums view count.
  *
  * If the thread does not exist it will pass the user to the 404 error page
  *
  * @return array|SS_HTTPResponse_Exception
  */
 function show()
 {
     $title = Convert::raw2xml($this->Title);
     if ($thread = $this->getForumThread()) {
         //If there is not first post either the thread has been removed or thread if a banned spammer.
         if (!$thread->getFirstPost()) {
             // don't hide the post for logged in admins or moderators
             $member = Member::currentUser();
             if (!$this->canModerate($member)) {
                 return $this->httpError(404);
             }
         }
         $thread->incNumViews();
         $posts = sprintf(_t('Forum.POSTTOTOPIC', "Posts to the %s topic"), $thread->Title);
         RSSFeed::linkToFeed($this->Link("rss") . '/thread/' . (int) $this->urlParams['ID'], $posts);
         $title = Convert::raw2xml($thread->Title) . ' &raquo; ' . $title;
         $field = DBField::create_field('HTMLText', $title);
         return array('Thread' => $thread, 'Title' => $field);
     } else {
         // if redirecting post ids to thread id is enabled then we need
         // to check to see if this matches a post and if it does redirect
         if (Forum::$redirect_post_urls_to_thread && isset($this->urlParams['ID']) && is_numeric($this->urlParams['ID'])) {
             if ($post = Post::get()->byID($this->urlParams['ID'])) {
                 return $this->redirect($post->Link(), 301);
             }
         }
     }
     return $this->httpError(404);
 }
 public function init()
 {
     RSSFeed::linkToFeed($this->Link() . "rss", "RSS Feed of this calendar");
     $this->parseURL();
     parent::init();
 }
 public function init()
 {
     RSSFeed::linkToFeed($this->Link() . "rss");
     parent::init();
 }
Beispiel #25
0
 public function init()
 {
     RSSFeed::linkToFeed($this->Link() . "rss", "RSS Feed of this calendar");
     parent::init();
     $this->parseURL();
     //$p = new ICSReader(Director::baseFolder()."/event_calendar/code/Home.ics");
     //die(print_r($p->getEvents()));
 }
 public function init()
 {
     RSSFeed::linkToFeed("add-ons/rss", "New modules on addons.silverstripe.org");
     parent::init();
 }
Beispiel #27
0
 /**
  * Renders the search template from a given Solr search result, suggestion and search term.
  * @return HTMLText search results template.
  */
 protected function parseSearchResults($results, $suggestion, $keywords)
 {
     $searchSummary = '';
     // Clean up the results.
     foreach ($results as $result) {
         if (!$result->canView()) {
             $results->remove($result);
         }
     }
     // Generate links
     $searchURL = Director::absoluteURL($this->makeQueryLink(urlencode($keywords)));
     $rssUrl = Controller::join_links($searchURL, '?format=rss');
     RSSFeed::linkToFeed($rssUrl, 'Search results for "' . $keywords . '"');
     /**
      * generate the search summary using string replacement
      * to support translation and max configurability
      */
     if ($results->CurrentPage) {
         $searchSummary = _t('FAQPage.SearchResultsSummary', $this->SearchResultsSummary);
         $keys = array(self::$search_results_summary_current_page_key, self::$search_results_summary_total_pages_key, self::$search_results_summary_query_key);
         $values = array($results->CurrentPage(), $results->TotalPages(), $keywords);
         $searchSummary = str_replace($keys, $values, $searchSummary);
     }
     $renderData = array('SearchResults' => $results, 'SearchSummary' => $searchSummary, 'SearchSuggestion' => $suggestion, 'Query' => DBField::create_field('Text', $keywords), 'SearchLink' => DBField::create_field('Text', $searchURL), 'RSSLink' => DBField::create_field('Text', $rssUrl));
     // remove pagination if required by cms config
     if ($this->SinglePageLimit != '0') {
         $setlimit = intval($this->SinglePageLimit);
         $renderData['SearchResults']->setTotalItems($setlimit);
     }
     return $renderData;
 }
 public function init()
 {
     parent::init();
     RSSFeed::linkToFeed($this->Link() . "rss", $this->RSSTitle ? $this->RSSTitle : $this->Title);
     Requirements::themedCSS('calendar', 'event_calendar');
     if (!Calendar::config()->jquery_included) {
         Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
     }
     Requirements::javascript('event_calendar/javascript/calendar.js');
 }
 function init()
 {
     // We need to make sure these CMSMain scripts are included first
     Requirements::javascript('cms/javascript/CMSMain.js');
     Requirements::javascript('cms/javascript/CMSMain_left.js');
     Requirements::javascript('cms/javascript/CMSMain_right.js');
     CMSBatchActionHandler::register('batchCmsWorkflowSetEmbargo', 'BatchSetEmbargo');
     CMSBatchActionHandler::register('batchCmsWorkflowSetExpiry', 'BatchSetExpiry');
     CMSBatchActionHandler::register('batchCmsWorkflowResetEmbargo', 'BatchResetEmbargo');
     CMSBatchActionHandler::register('batchCmsWorkflowResetExpiry', 'BatchResetExpiry');
     Requirements::javascript('cmsworkflow/javascript/LeftAndMainCMSWorkflow.js');
     Requirements::customScript("CMSWorkflow.setOption('noPromptForAdmin', " . Convert::raw2json(!self::$prompt_admin_for_comments) . ')');
     RSSFeed::linkToFeed(Director::absoluteURL('admin/cms/changes.rss'), 'All content changes');
 }