예제 #1
0
 /**
  * Ajax repsonse for alias structure widget
  */
 public function actionAliaspathajax()
 {
     if (!Yii::app()->user->checkAccess('Admin')) {
         throw new CHttpException(404, 'You do not have access to this section.');
     }
     if (!YII_DEBUG && !Yii::app()->request->isAjaxRequest) {
         throw new CHttpException('403', 'Forbidden access.');
     }
     if (empty($_GET['id'])) {
         throw new CHttpException('404', 'Missing "id" GET parameter.');
     }
     $path = AdminHelper::pathFromId($_GET['id']);
     header('Content-type: application/json;');
     echo json_encode(array('path' => $path));
 }