public function __construct(array $params) { parent::__construct($params); if (!$this->params) { return; } switch ($this->params[0]) { case 'link': case 'unlink': $this->handler = 'handleLink'; // always returns null break; case 'pin': case 'unpin': $this->handler = 'handlePin'; // always returns null break; case 'public': case 'private': $this->handler = 'handlePrivacy'; // always returns null break; case 'avatar': $this->handler = 'handleAvatar'; // sets an image header break; // so it has to die here or another header will be set // so it has to die here or another header will be set case 'resync': case 'status': $this->handler = 'handleResync'; break; case 'save': $this->handler = 'handleSave'; break; case 'delete': $this->handler = 'handleDelete'; break; case 'purge': $this->handler = 'handlePurge'; break; case 'summary': // page is generated by jScript die; // just be empty // just be empty case 'load': $this->handler = 'handleLoad'; break; } }
public function __construct(array $params) { parent::__construct($params); // always this one $this->handler = 'handleLocale'; $this->doRedirect = true; }
public function __construct(array $params) { parent::__construct($params); // requires 'action' parameter in any case if (!$this->_get['action'] || !$this->params) { return; } if ($this->params[0] == 'screenshots') { if (!User::isInGroup(U_GROUP_STAFF | U_GROUP_SCREENSHOT)) { // comment_mod, handleSSmod, vi_mod ? return; } if ($this->_get['action'] == 'list') { $this->handler = 'ssList'; } else { if ($this->_get['action'] == 'manage') { $this->handler = 'ssManage'; } else { if ($this->_get['action'] == 'editalt') { $this->handler = 'ssEditAlt'; } else { if ($this->_get['action'] == 'approve') { $this->handler = 'ssApprove'; } else { if ($this->_get['action'] == 'sticky') { $this->handler = 'ssSticky'; } else { if ($this->_get['action'] == 'delete') { $this->handler = 'ssDelete'; } else { if ($this->_get['action'] == 'relocate') { $this->handler = 'ssRelocate'; } } } } } } } } else { if ($this->params[0] == 'siteconfig') { if (!User::isInGroup(U_GROUP_DEV | U_GROUP_ADMIN)) { return; } if ($this->_get['action'] == 'add') { $this->handler = 'confAdd'; } else { if ($this->_get['action'] == 'remove') { $this->handler = 'confRemove'; } else { if ($this->_get['action'] == 'update') { $this->handler = 'confUpdate'; } } } } } }
public function __construct(array $params) { parent::__construct($params); if (is_numeric($this->_get['locale'])) { User::useLocale($this->_get['locale']); } // always this one $this->handler = 'handleData'; }
public function __construct(array $params) { parent::__construct($params); if (is_numeric($this->_get['locale'])) { User::useLocale($this->_get['locale']); } if (!$this->params || !User::$id) { return; } // select handler if ($this->params[0] == 'exclude') { $this->handler = 'handleExclude'; } else { if ($this->params[0] == 'weightscales') { $this->handler = 'handleWeightscales'; } } }
public function __construct(array $params) { parent::__construct($params); if (!$this->params || count($this->params) != 1) { return; } // note: return values must be formated as STRICT json! // select handler if ($this->params[0] == 'add') { $this->handler = 'handleCommentAdd'; } else { if ($this->params[0] == 'edit') { $this->handler = 'handleCommentEdit'; } else { if ($this->params[0] == 'delete') { $this->handler = 'handleCommentDelete'; } else { if ($this->params[0] == 'undelete') { $this->handler = 'handleCommentUndelete'; } else { if ($this->params[0] == 'rating') { // up/down - distribution $this->handler = 'handleCommentRating'; } else { if ($this->params[0] == 'vote') { // up, down and remove $this->handler = 'handleCommentVote'; } else { if ($this->params[0] == 'sticky') { // toggle flag $this->handler = 'handleCommentSticky'; } else { if ($this->params[0] == 'out-of-date') { // toggle flag $this->handler = 'handleCommentOutOfDate'; } else { if ($this->params[0] == 'show-replies') { $this->handler = 'handleCommentShowReplies'; } else { if ($this->params[0] == 'add-reply') { // also returns all replies on success $this->handler = 'handleReplyAdd'; } else { if ($this->params[0] == 'edit-reply') { // also returns all replies on success $this->handler = 'handleReplyEdit'; } else { if ($this->params[0] == 'detach-reply') { $this->handler = 'handleReplyDetach'; } else { if ($this->params[0] == 'delete-reply') { $this->handler = 'handleReplyDelete'; } else { if ($this->params[0] == 'flag-reply') { $this->handler = 'handleReplyFlag'; } else { if ($this->params[0] == 'upvote-reply') { $this->handler = 'handleReplyUpvote'; } else { if ($this->params[0] == 'downvote-reply') { $this->handler = 'handleReplyDownvote'; } } } } } } } } } } } } } } } } }
public function __construct(array $params) { parent::__construct($params); // always this one $this->handler = 'handleContactUs'; }