Cosmetic changes to SubMirror actions
This commit is contained in:
parent
6f427d7e43
commit
83f50d25c0
@ -26,9 +26,7 @@
|
||||
* @link http://status.net/
|
||||
*/
|
||||
|
||||
if (!defined('STATUSNET')) {
|
||||
exit(1);
|
||||
}
|
||||
if (!defined('GNUSOCIAL') && !defined('STATUSNET')) { exit(1); }
|
||||
|
||||
/**
|
||||
* Takes parameters:
|
||||
@ -56,7 +54,7 @@ class AddMirrorAction extends BaseMirrorAction
|
||||
*
|
||||
* @return boolean success flag
|
||||
*/
|
||||
function prepare($args)
|
||||
protected function prepare(array $args=array())
|
||||
{
|
||||
parent::prepare($args);
|
||||
$feedurl = $this->getFeedUrl();
|
||||
@ -77,7 +75,7 @@ class AddMirrorAction extends BaseMirrorAction
|
||||
}
|
||||
}
|
||||
|
||||
function saveMirror()
|
||||
protected function saveMirror()
|
||||
{
|
||||
if ($this->oprofile->subscribe()) {
|
||||
SubMirror::saveMirror($this->user, $this->profile);
|
||||
|
@ -26,9 +26,7 @@
|
||||
* @link http://status.net/
|
||||
*/
|
||||
|
||||
if (!defined('STATUSNET')) {
|
||||
exit(1);
|
||||
}
|
||||
if (!defined('GNUSOCIAL') && !defined('STATUSNET')) { exit(1); }
|
||||
|
||||
/**
|
||||
* Takes parameters:
|
||||
@ -57,7 +55,7 @@ abstract class BaseMirrorAction extends Action
|
||||
*
|
||||
* @return boolean success flag
|
||||
*/
|
||||
function prepare($args)
|
||||
protected function prepare(array $args=array())
|
||||
{
|
||||
parent::prepare($args);
|
||||
return $this->sharedBoilerplate();
|
||||
@ -152,7 +150,7 @@ abstract class BaseMirrorAction extends Action
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function handle($args)
|
||||
protected function handle()
|
||||
{
|
||||
// Throws exception on error
|
||||
$this->saveMirror();
|
||||
@ -174,5 +172,5 @@ abstract class BaseMirrorAction extends Action
|
||||
}
|
||||
}
|
||||
|
||||
abstract function saveMirror();
|
||||
abstract protected function saveMirror();
|
||||
}
|
||||
|
@ -26,9 +26,7 @@
|
||||
* @link http://status.net/
|
||||
*/
|
||||
|
||||
if (!defined('STATUSNET')) {
|
||||
exit(1);
|
||||
}
|
||||
if (!defined('GNUSOCIAL') && !defined('STATUSNET')) { exit(1); }
|
||||
|
||||
/**
|
||||
* Takes parameters:
|
||||
@ -54,7 +52,7 @@ class EditMirrorAction extends BaseMirrorAction
|
||||
*
|
||||
* @return boolean success flag
|
||||
*/
|
||||
function prepare($args)
|
||||
protected function prepare(array $args=array())
|
||||
{
|
||||
parent::prepare($args);
|
||||
|
||||
@ -63,7 +61,7 @@ class EditMirrorAction extends BaseMirrorAction
|
||||
$this->mirror = SubMirror::pkeyGet(array('subscriber' => $this->user->id,
|
||||
'subscribed' => $this->profile->id));
|
||||
|
||||
if (!$this->mirror) {
|
||||
if (!$this->mirror instanceof SubMirror) {
|
||||
// TRANS: Client error displayed when trying to edit an object that is not a feed mirror.
|
||||
$this->clientError(_m('Requested invalid profile to edit.'));
|
||||
}
|
||||
@ -88,7 +86,7 @@ class EditMirrorAction extends BaseMirrorAction
|
||||
}
|
||||
}
|
||||
|
||||
function saveMirror()
|
||||
protected function saveMirror()
|
||||
{
|
||||
$mirror = SubMirror::getMirror($this->user, $this->profile);
|
||||
if (!$mirror) {
|
||||
|
Loading…
Reference in New Issue
Block a user