* @author Jeffery To <jeffery.to@gmail.com>
* @author Zach Copley <zach@status.net>
* @copyright 2009 StatusNet, Inc.
+ * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class ApiGroupShowAction extends ApiPrivateAuthAction
{
var $group = null;
* @param array $args $_REQUEST args
*
* @return boolean success flag
- *
*/
-
function prepare($args)
{
parent::prepare($args);
common_redirect(common_local_url('ApiGroupShow', $args), 301);
} else {
$this->clientError(
- _('Group not found!'),
+ // TRANS: Client error displayed when trying to show a group that could not be found.
+ _('Group not found.'),
404,
$this->format
);
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
$this->showSingleJsonGroup($this->group);
break;
default:
+ // TRANS: Client error displayed trying to execute an unknown API method showing a group.
$this->clientError(_('API method not found.'), 404, $this->format);
break;
}
*
* @return string datestamp of the latest notice in the stream
*/
-
function lastModified()
{
if (!empty($this->group)) {
*
* @return string etag
*/
-
function etag()
{
if (!empty($this->group)) {
return '"' . implode(
':',
array($this->arg('action'),
+ common_user_cache_hash($this->auth_user),
common_language(),
$this->group->id,
strtotime($this->group->modified))
return null;
}
+ /**
+ * Return true if read only.
+ *
+ * MAY override
+ *
+ * @param array $args other arguments
+ *
+ * @return boolean is read only action?
+ */
+ function isReadOnly($args)
+ {
+ return true;
+ }
}