From 2d581992668b411020cc1dad16d8c05858c31a65 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 17 May 2008 10:46:42 -0400 Subject: more twiddling Placeholder for broadcasting notice updates. Fixup the local url function to include server and path. Add server and path to configuration array. Make new notice 303 redirect to shownotice. Make redirects work. Add link in streams to notices. darcs-hash:20080517144642-84dde-c267a6e3bb0717ad5a3a819a7cf65fdd5817ea8e.gz --- actions/newnotice.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'actions') diff --git a/actions/newnotice.php b/actions/newnotice.php index a4cc7d3ae..40a196a23 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -28,15 +28,12 @@ class NewnoticeAction extends Action { if (!common_logged_in()) { common_user_error(_t('Not logged in.')); } else if ($this->arg('METHOD') == 'POST') { - if ($this->save_new_notice()) { - # XXX: smarter redirects - $user = common_current_user(); - assert(!is_null($user)); # see if... above - # XXX: redirect to source - # XXX: use Ajax instead of a redirect - common_redirect(common_local_url('all', - array('nickname' => - $user->nickname))); + $id = $this->save_new_notice(); + + if ($id) { + common_broadcast_notices($id); + common_redirect(common_local_url('shownotice', + array('notice' => $id)), 303); } else { common_server_error(_t('Problem saving notice.')); } -- cgit v1.2.3-54-g00ecf