Example #1
0
File: edit.php Project: remy40/gvrs
/**
 * Edit a file
 *
 * @package ElggFile
 */
elgg_load_library('elgg:file');
gatekeeper();
$file_guid = (int) get_input('guid');
$file = new FilePluginFile($file_guid);
if (!$file) {
    forward();
}
if (!$file->canEdit()) {
    forward();
}
$title = elgg_echo('file:edit');
$container = elgg_get_page_owner_entity();
if ($container instanceof ElggGroup) {
    elgg_push_breadcrumb(elgg_echo("gvgroups:" . $container->grouptype . "groups"), "groups/" . $container->grouptype);
    elgg_push_breadcrumb($container->name, "file/group/" . $container->guid . "/all");
} else {
    elgg_push_breadcrumb(elgg_echo("menu:home"), "dashboard");
    elgg_push_breadcrumb($container->name, "file/owner/" . $container->guid . "/all");
}
elgg_push_breadcrumb($file->title, $file->getURL());
elgg_push_breadcrumb($title);
$form_vars = array('enctype' => 'multipart/form-data');
$body_vars = file_prepare_form_vars($file);
$content = elgg_view_form('file/upload', $form_vars, $body_vars);
$body = elgg_view_layout('content', array('content' => $content, 'title' => $title, 'filter' => ''));
echo elgg_view_page($title, $body);
Example #2
0
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;
    }
}