From b5ac6e31f2f148164860aeabec6899b75d7292ec Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Sun, 24 May 2009 04:43:34 -0400 Subject: Rearranged attachment info to only appear on each applicable notice page and thru an ajax popup. --- actions/attachment.php | 10 ++++------ actions/attachment_ajax.php | 24 +----------------------- actions/attachments.php | 2 -- actions/tag.php | 4 ++-- 4 files changed, 7 insertions(+), 33 deletions(-) (limited to 'actions') diff --git a/actions/attachment.php b/actions/attachment.php index b9187ff08..c51c75120 100644 --- a/actions/attachment.php +++ b/actions/attachment.php @@ -31,8 +31,6 @@ if (!defined('LACONICA')) { exit(1); } -//require_once INSTALLDIR.'/lib/personalgroupnav.php'; -//require_once INSTALLDIR.'/lib/feedlist.php'; require_once INSTALLDIR.'/lib/attachmentlist.php'; /** @@ -67,11 +65,11 @@ class AttachmentAction extends Action { parent::prepare($args); - $id = $this->arg('attachment'); - - $this->attachment = File::staticGet($id); + if ($id = $this->trimmed('attachment')) { + $this->attachment = File::staticGet($id); + } - if (!$this->attachment) { + if (empty($this->attachment)) { $this->clientError(_('No such attachment.'), 404); return false; } diff --git a/actions/attachment_ajax.php b/actions/attachment_ajax.php index 1620b27dd..6930dc112 100644 --- a/actions/attachment_ajax.php +++ b/actions/attachment_ajax.php @@ -45,26 +45,6 @@ require_once INSTALLDIR.'/actions/attachment.php'; class Attachment_ajaxAction extends AttachmentAction { - /** - * Load attributes based on database arguments - * - * Loads all the DB stuff - * - * @param array $args $_REQUEST array - * - * @return success flag - */ - - function prepare($args) - { - parent::prepare($args); - if (!$this->attachment) { - $this->clientError(_('No such attachment.'), 404); - return false; - } - return true; - } - /** * Show page, a template method. * @@ -87,7 +67,7 @@ class Attachment_ajaxAction extends AttachmentAction */ function showCore() { - $this->elementStart('div', array('id' => 'core')); + $this->elementStart('div', array('id' => 'ajaxcore')); if (Event::handle('StartShowContentBlock', array($this))) { $this->showContentBlock(); Event::handle('EndShowContentBlock', array($this)); @@ -95,8 +75,6 @@ class Attachment_ajaxAction extends AttachmentAction $this->elementEnd('div'); } - - /** * Last-modified date for page * diff --git a/actions/attachments.php b/actions/attachments.php index 6b31c839d..d3c90fec2 100644 --- a/actions/attachments.php +++ b/actions/attachments.php @@ -31,8 +31,6 @@ if (!defined('LACONICA')) { exit(1); } -//require_once INSTALLDIR.'/lib/personalgroupnav.php'; -//require_once INSTALLDIR.'/lib/feedlist.php'; require_once INSTALLDIR.'/lib/attachmentlist.php'; /** diff --git a/actions/tag.php b/actions/tag.php index 47420e4c3..e71ec06a8 100644 --- a/actions/tag.php +++ b/actions/tag.php @@ -49,8 +49,8 @@ class TagAction extends Action { $pop = new PopularNoticeSection($this); $pop->show(); - $freqatt = new FrequentAttachmentSection($this); - $freqatt->show(); +// $freqatt = new FrequentAttachmentSection($this); +// $freqatt->show(); } function title() -- cgit v1.2.3-54-g00ecf