diff options
author | cash <cash.costello@gmail.com> | 2011-11-19 18:43:35 -0500 |
---|---|---|
committer | cash <cash.costello@gmail.com> | 2011-11-19 18:43:35 -0500 |
commit | 98664daa72a390fe760b69116af8bfa9327826e3 (patch) | |
tree | 0c28594625cd810dcb2c22fc736191071c55b7fa /actions/addalbum.php | |
parent | 4562cfbb1a630b14fd194271f99f1f8c098dc38d (diff) | |
download | elgg-98664daa72a390fe760b69116af8bfa9327826e3.tar.gz elgg-98664daa72a390fe760b69116af8bfa9327826e3.tar.bz2 |
album creation and editing is working
Diffstat (limited to 'actions/addalbum.php')
-rw-r--r-- | actions/addalbum.php | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/actions/addalbum.php b/actions/addalbum.php deleted file mode 100644 index 8ddcca131..000000000 --- a/actions/addalbum.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php -/** - * Tidypics Add New Album Action - * - */ - -// Make sure we're logged in -gatekeeper(); - -// Get input data -$title = get_input('tidypicstitle'); -$body = get_input('tidypicsbody'); -$tags = get_input('tidypicstags'); -$access = get_input('access_id'); -$container_guid = get_input('container_guid', get_loggedin_userid()); - -// Cache to the session -$_SESSION['tidypicstitle'] = $title; -$_SESSION['tidypicsbody'] = $body; -$_SESSION['tidypicstags'] = $tags; - - -if (empty($title)) { - register_error(elgg_echo("album:blank")); - forward($_SERVER['HTTP_REFERER']); -} - -$album = new TidypicsAlbum(); - -$album->container_guid = $container_guid; -$album->owner_guid = get_loggedin_userid(); -$album->access_id = $access; -$album->title = $title; -$album->description = $body; -if ($tags) { - $album->tags = string_to_tag_array($tags); -} -$album->new_album = TP_NEW_ALBUM; - -if (!$album->save()) { - register_error(elgg_echo("album:error")); - forward(get_input('forward_url', $_SERVER['HTTP_REFERER'])); -} - -mkdir(tp_get_img_dir() . $album->guid, 0755, true); - -system_message(elgg_echo("album:created")); - -// Remove the album post cache -unset($_SESSION['tidypicstitle']); -unset($_SESSION['tidypicsbody']); -unset($_SESSION['tidypicstags']); - -// plugins can register to be told when a new Tidypics album has been created -trigger_elgg_event('add', 'tp_album', $album); - -forward("pg/photos/upload/" . $album->guid); |