]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/shownotice.php
Make the OpenID settings work with new framework
[quix0rs-gnu-social.git] / actions / shownotice.php
index 74d197ed1f3b7ac69bec0918408ef6ea8f0b4058..82d4bd27014f25fac5094167681c1413ebc823c9 100644 (file)
@@ -21,13 +21,15 @@ if (!defined('LACONICA')) { exit(1); }
 
 require_once(INSTALLDIR.'/lib/stream.php');
 
-class ShownoticeAction extends StreamAction {
+class ShownoticeAction extends StreamAction
+{
 
-    var $notice = NULL;
-    var $profile = NULL;
-    var $avatar = NULL;
+    var $notice = null;
+    var $profile = null;
+    var $avatar = null;
 
-    function prepare($args) {
+    function prepare($args)
+    {
 
         parent::prepare($args);
 
@@ -35,14 +37,14 @@ class ShownoticeAction extends StreamAction {
         $this->notice = Notice::staticGet($id);
 
         if (!$this->notice) {
-            $this->client_error(_('No such notice.'), 404);
+            $this->clientError(_('No such notice.'), 404);
             return false;
         }
 
         $this->profile = $this->notice->getProfile();
 
         if (!$this->profile) {
-            $this->server_error(_('Notice has no profile'), 500);
+            $this->serverError(_('Notice has no profile'), 500);
             return false;
         }
 
@@ -51,13 +53,15 @@ class ShownoticeAction extends StreamAction {
         return true;
     }
 
-    function last_modified() {
+    function last_modified()
+    {
         return max(strtotime($this->notice->created),
                    strtotime($this->profile->modified),
                    ($this->avatar) ? strtotime($this->avatar->modified) : 0);
     }
 
-    function etag() {
+    function etag()
+    {
         return 'W/"' . implode(':', array($this->arg('action'),
                                           common_language(),
                                           $this->notice->id,
@@ -66,25 +70,27 @@ class ShownoticeAction extends StreamAction {
                                           ($this->avatar) ? strtotime($this->avatar->modified) : 0)) . '"';
     }
 
-    function handle($args) {
+    function handle($args)
+    {
 
         parent::handle($args);
 
         common_show_header(sprintf(_('%1$s\'s status on %2$s'),
                                    $this->profile->nickname,
                                    common_exact_date($this->notice->created)),
-                           array($this, 'show_header'), NULL,
+                           array($this, 'show_header'), null,
                            array($this, 'show_top'));
 
-        common_element_start('ul', array('id' => 'notices'));
+        $this->elementStart('ul', array('id' => 'notices'));
         $nli = new NoticeListItem($this->notice);
         $nli->show();
-        common_element_end('ul');
+        $this->elementEnd('ul');
 
         common_show_footer();
     }
 
-    function show_header() {
+    function show_header()
+    {
 
         $user = User::staticGet($this->profile->id);
 
@@ -93,24 +99,26 @@ class ShownoticeAction extends StreamAction {
         }
 
         if ($user->emailmicroid && $user->email && $this->notice->uri) {
-            common_element('meta', array('name' => 'microid',
+            $this->element('meta', array('name' => 'microid',
                                          'content' => "mailto+http:sha1:" . sha1(sha1('mailto:' . $user->email) . sha1($this->notice->uri))));
         }
 
         if ($user->jabbermicroid && $user->jabber && $this->notice->uri) {
-            common_element('meta', array('name' => 'microid',
+            $this->element('meta', array('name' => 'microid',
                                          'content' => "xmpp+http:sha1:" . sha1(sha1('xmpp:' . $user->jabber) . sha1($this->notice->uri))));
         }
     }
 
-    function show_top() {
+    function show_top()
+    {
         $cur = common_current_user();
         if ($cur && $cur->id == $this->profile->id) {
             common_notice_form();
         }
     }
 
-    function no_such_notice() {
-        common_user_error(_('No such notice.'));
+    function no_such_notice()
+    {
+        $this->clientError(_('No such notice.'));
     }
 }