<commit_before><?php
/**
 * Created by JetBrains PhpStorm.
 * User: equipo
 * Date: 28/02/14
 * Time: 17:07
 * To change this template use File | Settings | File Templates.
 */

$user_id = elgg_get_logged_in_user_guid();
$discussion_id = get_input('message-id');
$discussion = array_pop(ClipitPost::get_by_id(array($discussion_id)));

$discussion_title = get_input('discussion-title');
$discussion_text = get_input('discussion-text');
// Attach multimedia group
$attach_file = array_filter(get_input('attach_files'));
$attach_video = array_filter(get_input('attach_videos'));
$attach_storyboard = array_filter(get_input('attach_storyboards'));

if(!isset($discussion) || $discussion->owner_id != $user_id || trim($discussion_title) == ""){
    register_error(elgg_echo("discussion:cantedit"));
} else{
    ClipitPost::set_properties($discussion->id, array(
        'name' => $discussion_title,
        'description' => $discussion_text
    ));
    // Attach multimedia
    ClipitPost::set_files($discussion_id, $attach_file);
    ClipitPost::set_videos($discussion_id, $attach_video);<commit_msg>03/11/2014 15:49<commit_after><?php
/**
 * Created by JetBrains PhpStorm.
 * User: equipo
 * Date: 28/02/14
 * Time: 17:07
 * To change this template use File | Settings | File Templates.
 */

$user_id = elgg_get_logged_in_user_guid();
$discussion_id = get_input('message-id');
$discussion = array_pop(ClipitPost::get_by_id(array($discussion_id)));

$discussion_title = get_input('discussion-title');
$discussion_text = get_input('discussion-text');
// Attach multimedia group
$attach_file = array_filter(get_input('attach_files'));
$attach_video = array_filter(get_input('attach_videos'));
$attach_storyboard = array_filter(get_input('attach_storyboards'));

if(!isset($discussion) || trim($discussion_title) == ""){
    register_error(elgg_echo("discussion:cantedit"));
} else{
    ClipitPost::set_properties($discussion->id, array(
        'name' => $discussion_title,
        'description' => $discussion_text
    ));
    // Attach multimedia
    ClipitPost::set_files($discussion_id, $attach_file);
    ClipitPost::set_videos($discussion_id, $attach_video);
{'fraction_non_alphanumeric': 0.15430954587581094, 'fraction_numerical': 0.014828544949026877, 'mean_word_length': 6.31864406779661, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7053723', 'n_tokens_mistral': 759, 'n_tokens_neox': 697, 'n_words': 112}