<?php /** * Author : Gerard Kanters * @package Videos * Licence : GNU2 */ $video_guid = get_input('guid'); $video = get_entity($video_guid); if (!elgg_instanceof($video, 'object', 'videos') || !$video->canEdit()) { register_error(elgg_echo('videos:unknown_video')); forward(REFERRER); } $page_owner = elgg_get_page_owner_entity(); $title = elgg_echo('videos:edit'); elgg_push_breadcrumb($title); // create form $form_vars = array(); $body_vars = videos_prepare_form_vars($video); $content = elgg_view_form('videos/save', $form_vars, $body_vars); $body = elgg_view_layout('content', array('filter' => '', 'content' => $content, 'title' => $title)); echo elgg_view_page($title, $body);
<?php /** * Author : Gerard Kanters * @package Videos * Licence : GNU2 */ $page_owner = elgg_get_page_owner_entity(); $title = elgg_echo('videos:add'); elgg_push_breadcrumb($title); // create form $form_vars = array(); $vars = videos_prepare_form_vars(); $content = elgg_view_form('videos/save', $form_vars, $vars); $body = elgg_view_layout('content', array('filter' => '', 'content' => $content, 'title' => $title)); echo elgg_view_page($title, $body);
function get_share_forms($page) { $parent_guid = 0; switch ($page[0]) { case "status": echo "<h2>Start a Discussion</h2>"; $content = elgg_view_form('thewire/add', array('name' => 'elgg-wire')); echo $content; exit; case "bookmark": echo "<h2>" . elgg_echo('widget_manager:widgets:getting_started:submitabookmark') . "</h2>"; elgg_load_library('elgg:bookmarks'); echo elgg_view_form('bookmarks/save', array(), $vars); exit; case "file": echo "<h2>" . elgg_echo('file:add') . "</h2>"; elgg_load_library('elgg:file'); $form_vars = array('enctype' => 'multipart/form-data'); $body_vars = file_prepare_form_vars(); $content = elgg_view_form('file/upload', $form_vars, $body_vars); echo $content; exit; case "video": echo "<h2>" . elgg_echo('videos:add') . "</h2>"; elgg_load_library('elgg:videos'); $vars = videos_prepare_form_vars(); $content = elgg_view_form('videos/save', $form_vars, $vars); echo $content; exit; } }