function kaltura_create_node_from_roughcut in Kaltura 6.2
Same name and namespace in other branches
- 5 plugins/node_kaltura_mix/node_kaltura_mix.module \kaltura_create_node_from_roughcut()
- 6 plugins/node_kaltura_mix/node_kaltura_mix.module \kaltura_create_node_from_roughcut()
3 calls to kaltura_create_node_from_roughcut()
- kaltura_clone_mix in plugins/
node_kaltura_mix/ node_kaltura_mix.module - kaltura_contribution_wizard in includes/
kaltura.themeing.inc - node_kaltura_mix_form in plugins/
node_kaltura_mix/ node_kaltura_mix.module - Implementation of hook_form().
File
- plugins/
node_kaltura_mix/ node_kaltura_mix.module, line 481
Code
function kaltura_create_node_from_roughcut($result, $status = NULL) {
global $user;
$node->title = $result->name;
$node->body = $result->description;
// print_r($notification_data,TRUE).PHP_EOL.print_r($_REQUEST,TRUE);
$node->type = 'kaltura_mix';
$node->uid = $user->uid;
$node->status = $status ? $status : $_REQUEST['status'];
$node->created = time();
$node->comment = $_REQUEST['comment'];
$node->changed = time();
$node->promote = $_REQUEST['promote'];
$node->sticky = $_REQUEST['sticky'];
kaltura_push_mix_extra_fields($node, $result);
$node->kstatus = $result->status;
$node->kaltura_tags = str_replace('a generated show\'', '', $result->tags);
$node->kaltura_entryId = $result->id;
// NOTE: Added by CM
// $node->kaltura_media_type= $result->type;
$node->kaltura_media_type = 6;
//Oferc: In drupal mix is always 6
$node->kaltura_duration = WORK_WITH_KSHOW ? 'lengthInMsecs' : 'duration';
$node->kaltura_thumbnail_url = $result->thumbnailUrl;
$node->hasRealThumbnail = $result->thumbnailUrl;
$node->kaltura_partner_data = $result->partnerData;
$node->kaltura_source = '';
$node->kaltura_source_id = '';
$node->kaltura_source_link = '';
$node->kaltura_width = '';
$node->kaltura_height = '';
$node->kaltura_download_url = $result->downloadUrl;
$node->kaltura_media_date = '';
$node->kaltura_views = $result->views;
$node->kaltura_plays = $result->plays;
$node->kaltura_votes = $result->votes;
$node->kaltura_rank = $result->rank;
$node->kaltura_total_rank = $result->totalRank;
// Admin tags are not returned in xml from kaltura, so we take them from $_REQUEST
//$node->admin_tags = $result['entry']['admin_tags'];
$node->kaltura_admin_tags = $_REQUEST['admin_tags'];
$node->kaltura_entry_data = serialize(array(
$result,
));
node_save($node);
module_invoke('node_kaltura_mix', 'hook_insert', $node);
return $node->nid;
}