*/
class RespondPollAction extends Action
{
- protected $user = null;
- protected $error = null;
- protected $complete = null;
+ protected $user = null;
+ protected $error = null;
+ protected $complete = null;
- protected $poll = null;
- protected $selection = null;
+ protected $poll = null;
+ protected $selection = null;
/**
* Returns the title of the action
/**
* For initializing members of the class.
*
- * @param array $argarray misc. arguments
+ * @param array $args misc. arguments
*
* @return boolean true
+ * @throws ClientException
*/
- function prepare($argarray)
+ function prepare(array $args = [])
{
- parent::prepare($argarray);
+ parent::prepare($args);
if ($this->boolean('ajax')) {
- StatusNet::setApi(true);
+ GNUsocial::setApi(true);
}
$this->user = common_current_user();
if (empty($this->user)) {
// TRANS: Client exception thrown trying to respond to a poll while not logged in.
throw new ClientException(_m('You must be logged in to respond to a poll.'),
- 403);
+ 403);
}
if ($this->isPost()) {
/**
* Handler method
*
- * @param array $argarray is ignored since it's now passed in in prepare()
- *
* @return void
*/
- function handle($argarray=null)
+ function handle()
{
- parent::handle($argarray);
+ parent::handle();
if ($this->isPost()) {
$this->respondPoll();
{
try {
$notice = Poll_response::saveNew($this->user->getProfile(),
- $this->poll,
- $this->selection);
+ $this->poll,
+ $this->selection);
} catch (ClientException $ce) {
$this->error = $ce->getMessage();
$this->showPage();