]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/noticelist.php
ServerErrorAction always logs
[quix0rs-gnu-social.git] / lib / noticelist.php
index 55dd902b4a3def0933b3c7a2fed3d431dd4d661c..44726a17b7b7a3da4116724bc0ed1d4c69b8d35b 100644 (file)
@@ -34,6 +34,7 @@ if (!defined('LACONICA')) {
 
 require_once INSTALLDIR.'/lib/favorform.php';
 require_once INSTALLDIR.'/lib/disfavorform.php';
+require_once INSTALLDIR.'/lib/attachmentlist.php';
 
 /**
  * widget for displaying a list of notices
@@ -49,7 +50,6 @@ require_once INSTALLDIR.'/lib/disfavorform.php';
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link     http://laconi.ca/
  * @see      Notice
- * @see      StreamAction
  * @see      NoticeListItem
  * @see      ProfileNoticeList
  */
@@ -85,7 +85,7 @@ class NoticeList extends Widget
     {
         $this->out->elementStart('div', array('id' =>'notices_primary'));
         $this->out->element('h2', null, _('Notices'));
-        $this->out->elementStart('ul', array('class' => 'notices'));
+        $this->out->elementStart('ol', array('class' => 'notices xoxo'));
 
         $cnt = 0;
 
@@ -100,7 +100,7 @@ class NoticeList extends Widget
             $item->show();
         }
 
-        $this->out->elementEnd('ul');
+        $this->out->elementEnd('ol');
         $this->out->elementEnd('div');
 
         return $cnt;
@@ -179,86 +179,22 @@ class NoticeListItem extends Widget
     {
         $this->showStart();
         $this->showNotice();
-        $this->showNoticeAttachments();
-        $this->showNoticeOptions();
         $this->showNoticeInfo();
+        $this->showNoticeOptions();
         $this->showEnd();
     }
 
     function showNotice()
     {
-if (0)
-        $this->out->elementStart('entry-title');
-else
-
-        if ('shownotice' === $this->out->args['action']) {
-            $width = '85%';
-        } else {
-            $width = '90%';
-        }
-
-
-        $this->out->elementStart('div', array('class' => 'entry-title', 'style' => "float: left; width: $width;"));
+        $this->out->elementStart('div', 'entry-title');
         $this->showAuthor();
         $this->showContent();
         $this->out->elementEnd('div');
     }
 
-    function showNoticeAttachments()
-    {
-        $f2p = new File_to_post;
-        $f2p->post_id = $this->notice->id;
-        $file = new File;
-        $file->joinAdd($f2p);
-        $file->selectAdd();
-        $file->selectAdd('file.id as id');
-        $count = $file->find(true);
-        if (!$count) return;
-        if (1 === $count) {
-            $href = common_local_url('attachment', array('attachment' => $file->id));
-            $att_class = 'attachment';
-        } else {
-            $href = common_local_url('attachments', array('notice' => $this->notice->id));
-            $att_class = 'attachments';
-        }
-
-        $clip = theme_path('images/icons/clip', 'base');
-        if ('shownotice' === $this->out->args['action']) {
-            $height = '96px';
-            $width = '83%';
-            $width_att = '15%';
-            $clip .= '-big.png';
-            $top = '70px';
-        } else {
-            $height = '48px';
-            $width = '90%';
-            $width_att = '8%';
-            $clip .= '.png';
-            $top = '20px';
-        }
-if (0)
-        $this->out->elementStart('div', 'entry-attachments');
-else
-        $this->out->elementStart('p', array('class' => 'entry-attachments', 'style' => "float: right; width: $width_att; background: url($clip) no-repeat; text-align: right; height: $height;"));
-        $this->out->element('a', array('class' => $att_class, 'style' => "text-decoration: none; padding-top: $top; display: block; height: $height;", 'href' => $href, 'title' => "# of attachments: $count"), $count === 1 ? '' : $count);
-
-
-        $this->out->elementEnd('p');
-    }
-
     function showNoticeInfo()
     {
-if(0)
         $this->out->elementStart('div', 'entry-content');
-else
-
-        if ('shownotice' === $this->out->args['action']) {
-            $width = '85%';
-        } else {
-            $width = '90%';
-        }
-
-        $this->out->elementStart('div', array('class' => 'entry-content', 'style' => "float: left; width: $width;"));
         $this->showNoticeLink();
         $this->showNoticeSource();
         $this->showContext();
@@ -269,10 +205,7 @@ else
     {
         $user = common_current_user();
         if ($user) {
-if(0)
             $this->out->elementStart('div', 'notice-options');
-else
-            $this->out->elementStart('div', array('class' => 'notice-options', 'style' => 'float: right; width: 16%;'));
             $this->showFaveForm();
             $this->showReplyLink();
             $this->showDeleteLink();
@@ -433,6 +366,7 @@ else
         $this->out->element('abbr', array('class' => 'published',
                                           'title' => $dt),
                             common_date_string($this->notice->created));
+
         $this->out->elementEnd('a');
         $this->out->elementEnd('dd');
         $this->out->elementEnd('dl');
@@ -498,7 +432,7 @@ else
             $this->out->elementStart('dl', 'response');
             $this->out->element('dt', null, _('To'));
             $this->out->elementStart('dd');
-            $this->out->element('a', array('href' => $convurl),
+            $this->out->element('a', array('href' => $convurl.'#notice-'.$this->notice->id),
                                 _('in context'));
             $this->out->elementEnd('dd');
             $this->out->elementEnd('dl');