$etherpad->write_access_id = ACCESS_LOGGED_IN; } $etherpad_icon = elgg_view('etherpad/icon', array('entity' => $etherpad, 'size' => 'small')); //link to owners pages only if pages integration is enabled. Else link to owners pads. $handler = elgg_get_plugin_setting('integrate_in_pages', 'etherpad') == 'yes' ? 'pages' : 'etherpad'; $editor = get_entity($etherpad->owner_guid); $editor_link = elgg_view('output/url', array('href' => "{$handler}/owner/{$editor->username}", 'text' => $editor->name, 'is_trusted' => true)); $date = elgg_view_friendly_time($etherpad->time_created); $editor_text = elgg_echo('pages:strapline', array($date, $editor_link)); $tags = elgg_view('output/tags', array('tags' => $etherpad->tags)); $categories = elgg_view('output/categories', $vars); $comments_count = $etherpad->countComments(); //only display if there are commments if ($comments_count != 0) { $text = elgg_echo("comments") . " ({$comments_count})"; $comments_link = elgg_view('output/url', array('href' => $etherpad->getURL() . '#page-comments', 'text' => $text, 'is_trusted' => true)); } else { $comments_link = ''; } $metadata = elgg_view_menu('entity', array('entity' => $vars['entity'], 'handler' => 'etherpad', 'sort_by' => 'priority', 'class' => 'elgg-menu-hz')); $subtitle = "{$editor_text} {$comments_link} {$categories}"; // do not show the metadata and controls in widget view if (elgg_in_context('widgets')) { $metadata = ''; } if ($full) { try { $body .= elgg_view('output/iframe', array('value' => $etherpad->getPadPath($timeslider), 'type' => "etherpad")); } catch (Exception $e) { $body .= $e->getMessage(); }
$new_page = false; } else { $page = new ElggPad(); if ($parent_guid) { $page->subtype = 'subpad'; } $new_page = true; } if (sizeof($input) > 0) { foreach ($input as $name => $value) { $page->{$name} = $value; } } // need to add check to make sure user can write to container $page->container_guid = $container_guid; if ($parent_guid) { $page->parent_guid = $parent_guid; } if ($page->save()) { elgg_clear_sticky_form('etherpad'); // Now save description as an annotation //$page->annotate('page', $page->description, $page->access_id); system_message(elgg_echo('etherpad:saved')); if ($new_page) { add_to_river('river/object/etherpad/create', 'create', elgg_get_logged_in_user_guid(), $page->guid); } forward($page->getURL()); } else { register_error(elgg_echo('etherpad:error:no_save')); forward(REFERER); }