From 5fb94f874da6dbb4016e42508d7e4770f82d926c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 25 Aug 2009 18:30:48 -0400 Subject: Laconica -> StatusNet in EVENTS.txt --- EVENTS.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'EVENTS.txt') diff --git a/EVENTS.txt b/EVENTS.txt index 2c43469d4..59de6de5f 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -20,10 +20,10 @@ StartShowStyles: Showing Style links; good place to add UA style resets EndShowStyles: End showing Style links; good place to add custom styles - $action: the current action -StartShowLaconicaStyles: Showing Laconica Style links +StartShowStatusNetStyles: Showing StatusNet Style links - $action: the current action -EndShowLaconicaStyles: End showing Laconica Style links; good place to add handheld or JavaScript dependant styles +EndShowStatusNetStyles: End showing StatusNet Style links; good place to add handheld or JavaScript dependant styles - $action: the current action StartShowUAStyles: Showing custom UA Style links @@ -45,10 +45,10 @@ StartShowJQueryScripts: Showing JQuery script links (use this to link to e.g. Go EndShowJQueryScripts: End showing JQuery script links - $action: the current action -StartShowLaconicaScripts: Showing Laconica script links (use this to link to a CDN or something) +StartShowStatusNetScripts: Showing StatusNet script links (use this to link to a CDN or something) - $action: the current action -EndShowLaconicaScripts: End showing Laconica script links +EndShowStatusNetScripts: End showing StatusNet script links - $action: the current action StartShowSections: Start the list of sections in the sidebar -- cgit v1.2.3-54-g00ecf From 379c80e26e2de30841f7fb49e7e967e675a4951f Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 26 Aug 2009 10:33:04 -0400 Subject: add *Laconica* events back in for backwards compatibility --- EVENTS.txt | 12 ++++++++++++ lib/action.php | 10 ++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'EVENTS.txt') diff --git a/EVENTS.txt b/EVENTS.txt index 59de6de5f..68cb28603 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -26,6 +26,12 @@ StartShowStatusNetStyles: Showing StatusNet Style links EndShowStatusNetStyles: End showing StatusNet Style links; good place to add handheld or JavaScript dependant styles - $action: the current action +StartShowLaconicaStyles: backwards compatibility; deprecated +- $action: the current action + +EndShowLaconicaStyles: backwards compatibility; deprecated +- $action: the current action + StartShowUAStyles: Showing custom UA Style links - $action: the current action @@ -51,6 +57,12 @@ StartShowStatusNetScripts: Showing StatusNet script links (use this to link to a EndShowStatusNetScripts: End showing StatusNet script links - $action: the current action +StartShowLaconicaScripts: backwards compatibility; deprecated +- $action: the current action + +EndShowLaconicaScripts: backwards compatibility; deprecated +- $action: the current action + StartShowSections: Start the list of sections in the sidebar - $action: the current action diff --git a/lib/action.php b/lib/action.php index a99c885dd..cb922f60e 100644 --- a/lib/action.php +++ b/lib/action.php @@ -192,7 +192,10 @@ class Action extends HTMLOutputter // lawsuit { if (Event::handle('StartShowStyles', array($this))) { - if (Event::handle('StartShowStatusNetStyles', array($this))) { + // Use old name for StatusNet for compatibility on events + + if (Event::handle('StartShowStatusNetStyles', array($this)) && + Event::handle('StartShowLaconicaStyles', array($this))) { $this->cssLink('css/display.css',null,'screen, projection, tv'); if (common_config('site', 'mobile')) { // TODO: "handheld" CSS for other mobile devices @@ -200,6 +203,7 @@ class Action extends HTMLOutputter // lawsuit } $this->cssLink('css/print.css','base','print'); Event::handle('EndShowStatusNetStyles', array($this)); + Event::handle('EndShowLaconicaStyles', array($this)); } if (Event::handle('StartShowUAStyles', array($this))) { @@ -249,13 +253,15 @@ class Action extends HTMLOutputter // lawsuit $this->script('js/jquery.joverlay.min.js'); Event::handle('EndShowJQueryScripts', array($this)); } - if (Event::handle('StartShowStatusNetScripts', array($this))) { + if (Event::handle('StartShowStatusNetScripts', array($this)) && + Event::handle('StartShowLaconicaScripts', array($this))) { $this->script('js/xbImportNode.js'); $this->script('js/util.js'); // Frame-busting code to avoid clickjacking attacks. $this->element('script', array('type' => 'text/javascript'), 'if (window.top !== window.self) { window.top.location.href = window.self.location.href; }'); Event::handle('EndShowStatusNetScripts', array($this)); + Event::handle('EndShowLaconicaScripts', array($this)); } Event::handle('EndShowScripts', array($this)); } -- cgit v1.2.3-54-g00ecf From 6e570a8440108ac0d16253d35543be19b1c2a713 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Fri, 28 Aug 2009 14:42:51 -0400 Subject: Added 2 new events: StartApiRss and StartApiAtom --- EVENTS.txt | 7 +++++++ lib/twitterapi.php | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'EVENTS.txt') diff --git a/EVENTS.txt b/EVENTS.txt index 05d172585..121ae175d 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -247,3 +247,10 @@ StartLoadDoc: before loading a help doc (hook this to show your own documentatio EndLoadDoc: after loading a help doc (hook this to modify other documentation) - $title: title of the document - $output: HTML output to show + +StartApiRss: after the rss element is started +- $action: action object being shown + +StartApiAtom: after the element is started +- $action: action object being shown + diff --git a/lib/twitterapi.php b/lib/twitterapi.php index 9055d8b98..4612f74e9 100644 --- a/lib/twitterapi.php +++ b/lib/twitterapi.php @@ -595,7 +595,6 @@ class TwitterapiAction extends Action $this->init_document('rss'); - $this->elementStart('channel'); $this->element('title', null, $title); $this->element('link', null, $link); if (!is_null($suplink)) { @@ -621,7 +620,6 @@ class TwitterapiAction extends Action } } - $this->elementEnd('channel'); $this->end_twitter_rss(); } @@ -668,7 +666,6 @@ class TwitterapiAction extends Action $this->init_document('rss'); - $this->elementStart('channel'); $this->element('title', null, $title); $this->element('link', null, $link); $this->element('description', null, $subtitle); @@ -687,7 +684,6 @@ class TwitterapiAction extends Action } } - $this->elementEnd('channel'); $this->end_twitter_rss(); } @@ -944,11 +940,14 @@ class TwitterapiAction extends Action function init_twitter_rss() { $this->startXML(); - $this->elementStart('rss', array('version' => '2.0')); + $this->elementStart('rss', array('version' => '2.0', 'xmlns:atom'=>'http://www.w3.org/2005/Atom')); + $this->elementStart('channel'); + Event::handle('StartApiRss', array($this)); } function end_twitter_rss() { + $this->elementEnd('channel'); $this->elementEnd('rss'); $this->endXML(); } @@ -960,6 +959,7 @@ class TwitterapiAction extends Action $this->elementStart('feed', array('xmlns' => 'http://www.w3.org/2005/Atom', 'xml:lang' => 'en-US', 'xmlns:thr' => 'http://purl.org/syndication/thread/1.0')); + Event::handle('StartApiAtom', array($this)); } function end_twitter_atom() -- cgit v1.2.3-54-g00ecf