function submitemded() { $helper = new JAVoiceHelpers(); $post = JRequest::get('request'); $description = $post['newVoiceContent']; $objects = array(); if (!$helper->checkYoutubeLink($post['txtYouTubeUrl'])) { $object = new stdClass(); $object->id = '#jav_msg_succesfull_embed'; $object->attr = 'css'; $object->content = 'display,block'; $objects[] = $object; } else { $object = new stdClass(); $object->id = '#newVoiceContent'; $object->attr = 'value'; $object->content = $description . '[youtube ' . $post['txtYouTubeUrl'] . ' youtube]'; $objects[] = $object; $object = new stdClass(); $object->id = '#jav_msg_succesfull_embed'; $object->attr = 'css'; $object->content = 'display,none'; $objects[] = $object; } $object = new stdClass(); $object->id = 'jav_error_checkphp'; $object->attr = 'html'; $object->content = 1; $objects[] = $object; $helper = new JAVoiceHelpers(); echo $helper->parse_JSON_new($objects); exit; }