Beispiel #1
0
 public static function photobookPageThumb($url, $photobook_id, $user_id = null)
 {
     if (Yii::$app->user->isGuest && $user_id == null) {
         return false;
     }
     if ($user_id == null) {
         $user_id = Yii::$app->user->identity->getId();
     }
     //$alpha_id=AlphaId::id($user_id);
     if ($url) {
         $base_url = UserUrl::photobook(true, $photobook_id, $user_id);
         return $base_url . '/' . 'pages_thumb';
     } else {
         $base_path = UserUrl::photobook(false, $photobook_id, $user_id);
         return UserUrl::createNonexistentDirInPath($base_path, 'pages_thumb');
     }
 }
Beispiel #2
0
 public function delete()
 {
     // $this->name=$new_name;
     $photobook_dir = UserUrl::photobook(false, $this->id, $this->user_id);
     if (Photobook::deleteAll(['id' => $this->id])) {
         if (file_exists($photobook_dir)) {
             Utils::rrmdir($photobook_dir);
         }
         $result = ['response' => ['status' => true]];
     } else {
         $result = ['error' => ['msg' => Yii::t('app', 'Не удалось удалить')]];
     }
     return $result;
 }