diff options
author | Sem <sembrestels@riseup.net> | 2011-11-12 01:38:03 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2011-11-12 01:38:03 +0100 |
commit | 27cfe71b0bb0e4b18b119a7ba17a449771a065b3 (patch) | |
tree | a460cd70409cdb9430c756dac3b74d8f8ba0833c /actions/videolist | |
parent | 89c298b5359333d048fc96bed8e33040fa243a51 (diff) | |
parent | 4585e371857636c1dece9978fba65d978a3afc78 (diff) | |
download | elgg-27cfe71b0bb0e4b18b119a7ba17a449771a065b3.tar.gz elgg-27cfe71b0bb0e4b18b119a7ba17a449771a065b3.tar.bz2 |
Merge branch 'lorea-1.8' of github.com:lorea/videolist into elgg-videolist
Diffstat (limited to 'actions/videolist')
-rw-r--r-- | actions/videolist/edit.php | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/actions/videolist/edit.php b/actions/videolist/edit.php index f9db7b6a2..6670ceadb 100644 --- a/actions/videolist/edit.php +++ b/actions/videolist/edit.php @@ -18,23 +18,33 @@ foreach ($variables as $name => $type) { }
// Get guids
-$videolist_guid = (int)get_input('videolist_guid');
+$video_guid = (int)get_input('video_guid');
$container_guid = (int)get_input('container_guid');
elgg_make_sticky_form('videolist');
elgg_load_library('elgg:videolist');
-if (!$input['video_url']) {
- register_error(elgg_echo('videolist:error:no_url'));
- forward(REFERER);
-}
+// If new video, get data from video providers
+if(!$video_guid) {
+ if (!$input['video_url']) {
+ register_error(elgg_echo('videolist:error:no_url'));
+ forward(REFERER);
+ }
-$parsed_url = videolist_parseurl($input['video_url']);
+ $parsed_url = videolist_parseurl($input['video_url']);
-if(!$parsed_url) {
- register_error(elgg_echo('videolist:error:invalid_url'));
- forward(REFERER);
+ if(!$parsed_url) {
+ register_error(elgg_echo('videolist:error:invalid_url'));
+ forward(REFERER);
+ }
+
+ unset($input['title']);
+ unset($input['description']);
+ $input = array_merge(videolist_get_data($parsed_url), $input);
+
+} else {
+ unset($input['video_url']);
}
if ($video_guid) {
@@ -50,8 +60,6 @@ if ($video_guid) { $new_video = true;
}
-$input = array_merge($input, videolist_get_data($parsed_url));
-
if (sizeof($input) > 0) {
foreach ($input as $name => $value) {
$video->$name = $value;
|