mirror of
https://github.com/humhub/humhub.git
synced 2025-01-18 06:38:14 +01:00
Removed legacy link function.
This commit is contained in:
parent
f018028d20
commit
8d46004594
@ -35,6 +35,9 @@ class LinkController extends Controller
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the link for the given activity.
|
||||
*/
|
||||
public function actionIndex()
|
||||
{
|
||||
$activityId = Yii::$app->request->get('id');
|
||||
@ -45,36 +48,4 @@ class LinkController extends Controller
|
||||
$this->redirect($source->content->getUrl());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a JSON Response with links of an Activity
|
||||
*
|
||||
* @return string json
|
||||
*/
|
||||
public function actionInfo()
|
||||
{
|
||||
Yii::$app->response->format = 'json';
|
||||
|
||||
$json = [];
|
||||
$json['success'] = 'false';
|
||||
|
||||
$activityId = Yii::$app->request->get('id');
|
||||
$activity = Activity::findOne(['id' => $activityId]);
|
||||
|
||||
if ($activity !== null && $activity->content->canRead()) {
|
||||
$json['success'] = 'true';
|
||||
$json['wallEntryId'] = '0';
|
||||
|
||||
$source = $activity->getSource();
|
||||
if ($source instanceof ContentActiveRecord || $source instanceof ContentAddonActiveRecord) {
|
||||
$json['wallEntryId'] = $source->content->getFirstWallEntryId();
|
||||
$json['permaLink'] = $source->content->getUrl();
|
||||
} else {
|
||||
$json['permaLink'] = $activity->content->getUrl();
|
||||
}
|
||||
}
|
||||
|
||||
return $json;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user