Removed legacy link function.

This commit is contained in:
buddh4 2017-01-25 18:04:40 +01:00
parent f018028d20
commit 8d46004594

View File

@ -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;
}
}