*/
class NewnoticeAction extends FormAction
{
+ protected $form = 'Notice';
+
/**
* Title of the page
*
parent::showForm($msg, $success);
}
- /**
- * // XXX: Should we be showing the notice form with microapps here?
- *
- * Overload for replies or bad results
- *
- * We show content in the notice form if there were replies or results.
- *
- * @return void
- */
- function showNoticeForm()
- {
- $content = $this->trimmed('status_textarea');
- if (!$content) {
- $replyto = $this->trimmed('replyto');
- $inreplyto = $this->trimmed('inreplyto');
- $profile = Profile::getKV('nickname', $replyto);
- if ($profile) {
- $content = '@' . $profile->nickname . ' ';
- }
- } else {
- // @fixme most of these bits above aren't being passed on above
- $inreplyto = null;
- }
-
- $this->elementStart('div', 'input_forms');
- $this->elementStart(
- 'div',
- array(
- 'id' => 'input_form_status',
- 'class' => 'input_form current nonav'
- )
- );
-
- $notice_form = new NoticeForm(
- $this,
- array(
- 'content' => $content,
- 'inreplyto' => $inreplyto
- )
- );
-
- $notice_form->show();
-
- $this->elementEnd('div');
- $this->elementEnd('div');
- }
-
- /**
- * Show an error message
- *
- * Shows an error message if there is one.
- *
- * @return void
- *
- * @todo maybe show some instructions?
- */
- function showPageNotice()
- {
- if ($this->msg) {
- $this->element('p', array('id' => 'error'), $this->msg);
- }
- }
-
/**
* Output a notice
*
*/
function showPage()
{
+ if (StatusNet::isAjax()) {
+ self::showAjax();
+ return;
+ }
if (Event::handle('StartShowHTML', array($this))) {
$this->startHTML();
$this->flush();
}
}
+ public function showAjax()
+ {
+ $this->startHTML('text/xml;charset=utf-8');
+ $this->elementStart('head');
+ // TRANS: Title for conversation page.
+ $this->element('title', null, _m('TITLE','Notice'));
+ $this->elementEnd('head');
+ $this->elementStart('body');
+ $this->showContent();
+ $this->elementEnd('body');
+ $this->endHTML();
+ }
+
function endHTML()
{
global $_startTime;
return null;
}
+ public function showForm($msg=null, $success=false)
+ {
+ $this->msg = $msg;
+ $this->success = $success;
+ $this->showPage();
+ }
+
+ public function showContent()
+ {
+ $form = $this->getForm();
+ $form->show();
+ }
+
+ protected function getForm()
+ {
+ $class = $this->form.'Form';
+ $form = new $class($this);
+ return $form;
+ }
+
/**
* Gets called from handle() if isPost() is true;
* @return void
}
}
- if (StatusNet::isAjax()) {
- $this->showAjax();
- } else {
- $this->showPage();
- }
+ $this->showPage();
}
protected function handlePost()
{
// This will only be run if the Action has the property canPost==true
}
-
- public function showAjax()
- {
- $this->startHTML('text/xml;charset=utf-8');
- $this->elementStart('head');
- // TRANS: Title for conversation page.
- $this->element('title', null, _m('TITLE','Notice'));
- $this->elementEnd('head');
- $this->elementStart('body');
- $this->showContent();
- $this->elementEnd('body');
- $this->endHTML();
- }
}
// Do we have to worry about sub-second race conditions?
// XXX: Needs to be above the parent::__construct() call...?
- $this->id_suffix = time();
+ $this->id_suffix = rand();
parent::__construct($action);
right: 239px;
background-color: #fff;
border-right: 1px solid #ccc;
-}
+}
+
+#content_inner {
+ display: block;
+ position: relative;
+}
#site_nav_local_views_wrapper {
width: 100%;
display: block;
}
-#input_form_status, #input_form_direct {
- padding-bottom: 50px;
-}
-
.form_notice {
margin-bottom: 10px;
}
.form_notice input.submit {
position: absolute;
- top: 100%;
- left: 0px;
- margin-top: -49px;
+ right: 0px;
+ margin-top: -1.5em;
float: left;
width: 100px;
padding: 0px;
right: 50px;
}
-.threaded-replies .form_notice #notice_action-submit {
- left: 10px;
- margin-top: -44px;
+.threaded-replies .form_notice input.submit {
+ bottom: 0;
}
.threaded-replies .form_notice .error,