diff options
author | Zach Copley <zach@status.net> | 2009-12-03 17:13:54 -0800 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2009-12-03 17:13:54 -0800 |
commit | 2acdfff58b1ae7e6f9ed6eb9b65cdf97472289b5 (patch) | |
tree | a6763c6fc358224f9a4a8d2a83652cda299888b1 /plugins/Mapstraction/allmap.php | |
parent | aef4cc0a59276938f0f0aec4d67374f578f2117a (diff) | |
parent | 35ff3961e8a51e41517d8a8b9e5a1a21f826e4ca (diff) |
Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 0.9.x
* '0.9.x' of gitorious.org:statusnet/mainline:
Remove unnecessary pass by reference indicators
refactor the common parts of usermap and allmap into a common base class
Load notice data using javascript from the html on the page instead of writing json representations of the notices on each page
Diffstat (limited to 'plugins/Mapstraction/allmap.php')
-rw-r--r-- | plugins/Mapstraction/allmap.php | 68 |
1 files changed, 11 insertions, 57 deletions
diff --git a/plugins/Mapstraction/allmap.php b/plugins/Mapstraction/allmap.php index 6a48b141f..0c4f03b31 100644 --- a/plugins/Mapstraction/allmap.php +++ b/plugins/Mapstraction/allmap.php @@ -37,59 +37,26 @@ if (!defined('STATUSNET')) { * @category Mapstraction * @package StatusNet * @author Evan Prodromou <evan@status.net> + * @author Craig Andrews <candrews@integralblue.com> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ -class AllmapAction extends OwnerDesignAction +class AllmapAction extends MapAction { - var $profile = null; - var $page = null; - var $notices = null; - - public $plugin = null; - function prepare($args) { - parent::prepare($args); - - $nickname_arg = $this->arg('nickname'); - $nickname = common_canonical_nickname($nickname_arg); - - // Permanent redirect on non-canonical nickname - - if ($nickname_arg != $nickname) { - $args = array('nickname' => $nickname); - if ($this->arg('page') && $this->arg('page') != 1) { - $args['page'] = $this->arg['page']; + if(parent::prepare($args)) { + $cur = common_current_user(); + if (!empty($cur) && $cur->id == $this->user->id) { + $this->notice = $this->user->noticeInbox(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); + } else { + $this->notice = $this->user->noticesWithFriends(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); } - common_redirect(common_local_url($this->trimmed('action'), $args), 301); - return false; - } - - $this->user = User::staticGet('nickname', $nickname); - - if (!$this->user) { - $this->clientError(_('No such user.'), 404); - return false; - } - - $this->profile = $this->user->getProfile(); - - if (!$this->profile) { - $this->serverError(_('User has no profile.')); + return true; + }else{ return false; } - - $page = $this->trimmed('page'); - - if (!empty($page) && Validate::number($page)) { - $this->page = $page+0; - } else { - $this->page = 1; - } - - return true; } function title() @@ -109,17 +76,4 @@ class AllmapAction extends OwnerDesignAction $this->page); } } - - function handle($args) - { - parent::handle($args); - $this->showPage(); - } - - function showContent() - { - $this->element('div', array('id' => 'map_canvas', - 'class' => 'gray smallmap', - 'style' => "width: 100%; height: 400px")); - } -}
\ No newline at end of file +} |