summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4237407)
Add an array of arguments to isReadOnly() method of actions, to let
them change their results depending on what actions are called.
Primarily used by the 'api' action. Ideally in the future that will be
multiple actions. But this might still be useful.
46 files changed:
class AllAction extends ProfileAction
{
class AllAction extends ProfileAction
{
+ function isReadOnly($args)
'favorites/favorites');
$fullname = "$this->api_action/$this->api_method";
'favorites/favorites');
$fullname = "$this->api_action/$this->api_method";
-
- // If the site is "private", all API methods except laconica/config
+
+ // If the site is "private", all API methods except laconica/config
// need authentication
if (common_config('site', 'private')) {
return $fullname != 'laconica/config' || false;
// need authentication
if (common_config('site', 'private')) {
return $fullname != 'laconica/config' || false;
+ function isReadOnly($args)($args)
- # NOTE: before handle(), can't use $this->arg
- $apiaction = $_REQUEST['apiaction'];
- $method = $_REQUEST['method'];
+ $apiaction = $args['apiaction'];
+ $method = $args['method'];
+
list($cmdtext, $fmt) = explode('.', $method);
static $write_methods = array(
list($cmdtext, $fmt) = explode('.', $method);
static $write_methods = array(
common_redirect($url, 302);
}
common_redirect($url, 302);
}
+ function isReadOnly($args)
return ucfirst($this->title);
}
return ucfirst($this->title);
}
+ function isReadOnly($args)
* @return boolean true
*/
* @return boolean true
*/
+ function isReadOnly($args)
+ function isReadOnly($args)
class FoafAction extends Action
{
class FoafAction extends Action
{
+ function isReadOnly($args)
* @return boolean true
*/
* @return boolean true
*/
+ function isReadOnly($args)
+ function isReadOnly($args)
* @return boolean true
*/
* @return boolean true
*/
+ function isReadOnly($args)
var $page = null;
var $profile = null;
var $page = null;
var $profile = null;
+ function isReadOnly($args)
var $subbed = null;
var $sent = null;
var $subbed = null;
var $sent = null;
+ function isReadOnly($args)
* @return boolean false
*/
* @return boolean false
*/
+ function isReadOnly($args)
*
* @return boolean true
*/
*
* @return boolean true
*/
+ function isReadOnly($args)
print $user->nickname . ': ' . $notice->content;
}
print $user->nickname . ': ' . $notice->content;
}
+ function isReadOnly($args)
+ function isReadOnly($args)
+ function isReadOnly($args)
+ function isReadOnly($args)
+ function isReadOnly($args)
+ function isReadOnly($args)
class PublictagcloudAction extends Action
{
class PublictagcloudAction extends Action
{
+ function isReadOnly($args)
*
* @return boolean true
*/
*
* @return boolean true
*/
+ function isReadOnly($args)
$this->elementEnd('div');
}
$this->elementEnd('div');
}
+ function isReadOnly($args)
return ($avatar) ? $avatar->url : null;
}
return ($avatar) ? $avatar->url : null;
}
+ function isReadOnly($args)
*
* @return boolean false
*/
*
* @return boolean false
*/
+ function isReadOnly($args)
* @return boolean true
*/
* @return boolean true
*/
+ function isReadOnly($args)
* @return boolean true
*/
* @return boolean true
*/
+ function isReadOnly($args)
+ function isReadOnly($args)
* @return boolean true
*/
* @return boolean true
*/
+ function isReadOnly($args)
class ShowstreamAction extends ProfileAction
{
class ShowstreamAction extends ProfileAction
{
+ function isReadOnly($args)
+ function isReadOnly($args)
+ function isReadOnly($args)
$this->page, 'tag', array('tag' => $this->tag));
}
$this->page, 'tag', array('tag' => $this->tag));
}
+ function isReadOnly($args)
+ function isReadOnly($args)
* @return boolean true
*/
* @return boolean true
*/
+ function isReadOnly($args)
*
* @return boolean true
*/
*
* @return boolean true
*/
+ function isReadOnly($args)
var $page = null;
var $profile = null;
var $page = null;
var $profile = null;
+ function isReadOnly($args)
parent::initRss($limit);
}
parent::initRss($limit);
}
+ function isReadOnly($args)
*
* @return boolean true
*/
*
* @return boolean true
*/
+ function isReadOnly($args)
// XXX: find somewhere for this little block to live
// XXX: find somewhere for this little block to live
- if (common_config('db', 'mirror') && $action_obj->isReadOnly()) {
+ if (common_config('db', 'mirror') && $action_obj->isReadOnly($args)) {
if (is_array(common_config('db', 'mirror'))) {
// "load balancing", ha ha
$arr = common_config('db', 'mirror');
if (is_array(common_config('db', 'mirror'))) {
// "load balancing", ha ha
$arr = common_config('db', 'mirror');
+ * @param array $args other arguments
+ *
* @return boolean is read only action?
*/
* @return boolean is read only action?
*/
+
+ function isReadOnly($args)($args)
+ function isReadOnly($args)
+ function isReadOnly($args)
return preg_replace($this->pattern, '<strong>\\1</strong>', htmlspecialchars($text));
}
return preg_replace($this->pattern, '<strong>\\1</strong>', htmlspecialchars($text));
}
+ function isReadOnly($args)
+ function isReadOnly($args)
*
* @return boolean true
*/
*
* @return boolean true
*/
+ function isReadOnly($args)