diff --git a/actions/doc.php b/actions/doc.php index c26b290902..6db3830ce1 100644 --- a/actions/doc.php +++ b/actions/doc.php @@ -96,11 +96,11 @@ class DocAction extends Action */ function showContentBlock() { - $this->elementStart('div', array('id' => 'content', 'class' => 'hentry')); + $this->elementStart('div', array('id' => 'content', 'class' => 'h-entry')); $this->showPageTitle(); $this->showPageNoticeBlock(); $this->elementStart('div', array('id' => 'content_inner', - 'class' => 'entry-content')); + 'class' => 'e-content')); // show the actual content (forms, lists, whatever) $this->showContent(); $this->elementEnd('div'); diff --git a/actions/noticesearch.php b/actions/noticesearch.php index d4fc884f4b..ee7bb86f40 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -202,7 +202,7 @@ class SearchNoticeListItem extends NoticeListItem { function showContent() { // FIXME: URL, image, video, audio - $this->out->elementStart('p', array('class' => 'entry-content')); + $this->out->elementStart('p', array('class' => 'e-content')); if ($this->notice->rendered) { $this->out->raw($this->highlight($this->notice->rendered, $this->terms)); } else { diff --git a/actions/register.php b/actions/register.php index cf2c049e73..82fb9fc573 100644 --- a/actions/register.php +++ b/actions/register.php @@ -293,14 +293,14 @@ class RegisterAction extends Action } } - // overrided to add hentry, and content-inner class + // overrided to add h-entry, and content-inner class function showContentBlock() { - $this->elementStart('div', array('id' => 'content', 'class' => 'hentry')); + $this->elementStart('div', array('id' => 'content', 'class' => 'h-entry')); $this->showPageTitle(); $this->showPageNoticeBlock(); $this->elementStart('div', array('id' => 'content_inner', - 'class' => 'entry-content')); + 'class' => 'e-content')); // show the actual content (forms, lists, whatever) $this->showContent(); $this->elementEnd('div'); diff --git a/actions/showapplication.php b/actions/showapplication.php index b44dd5746a..d8ac293d40 100644 --- a/actions/showapplication.php +++ b/actions/showapplication.php @@ -147,20 +147,20 @@ class ShowApplicationAction extends Action $consumer = $this->application->getConsumer(); - $this->elementStart('div', 'entity_profile vcard'); + $this->elementStart('div', 'entity_profile h-card'); // TRANS: Header on the OAuth application page. $this->element('h2', null, _('Application profile')); if (!empty($this->application->icon)) { $this->element('img', array('src' => $this->application->icon, - 'class' => 'photo logo entity_depiction')); + 'class' => 'u-photo logo entity_depiction')); } $this->element('a', array('href' => $this->application->source_url, - 'class' => 'url fn entity_fn'), + 'class' => 'u-url p-name entity_fn'), $this->application->name); $this->element('a', array('href' => $this->application->homepage, - 'class' => 'url entity_org'), + 'class' => 'u-url entity_org'), $this->application->organization); $this->element('div', diff --git a/actions/shownotice.php b/actions/shownotice.php index 5e2be9f9d2..1d01244cc1 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -40,7 +40,7 @@ require_once INSTALLDIR.'/lib/noticelist.php'; * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ -class ShownoticeAction extends Action +class ShownoticeAction extends ManagedAction { /** * Notice object to show @@ -184,33 +184,7 @@ class ShownoticeAction extends Action */ function title() { - $base = $this->profile->getFancyName(); - - // TRANS: Title of the page that shows a notice. - // TRANS: %1$s is a user name, %2$s is the notice creation date/time. - return sprintf(_('%1$s\'s status on %2$s'), - $base, - common_exact_date($this->notice->created)); - } - - /** - * Handle input - * - * Only handles get, so just show the page. - * - * @param array $args $_REQUEST data (unused) - * - * @return void - */ - protected function handle() - { - parent::handle(); - - if (StatusNet::isAjax()) { - $this->showAjax(); - } else { - $this->showPage(); - } + return $this->notice->getTitle(); } /** @@ -223,23 +197,9 @@ class ShownoticeAction extends Action function showContent() { $this->elementStart('ol', array('class' => 'notices xoxo')); - $nli = new SingleNoticeItem($this->notice, $this); - $nli->show(); - $this->elementEnd('ol'); - } - - function showAjax() - { - $this->startHTML('text/xml;charset=utf-8'); - $this->elementStart('head'); - // TRANS: Title for page that shows a notice. - $this->element('title', null, _m('TITLE','Notice')); - $this->elementEnd('head'); - $this->elementStart('body'); $nli = new NoticeListItem($this->notice, $this); $nli->show(); - $this->elementEnd('body'); - $this->endHTML(); + $this->elementEnd('ol'); } /** @@ -270,7 +230,7 @@ class ShownoticeAction extends Action { $user = User::getKV($this->profile->id); - if (!$user) { + if (!$user instanceof User) { return; } @@ -289,12 +249,3 @@ class ShownoticeAction extends Action 'content' => $this->notice->content)); } } - -// @todo FIXME: Class documentation missing. -class SingleNoticeItem extends DoFollowListItem -{ - function avatarSize() - { - return AVATAR_STREAM_SIZE; - } -} diff --git a/actions/showprofiletag.php b/actions/showprofiletag.php index 6b1bc5e5b5..44ded832b8 100644 --- a/actions/showprofiletag.php +++ b/actions/showprofiletag.php @@ -364,7 +364,7 @@ class Peopletag extends PeopletagListItem function showStart() { $mode = $this->peopletag->private ? 'private' : 'public'; - $this->out->elementStart('div', array('class' => 'hentry peopletag peopletag-profile mode-'.$mode, + $this->out->elementStart('div', array('class' => 'h-entry peopletag peopletag-profile mode-'.$mode, 'id' => 'peopletag-' . $this->peopletag->id)); } diff --git a/actions/tagprofile.php b/actions/tagprofile.php index 7538d7c8b6..a79ebf1d25 100644 --- a/actions/tagprofile.php +++ b/actions/tagprofile.php @@ -101,7 +101,7 @@ class TagprofileAction extends Action function showContent() { if (Event::handle('StartShowTagProfileForm', array($this, $this->profile)) && $this->profile) { - $this->elementStart('div', 'entity_profile vcard author'); + $this->elementStart('div', 'entity_profile h-card p-author'); // TRANS: Header in list form. $this->element('h2', null, _('User profile')); @@ -118,7 +118,7 @@ class TagprofileAction extends Action 'class' => 'entity_nickname nickname'), $this->profile->nickname); if ($this->profile->fullname) { - $this->element('div', 'fn entity_fn', $this->profile->fullname); + $this->element('div', 'p-name entity_fn', $this->profile->fullname); } if ($this->profile->location) { @@ -128,7 +128,7 @@ class TagprofileAction extends Action if ($this->profile->homepage) { $this->element('a', array('href' => $this->profile->homepage, 'rel' => 'me', - 'class' => 'url entity_url'), + 'class' => 'u-url entity_url'), $this->profile->homepage); } diff --git a/actions/version.php b/actions/version.php index f0f2661831..97115d23cd 100644 --- a/actions/version.php +++ b/actions/version.php @@ -108,17 +108,17 @@ class VersionAction extends Action /* - * Override to add hentry, and content-inner classes + * Override to add h-entry, and content-inner classes * * @return void */ function showContentBlock() { - $this->elementStart('div', array('id' => 'content', 'class' => 'hentry')); + $this->elementStart('div', array('id' => 'content', 'class' => 'h-entry')); $this->showPageTitle(); $this->showPageNoticeBlock(); $this->elementStart('div', array('id' => 'content_inner', - 'class' => 'entry-content')); + 'class' => 'e-content')); // show the actual content (forms, lists, whatever) $this->showContent(); $this->elementEnd('div'); diff --git a/classes/Notice.php b/classes/Notice.php index 917095acab..9cf676a664 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -232,6 +232,19 @@ class Notice extends Managed_DataObject return common_local_url('shownotice', array('notice' => $this->id), null, null, false); } + public function getTitle() + { + $title = null; + if (Event::handle('GetNoticeTitle', array($this, &$title))) { + // TRANS: Title of a notice posted without a title value. + // TRANS: %1$s is a user name, %2$s is the notice creation date/time. + $title = sprintf(_('%1$s\'s status on %2$s'), + $this->getProfile()->getFancyName(), + common_exact_date($this->created)); + } + return $title; + } + /* * Get the original representation URL of this notice. */ diff --git a/install.php b/install.php index a105e2e8c1..d72cf69b07 100644 --- a/install.php +++ b/install.php @@ -376,19 +376,16 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - - -