| 
									
										
										
										
											2008-05-08 22:16:04 -04:00
										 |  |  | <?php | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  | /** | 
					
						
							| 
									
										
										
										
											2009-08-25 18:12:20 -04:00
										 |  |  |  * StatusNet, the distributed open-source microblogging tool | 
					
						
							| 
									
										
										
										
											2008-05-20 15:14:12 -04:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |  * Show a single notice | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * PHP version 5 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * LICENCE: This program is free software: you can redistribute it and/or modify | 
					
						
							| 
									
										
										
										
											2008-05-14 15:26:48 -04:00
										 |  |  |  * it under the terms of the GNU Affero General Public License as published by | 
					
						
							|  |  |  |  * the Free Software Foundation, either version 3 of the License, or | 
					
						
							|  |  |  |  * (at your option) any later version. | 
					
						
							| 
									
										
										
										
											2008-05-20 15:14:12 -04:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2008-05-14 15:26:48 -04:00
										 |  |  |  * This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  |  * GNU Affero General Public License for more details. | 
					
						
							| 
									
										
										
										
											2008-05-20 15:14:12 -04:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2008-05-14 15:26:48 -04:00
										 |  |  |  * You should have received a copy of the GNU Affero General Public License | 
					
						
							|  |  |  |  * along with this program.  If not, see <http://www.gnu.org/licenses/>. | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * @category  Personal | 
					
						
							| 
									
										
										
										
											2009-08-25 18:12:20 -04:00
										 |  |  |  * @package   StatusNet | 
					
						
							| 
									
										
										
										
											2009-08-25 18:19:04 -04:00
										 |  |  |  * @author    Evan Prodromou <evan@status.net> | 
					
						
							| 
									
										
										
										
											2009-08-25 18:12:20 -04:00
										 |  |  |  * @copyright 2008-2009 StatusNet, Inc. | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 | 
					
						
							| 
									
										
										
										
											2009-08-25 18:16:46 -04:00
										 |  |  |  * @link      http://status.net/ | 
					
						
							| 
									
										
										
										
											2008-05-14 15:26:48 -04:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-08-26 10:41:36 -04:00
										 |  |  | if (!defined('STATUSNET') && !defined('LACONICA')) { | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |     exit(1); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2008-05-08 22:16:04 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  | require_once INSTALLDIR.'/lib/personalgroupnav.php'; | 
					
						
							|  |  |  | require_once INSTALLDIR.'/lib/noticelist.php'; | 
					
						
							|  |  |  | require_once INSTALLDIR.'/lib/feedlist.php'; | 
					
						
							| 
									
										
										
										
											2008-06-10 18:19:10 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  | /** | 
					
						
							|  |  |  |  * Show a single notice | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @category Personal | 
					
						
							| 
									
										
										
										
											2009-08-25 18:12:20 -04:00
										 |  |  |  * @package  StatusNet | 
					
						
							| 
									
										
										
										
											2009-08-25 18:19:04 -04:00
										 |  |  |  * @author   Evan Prodromou <evan@status.net> | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 | 
					
						
							| 
									
										
										
										
											2009-08-25 18:16:46 -04:00
										 |  |  |  * @link     http://status.net/ | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-02 08:21:54 -04:00
										 |  |  | class ShownoticeAction extends OwnerDesignAction | 
					
						
							| 
									
										
										
										
											2008-12-23 14:49:23 -05:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * Notice object to show | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2008-05-08 22:16:04 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-23 14:21:29 -05:00
										 |  |  |     var $notice = null; | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Profile of the notice object | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-23 14:21:29 -05:00
										 |  |  |     var $profile = null; | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Avatar of the profile of the notice object | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-23 14:21:29 -05:00
										 |  |  |     var $avatar = null; | 
					
						
							| 
									
										
										
										
											2008-12-02 00:02:00 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * Load attributes based on database arguments | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * Loads all the DB stuff | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @param array $args $_REQUEST array | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return success flag | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-23 14:33:23 -05:00
										 |  |  |     function prepare($args) | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |         parent::prepare($args); | 
					
						
							| 
									
										
										
										
											2008-12-01 23:12:43 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |         $id = $this->arg('notice'); | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |         $this->notice = Notice::staticGet($id); | 
					
						
							| 
									
										
										
										
											2008-05-08 22:16:04 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-02 08:21:54 -04:00
										 |  |  |         if (empty($this->notice)) { | 
					
						
							| 
									
										
										
										
											2009-07-16 00:56:32 -04:00
										 |  |  |             // Did we used to have it, and it got deleted?
 | 
					
						
							|  |  |  |             $deleted = Deleted_notice::staticGet($id); | 
					
						
							|  |  |  |             if (!empty($deleted)) { | 
					
						
							|  |  |  |                 $this->clientError(_('Notice deleted.'), 410); | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 $this->clientError(_('No such notice.'), 404); | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |             return false; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2008-05-08 22:16:04 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |         $this->profile = $this->notice->getProfile(); | 
					
						
							| 
									
										
										
										
											2008-06-27 18:29:30 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-02 08:21:54 -04:00
										 |  |  |         if (empty($this->profile)) { | 
					
						
							| 
									
										
										
										
											2009-01-15 23:03:38 +00:00
										 |  |  |             $this->serverError(_('Notice has no profile'), 500); | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |             return false; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2008-05-20 15:14:12 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-02 08:21:54 -04:00
										 |  |  |         $this->user = User::staticGet('id', $this->profile->id); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-07 20:59:31 +00:00
										 |  |  |         if ($this->notice->is_local == Notice::REMOTE_OMB) { | 
					
						
							| 
									
										
										
										
											2009-08-07 18:26:12 -04:00
										 |  |  |             common_redirect($this->notice->uri); | 
					
						
							| 
									
										
										
										
											2009-07-02 08:21:54 -04:00
										 |  |  |             return false; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-23 05:11:04 +00:00
										 |  |  |         $this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE); | 
					
						
							| 
									
										
										
										
											2008-12-01 23:50:21 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |         return true; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2008-12-01 23:12:43 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * Is this action read-only? | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return boolean true | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-13 15:49:26 -04:00
										 |  |  |     function isReadOnly($args) | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |     { | 
					
						
							|  |  |  |         return true; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Last-modified date for page | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * When was the content of this page last modified? Based on notice, | 
					
						
							|  |  |  |      * profile, avatar. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return int last-modified date as unix timestamp | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     function lastModified() | 
					
						
							| 
									
										
										
										
											2008-12-23 14:33:23 -05:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2009-05-30 21:45:11 -04:00
										 |  |  |         return max(strtotime($this->notice->modified), | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |                    strtotime($this->profile->modified), | 
					
						
							|  |  |  |                    ($this->avatar) ? strtotime($this->avatar->modified) : 0); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2008-12-01 23:50:21 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * An entity tag for this page | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * Shows the ETag for the page, based on the notice ID and timestamps | 
					
						
							|  |  |  |      * for the notice, profile, and avatar. It's weak, since we change | 
					
						
							|  |  |  |      * the date text "one hour ago", etc. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return string etag | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-23 14:33:23 -05:00
										 |  |  |     function etag() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |         $avtime = ($this->avatar) ? | 
					
						
							|  |  |  |           strtotime($this->avatar->modified) : 0; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |         return 'W/"' . implode(':', array($this->arg('action'), | 
					
						
							|  |  |  |                                           common_language(), | 
					
						
							|  |  |  |                                           $this->notice->id, | 
					
						
							|  |  |  |                                           strtotime($this->notice->created), | 
					
						
							|  |  |  |                                           strtotime($this->profile->modified), | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |                                           $avtime)) . '"'; | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2008-12-01 23:12:43 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * Title of the page | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return string title of the page | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     function title() | 
					
						
							| 
									
										
										
										
											2008-12-23 14:33:23 -05:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2009-07-02 08:21:54 -04:00
										 |  |  |         if (!empty($this->profile->fullname)) { | 
					
						
							| 
									
										
										
										
											2010-03-13 11:54:04 -08:00
										 |  |  |             $base = $this->profile->fullname . ' (' . $this->profile->nickname . ')'; | 
					
						
							| 
									
										
										
										
											2009-07-02 08:21:54 -04:00
										 |  |  |         } else { | 
					
						
							| 
									
										
										
										
											2009-10-30 16:53:23 -04:00
										 |  |  |             $base = $this->profile->nickname; | 
					
						
							| 
									
										
										
										
											2009-07-02 08:21:54 -04:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |         return sprintf(_('%1$s\'s status on %2$s'), | 
					
						
							| 
									
										
										
										
											2009-07-02 08:21:54 -04:00
										 |  |  |                        $base, | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |                        common_exact_date($this->notice->created)); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Handle input | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * Only handles get, so just show the page. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @param array $args $_REQUEST data (unused) | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return void | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2008-05-20 15:14:12 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |     function handle($args) | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |         parent::handle($args); | 
					
						
							| 
									
										
										
										
											2008-12-01 23:12:43 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-08-19 08:34:17 +02:00
										 |  |  |         if ($this->notice->is_local == Notice::REMOTE_OMB) { | 
					
						
							| 
									
										
										
										
											2009-03-19 11:36:24 -04:00
										 |  |  |             if (!empty($this->notice->url)) { | 
					
						
							|  |  |  |                 common_redirect($this->notice->url, 301); | 
					
						
							|  |  |  |             } else if (!empty($this->notice->uri) && preg_match('/^https?:/', $this->notice->uri)) { | 
					
						
							|  |  |  |                 common_redirect($this->notice->uri, 301); | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             $this->showPage(); | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2008-05-20 15:14:12 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-19 17:12:35 +00:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2009-11-09 20:01:46 +01:00
										 |  |  |      * Don't show local navigation | 
					
						
							| 
									
										
										
										
											2009-01-19 17:12:35 +00:00
										 |  |  |      * | 
					
						
							|  |  |  |      * @return void | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     function showLocalNavBlock() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * Fill the content area of the page | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * Shows a single notice list item. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return void | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     function showContent() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2009-05-29 02:38:38 +00:00
										 |  |  |         $this->elementStart('ol', array('class' => 'notices xoxo')); | 
					
						
							| 
									
										
										
										
											2009-06-23 07:25:18 -07:00
										 |  |  |         $nli = new SingleNoticeItem($this->notice, $this); | 
					
						
							| 
									
										
										
										
											2008-12-11 18:12:52 -05:00
										 |  |  |         $nli->show(); | 
					
						
							| 
									
										
										
										
											2009-05-29 02:38:38 +00:00
										 |  |  |         $this->elementEnd('ol'); | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2008-05-20 15:14:12 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-19 17:12:35 +00:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2009-11-09 20:01:46 +01:00
										 |  |  |      * Don't show page notice | 
					
						
							| 
									
										
										
										
											2009-01-19 17:12:35 +00:00
										 |  |  |      * | 
					
						
							|  |  |  |      * @return void | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     function showPageNoticeBlock() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							| 
									
										
										
										
											2009-11-09 20:01:46 +01:00
										 |  |  |      * Don't show aside | 
					
						
							| 
									
										
										
										
											2009-01-19 17:12:35 +00:00
										 |  |  |      * | 
					
						
							|  |  |  |      * @return void | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     function showAside() { | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * Extra <head> content | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * We show the microid(s) for the author, if any. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return void | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2008-12-01 23:12:43 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |     function extraHead() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |         $user = User::staticGet($this->profile->id); | 
					
						
							| 
									
										
										
										
											2008-12-01 23:12:43 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |         if (!$user) { | 
					
						
							|  |  |  |             return; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2008-12-01 23:12:43 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |         if ($user->emailmicroid && $user->email && $this->notice->uri) { | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |             $id = new Microid('mailto:'. $user->email, | 
					
						
							|  |  |  |                               $this->notice->uri); | 
					
						
							| 
									
										
										
										
											2009-01-15 22:57:15 +00:00
										 |  |  |             $this->element('meta', array('name' => 'microid', | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |                                          'content' => $id->toString())); | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2008-12-01 23:12:43 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |         if ($user->jabbermicroid && $user->jabber && $this->notice->uri) { | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |             $id = new Microid('xmpp:', $user->jabber, | 
					
						
							|  |  |  |                               $this->notice->uri); | 
					
						
							| 
									
										
										
										
											2009-01-15 22:57:15 +00:00
										 |  |  |             $this->element('meta', array('name' => 'microid', | 
					
						
							| 
									
										
										
										
											2009-01-18 18:35:11 +00:00
										 |  |  |                                          'content' => $id->toString())); | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2009-07-15 15:11:29 -04:00
										 |  |  |         $this->element('link',array('rel'=>'alternate', | 
					
						
							|  |  |  |             'type'=>'application/json+oembed', | 
					
						
							|  |  |  |             'href'=>common_local_url( | 
					
						
							| 
									
										
										
										
											2009-08-11 21:15:42 -04:00
										 |  |  |                 'oembed', | 
					
						
							|  |  |  |                 array(), | 
					
						
							|  |  |  |                 array('format'=>'json','url'=>$this->notice->uri)), | 
					
						
							| 
									
										
										
										
											2009-07-15 15:11:29 -04:00
										 |  |  |             'title'=>'oEmbed'),null); | 
					
						
							|  |  |  |         $this->element('link',array('rel'=>'alternate', | 
					
						
							|  |  |  |             'type'=>'text/xml+oembed', | 
					
						
							|  |  |  |             'href'=>common_local_url( | 
					
						
							| 
									
										
										
										
											2009-08-11 21:15:42 -04:00
										 |  |  |                 'oembed', | 
					
						
							|  |  |  |                 array(), | 
					
						
							|  |  |  |                 array('format'=>'xml','url'=>$this->notice->uri)), | 
					
						
							| 
									
										
										
										
											2009-07-15 15:11:29 -04:00
										 |  |  |             'title'=>'oEmbed'),null); | 
					
						
							| 
									
										
										
										
											2008-12-23 14:19:07 -05:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2008-05-08 22:16:04 -04:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2009-06-23 07:25:18 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | class SingleNoticeItem extends NoticeListItem | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * recipe function for displaying a single notice. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * We overload to show attachments. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return void | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     function show() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $this->showStart(); | 
					
						
							|  |  |  |         $this->showNotice(); | 
					
						
							|  |  |  |         $this->showNoticeAttachments(); | 
					
						
							|  |  |  |         $this->showNoticeInfo(); | 
					
						
							|  |  |  |         $this->showNoticeOptions(); | 
					
						
							|  |  |  |         $this->showEnd(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     function showNoticeAttachments() { | 
					
						
							|  |  |  |         $al = new AttachmentList($this->notice, $this->out); | 
					
						
							|  |  |  |         $al->show(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |