public function __construct()
 {
     $title = getInput("title");
     $description = getInput("description");
     Security::checkForEmptyFields(array("title"));
     $logged_in_user = getLoggedInUser();
     $logged_in_user_guid = $logged_in_user->guid;
     $album = new Videoalbum();
     $album->title = $title;
     $album->description = $description;
     $album->owner_guid = $logged_in_user_guid;
     $album->save();
     $album->createAvatar();
     new Activity(getLoggedInUserGuid(), "activity:video:album:add", array(getLoggedInUser()->getURL(), getLoggedInUser()->full_name, $album->getURL(), $album->title, $album->icon(EXTRALARGE, "img-responsive")));
     new SystemMessage("Your album has been created.");
     forward("videos");
 }
Esempio n. 2
0
function createVideoAlbum($params)
{
    $description = "";
    $title = $params['title'];
    if (isset($params['description'])) {
        $description = $params['description'];
    }
    if (isset($params['access_id'])) {
        $access_id = $params['access_id'];
    } else {
        $access_id = "public";
    }
    $owner_guid = $params['owner_guid'];
    $album = new Videoalbum();
    $album->title = $title;
    $album->description = $description;
    $album->owner_guid = $owner_guid;
    $album->access_id = $access_id;
    if (isset($params['image'])) {
        $album->icon = uploadBase64Image($params['image']);
    }
    $album->save();
    $user = getEntity($owner_guid);
    new Activity($owner_guid, "activity:add:video:album", array($user->getURL(), $user->full_name, $album->getURL(), $album->title, "<a href='" . $album->getURL() . "'>" . $album->icon(EXTRALARGE, "img-responsive") . "</a>"));
    return $album->guid;
}