本文整理汇总了PHP中elgg_view_module函数的典型用法代码示例。如果您正苦于以下问题:PHP elgg_view_module函数的具体用法?PHP elgg_view_module怎么用?PHP elgg_view_module使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了elgg_view_module函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_entities_list
function show_entities_list($title, $entities)
{
$body = '';
if ($entities) {
foreach ($entities as $entity) {
$body .= "<a href='" . $entity->getURL() . "'>" . $entity->name . "</a><br>";
}
} else {
$body .= "aucun.<br>";
}
echo elgg_view_module('aside', $title, $body);
}
示例2: elgg_view_form
$forms .= elgg_view_form('faker/gen_likes');
}
if (elgg_is_active_plugin('countries')) {
$forms .= elgg_view_form('faker/gen_location');
}
}
$fakes = elgg_list_entities_from_metadata(array('metadata_names' => '__faker'));
$content = '<div id="faker-log">' . $fakes . '</div>';
$delete = elgg_view('output/url', array('text' => elgg_echo('faker:delete'), 'href' => 'action/faker/delete', 'confirm' => true, 'class' => 'elgg-button elgg-button-action'));
echo '<div class="clearfix">';
echo '<div class="elgg-col elgg-col-1of2">';
echo '<div class="pam">';
echo $forms;
echo '</div>';
echo '</div>';
echo '<div class="elgg-col elgg-col-1of2">';
echo '<div class="pam">';
echo elgg_view_module('aside', elgg_echo('faker:data'), $content, array('footer' => $delete));
echo '</div>';
echo '</div>';
echo '</div>';
?>
<style>
#faker-log {
min-height: 400px;
overflow-y: scroll;
padding: 10px;
background: #f4f4f4;
border: 1px solid #e8e8e8;
}
</style>
示例3: foreach
}
foreach ($ordered_relationships as $rel) {
if ($rel == EVENT_MANAGER_RELATION_ATTENDING || $rel == EVENT_MANAGER_RELATION_ATTENDING_PENDING || $event->{$rel} || $rel == EVENT_MANAGER_RELATION_ATTENDING_WAITINGLIST && $event->canEdit() && $event->waiting_list_enabled) {
if (array_key_exists($rel, $relationships)) {
$members = $relationships[$rel];
$rel_title = "";
if ($event->canEdit()) {
$rel_title .= elgg_view("output/url", array("is_action" => true, "href" => "action/event_manager/attendees/export?guid=" . $event->getGUID() . "&rel=" . $rel, "title" => elgg_echo("event_manager:event:exportattendees"), "text" => elgg_view_icon("download"), "class" => "float-alt"));
}
$rel_title .= elgg_echo("event_manager:event:relationship:" . $rel . ":label") . " (" . count($members) . ")";
$rel_content = "";
foreach ($members as $member) {
$member_entity = get_entity($member);
$member_info = elgg_view_entity_icon($member_entity, "small", array("event" => $event));
if ($event->canEdit()) {
$rel = $member_entity->name;
if ($member_entity instanceof ElggUser) {
$rel .= " " . $member_entity->username;
} else {
$rel .= " " . $member_entity->email;
}
$member_info = "<span class='event-manager-event-view-attendee-info' rel='" . $rel . "'>" . $member_info . "</span>";
}
$rel_content .= $member_info;
}
$result .= elgg_view_module("info", $rel_title, $rel_content, array("class" => "event-manager-event-view-attendees"));
}
}
}
echo $result;
}
示例4: elgg_view_module
<?php
if ($description = elgg_get_plugin_setting("contact_sidebar_description", "contact")) {
echo elgg_view_module("aside", "", elgg_view("output/longtext", array("value" => $description)));
}
示例5: elgg_view
<?php
/**
* A view to load through ajax for the lightbox demo
*/
$ipsum = elgg_view('developers/ipsum');
$resize_button = elgg_view('input/button', ['id' => 'elgg-lightbox-test-resize', 'class' => 'elgg-button elgg-button-action', 'value' => 'Add extra content and resize']);
echo '<div class="mam" style="width: 400px;">';
echo elgg_view_module('aside', 'Lightbox Test', $ipsum, array('id' => 'elgg-lightbox-test', 'footer' => $resize_button));
echo '</div>';
示例6: elgg_get_plugin_setting
<?php
/*
* 3 Column River Acitivity
*
* @package ElggRiverDash
* Full Creadit goes to ELGG Core Team for creating a beautiful social networking script
*
* Modified by Satheesh PM, BARC, Mumbai, India..
* http://satheesh.anushaktinagar.net
*
* @author ColdTrick IT Solutions
* @copyright Coldtrick IT Solutions 2009
* @link http://www.coldtrick.com/
* @version 1.0
*
*/
$msg_html = elgg_get_plugin_setting('html_msg', 'river_activity_3C');
$title = elgg_echo('river_activity_3C:html');
$box_view = elgg_get_plugin_setting('view_riverbox', 'river_activity_3C');
if ($msg_html) {
$river_body = $msg_html;
} else {
$river_body = elgg_echo('river_activity_3C:html-no');
}
echo elgg_view_module($box_view, $title, $river_body);
示例7: elgg_echo
// Upload module
$upload_title = elgg_echo('media:upload');
$upload_mod = '<div class="elgg-text-help">' . elgg_echo('media:upload:instructions') . '</div>';
$upload_mod .= elgg_view("input/file", ['name' => 'media', 'class' => 'media-upload-input']);
echo elgg_view_module('aside', $upload_title, $upload_mod, ['class' => 'media-upload-module']);
// Cropper module
$cropper_title = elgg_echo('media:crop:title');
$cropper_mod = elgg_format_element('p', ['class' => 'elgg-text-help'], elgg_echo('media:create:instructions'));
$img = '';
$sizes = elgg_media_get_thumb_sizes($entity, $type);
$ratio = $sizes['small']['square'] ? 1 : $sizes['small']['w'] / $sizes['small']['h'];
if (elgg_has_media($entity, $type)) {
$x = $y = 0;
$width = $height = $sizes['master']['w'];
if ($entity->{"{$type}_x2"} > $entity->{"{$type}_x1"} && $entity->{"{$type}_y2"} > $entity->{"{$type}_y1"}) {
$x = (int) $entity->{"{$type}_x1"};
$y = (int) $entity->{"{$type}_y1"};
$width = (int) $entity->{"{$type}_x2"} - (int) $entity->{"{$type}_x1"};
$height = (int) $entity->{"{$type}_y2"} - (int) $entity->{"{$type}_y1"};
}
$img = elgg_view('output/img', ['src' => $entity->getIconURL(['type' => $type, 'size' => 'master']), 'alt' => elgg_echo('media'), 'data-x' => $x, 'data-y' => $y, 'data-width' => $width, 'data-height' => $height]);
}
$cropper_mod .= elgg_format_element('div', ['class' => 'media-cropper-preview'], $img);
foreach (['x1', 'y1', 'x2', 'y2'] as $coord) {
$cropper_mod .= elgg_view('input/hidden', ['name' => $coord, 'value' => (int) $entity->{$coord}, "data-{$coord}" => true]);
}
$cropper_mod .= elgg_view('input/hidden', ['name' => 'type', 'value' => $type]);
echo elgg_view_module('aside', $cropper_title, $cropper_mod, ['class' => 'media-cropper-module hidden', 'data-ratio' => $ratio]);
$footer = elgg_view('input/submit', ['value' => elgg_echo('save'), 'disabled' => true, 'class' => 'elgg-state-disabled elgg-button-submit']);
$footer .= elgg_view('input/hidden', ['name' => 'guid', 'value' => $entity->guid]);
echo elgg_format_element('div', ['class' => 'elgg-foot'], $footer);
示例8: elgg_load_library
<?php
/**
* EXIF sidebar module
*/
$image = $vars["image"];
elgg_load_library("tidypics:exif");
$exif = tp_exif_formatted($image);
if ($exif) {
$title = "EXIF";
$body = "<table class='elgg-table elgg-table-alt'>";
foreach ($exif as $key => $value) {
$body .= "<tr>";
$body .= "<td>" . elgg_view("output/text", array("value" => filter_tags($key))) . "</td>";
$body .= "<td>" . elgg_view("output/text", array("value" => filter_tags($value))) . "</td>";
$body .= "</tr>";
}
$body .= "</table>";
echo elgg_view_module("aside", $title, $body);
}
示例9: elgg_view
<?php
echo elgg_view('code_review/navigation');
//fetch all
$functions = code_review::getPrivateFunctionsList();
$fixes = new \CodeReview\CodeFixer();
$title = elgg_echo('code_review:private_list:title');
$body = "<table class=\"elgg-table-alt\">";
$body .= "<tr>" . "<th><strong>" . elgg_echo('code_review:private_list:name') . "</strong></th>" . "<th><strong>" . elgg_echo('code_review:private_list:reason') . "</strong></th>" . "</tr>";
ksort($functions, SORT_STRING);
foreach ($functions as $name => $data) {
$fileLine = elgg_echo('code_review:private_list:file_line', array($data['file'], $data['line']));
$body .= "<tr><td><abbr title=\"{$fileLine}\">" . $data['name'] . "</abbr></td>" . "<td>" . elgg_echo('code_review:private_list:reason:' . $data['reason']) . "</td></tr>";
}
$body .= '</table>';
echo elgg_view_module('featured', $title, $body, array('class' => 'mbl'));
示例10: elgg_get_entities_from_relationship
// count members
$member_count = $group->getMembers(['count' => true]);
// count how manyu members are notified by email
$notification_options = ['type' => 'user', 'count' => true, 'relationship' => 'notifyemail', 'relationship_guid' => $group->getGUID(), 'inverse_relationship' => true];
$notification_count = elgg_get_entities_from_relationship($notification_options);
if (elgg_is_active_plugin('site_notifications')) {
// maybe more members are being notified by site
$notification_options['relationship'] = 'notifysite';
$site_notification_count = elgg_get_entities_from_relationship($notification_options);
if (!empty($site_notification_count)) {
if ($site_notification_count > $notification_count) {
$notification_count = $site_notification_count;
}
}
}
// start building content
$title = elgg_echo('group_tools:notifications:title');
$content = elgg_format_element('div', ['class' => 'mbm'], elgg_echo('group_tools:notifications:description', [$member_count, $notification_count]));
// enable notification for everyone
if ($member_count > $notification_count) {
$content .= elgg_view('output/url', ['href' => "action/group_tools/notifications?toggle=enable&guid={$group->getGUID()}", 'text' => elgg_echo('group_tools:notifications:enable'), 'class' => 'elgg-button elgg-button-submit mrm', 'confirm' => true]);
}
// disable notification
if ($notification_count > 0) {
$content .= elgg_view('output/url', ['href' => "action/group_tools/notifications?toggle=disable&guid={$group->getGUID()}", 'text' => elgg_echo('group_tools:notifications:disable'), 'class' => 'elgg-button elgg-button-submit', 'confirm' => true]);
}
// disclaimer about timing
$content .= elgg_format_element('div', ['class' => 'elgg-quiet mtm'], elgg_echo('group_tools:notifications:disclaimer'));
// echo content
echo elgg_view_module('info', $title, $content);
示例11: elgg_extract
<?php
$user = elgg_extract("entity", $vars, elgg_get_page_owner_entity());
if (empty($user) || !elgg_instanceof($user, "user")) {
return;
}
echo elgg_view_module("info", "", elgg_echo("tag_tools:notifications:description"));
$NOTIFICATION_HANDLERS = _elgg_services()->notifications->getMethodsAsDeprecatedGlobal();
$tags = tag_tools_get_user_following_tags($user->getGUID());
if (empty($tags)) {
echo elgg_view('output/longtext', array('value' => elgg_echo("tag_tools:notifications:empty")));
return;
}
elgg_require_js("tag_tools/notifications");
echo "<table class='elgg-table-alt'>";
// header with notification methods and delete
echo "<thead>";
echo "<tr><th> </th>";
foreach ($NOTIFICATION_HANDLERS as $method => $foo) {
echo "<th class='center'>" . elgg_echo('notification:method:' . $method) . "</th>";
}
echo "<th class='center'>" . elgg_echo("delete") . "</th>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
// all tags
foreach ($tags as $tag) {
$encoded_tag = htmlspecialchars($tag, ENT_QUOTES, "UTF-8", false);
echo "<tr>";
echo "<td>";
echo $encoded_tag;
示例12: elgg_require_js
<?php
elgg_require_js('framework/inbox/admin');
$title = elgg_echo('inbox:admin:import');
$body = '<p class="mam">' . elgg_echo('inbox:admin:import_stats', array($vars['count'])) . '</p>';
$body .= elgg_view('output/url', array('id' => 'inbox-admin-import', 'text' => elgg_echo('inbox:admin:import_start'), 'class' => 'elgg-button elgg-button-action float mam', 'rel' => elgg_echo('inbox:admin:import_warning'), 'data-count' => $vars['count']));
$body .= '<div id="import-progress" class="mam"></div>';
echo elgg_view_module('widget', $title, $body);
示例13: elgg_echo
if ($blogs = elgg_get_entities($blog_options)) {
if ($vars['email']) {
$title = "<h2 class='email'>" . elgg_echo("blog:blogs") . "</h2>";
$title .= "<h5 class='email'>To view all site blogs visit " . elgg_get_site_url() . "blog/all?filter=newest </h5>";
$latest_blogs = "<div class='email-section'>";
foreach ($blogs as $blog) {
$latest_blogs .= "<div class='blog'>";
$latest_blogs .= "<h4 class='email'>" . $blog->title . "</h4>";
$latest_blogs .= "<p>" . elgg_get_excerpt($blog->description) . "</p>";
$latest_blogs .= "</div>";
}
$latest_blogs .= "</div>";
echo $title . $latest_blogs;
} else {
$title = elgg_echo("blog:blogs");
$title .= "<h5>To view all site blogs visit " . elgg_get_site_url() . "blog/all?filter=newest </h5>";
$latest_blogs = "";
foreach ($blogs as $blog) {
$latest_blogs .= "<div class='digest-blog'>";
if ($blog->icontime) {
$latest_blogs .= "<img src='" . $blog->getIconURL("medium") . "' />";
}
$latest_blogs .= "<span>";
$latest_blogs .= "<h4>" . $blog->title . "</h4>";
$latest_blogs .= elgg_get_excerpt($blog->description);
$latest_blogs .= "</span>";
$latest_blogs .= "</div>";
}
echo elgg_view_module("digest", $title, $latest_blogs);
}
}
示例14: elgg_push_context
<?php
/**
* List all suggested groups
*/
elgg_push_context('zhg_contact');
$options = array("count" => elgg_extract("count", $vars), "limit" => false, "full_view" => false, "pagination" => false);
$list = elgg_view_entity_list($vars["entities"], $options);
elgg_pop_context('zhg_contact');
$result .= "<div id='zhaohu_manager_member_listing'>";
if (!empty($list)) {
$result .= $list;
} else {
$result .= elgg_echo('zhaohu_manager:list:noresults');
}
$result .= "</div>";
echo elgg_view_module("main", "", $result);
示例15: array_merge
$revisions[] = $auto_save_annotations[0];
}
$saved_revisions = $blog->getAnnotations(['annotation_name' => 'blog_revision', 'reverse_order_by' => true, 'limit' => false]);
$revisions = array_merge($revisions, $saved_revisions);
if (empty($revisions)) {
return;
}
$load_base_url = "blog/edit/{$blog->getGUID()}";
// show the "published revision"
$published_item = '';
if ($blog->status == 'published') {
$load = elgg_view('output/url', ['href' => $load_base_url, 'text' => elgg_echo('status:published'), 'is_trusted' => true]);
$time = elgg_format_element('span', ['class' => 'elgg-subtext'], elgg_view_friendly_time($blog->time_created));
$published_item = elgg_format_element('li', [], "{$load}: {$time}");
}
$n = count($revisions);
$revisions_list = '';
foreach ($revisions as $revision) {
$time = elgg_format_element('span', ['class' => 'elgg-subtext'], elgg_view_friendly_time($revision->time_created));
if ($revision->name == 'blog_auto_save') {
$revision_lang = elgg_echo('blog:auto_saved_revision');
} else {
$revision_lang = elgg_echo('blog:revision') . " {$n}";
}
$load = elgg_view('output/url', array('href' => "{$load_base_url}/{$revision->id}", 'text' => $revision_lang, 'is_trusted' => true));
$revisions_list .= elgg_format_element('li', ['class' => 'auto-saved'], "{$load}: {$time}");
$n--;
}
$body = elgg_format_element('ul', ['class' => 'blog-revisions'], $published_item . $revisions_list);
echo elgg_view_module('aside', elgg_echo('blog:revisions'), $body);