当前位置: 首页>>代码示例>>PHP>>正文


PHP elgg_view_page函数代码示例

本文整理汇总了PHP中elgg_view_page函数的典型用法代码示例。如果您正苦于以下问题:PHP elgg_view_page函数的具体用法?PHP elgg_view_page怎么用?PHP elgg_view_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了elgg_view_page函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: profile_page_handler

/**
 * Profile page handler
 *
 * @param array $page Array of URL segments passed by the page handling mechanism
 * @return bool
 */
function profile_page_handler($page)
{
    if (isset($page[0])) {
        $username = $page[0];
        $user = get_user_by_username($username);
        elgg_set_page_owner_guid($user->guid);
    } elseif (elgg_is_logged_in()) {
        forward(elgg_get_logged_in_user_entity()->getURL());
    }
    // short circuit if invalid or banned username
    if (!$user || $user->isBanned() && !elgg_is_admin_logged_in()) {
        register_error(elgg_echo('profile:notfound'));
        forward();
    }
    $action = NULL;
    if (isset($page[1])) {
        $action = $page[1];
    }
    if ($action == 'edit') {
        // use the core profile edit page
        $base_dir = elgg_get_root_path();
        require "{$base_dir}pages/profile/edit.php";
        return true;
    }
    $content = elgg_view('profile/layout', array('entity' => $user));
    $body = elgg_view_layout('one_column', array('content' => $content));
    echo elgg_view_page($user->name, $body);
    return true;
}
开发者ID:nooshin-mirzadeh,项目名称:web_2.0_benchmark,代码行数:35,代码来源:start.php

示例2: legacy_urls_redirect

/**
 * Redirect the requestor to the new URL
 * Checks the plugin setting to determine the course of action:
 * a) Displays an error page with the new URL
 * b) Forwards to the new URL and displays an error message
 * c) Silently forwards to the new URL
 *
 * @param string $url Relative or absolute URL
 * @return mixed
 */
function legacy_urls_redirect($url)
{
    $method = elgg_get_plugin_setting('redirect_method', 'legacy_urls');
    // we only show landing page or queue warning if html generating page
    $viewtype = elgg_get_viewtype();
    if ($viewtype != 'default' && !elgg_does_viewtype_fallback($viewtype)) {
        $method = 'immediate';
    }
    switch ($method) {
        case 'landing':
            $content = elgg_view('legacy_urls/message', array('url' => $url));
            $body = elgg_view_layout('error', array('content' => $content));
            echo elgg_view_page('', $body, 'error');
            return true;
            break;
        case 'immediate_error':
            // drop through after setting error message
            register_error(elgg_echo('changebookmark'));
        case 'immediate':
        default:
            $url = elgg_normalize_url($url);
            header("HTTP/1.1 301 Moved Permanently");
            header("Location: {$url}");
            exit;
            break;
    }
}
开发者ID:elgg,项目名称:elgg,代码行数:37,代码来源:start.php

示例3: gvcontact_page_handler

/**
 * gvcontact page handler
 *
 * @param array  $page    URL segements
 * @param string $handler Handler identifier
 * @return bool
 */
function gvcontact_page_handler($page, $handler)
{
    $title = elgg_echo('gvcontact:contacttitle');
    $content = elgg_view_form('gvcontact/contact');
    $body = elgg_view_layout('one_column', array('content' => $content));
    echo elgg_view_page($title, $body);
}
开发者ID:remy40,项目名称:gvrs,代码行数:14,代码来源:start.php

示例4: jpatchwork_page_handler

function jpatchwork_page_handler($page)
{
    if (!isset($page[0])) {
        $page[0] = 'sample';
    }
    elgg_set_context('jpatchwork');
    $page_type = $page[0];
    switch ($page_type) {
        case 'sample':
            $area2 = elgg_view_title(elgg_echo('jpatchwork:sample_title'));
            // Add the form to this section
            elgg_set_viewtype('xml');
            $area2 .= elgg_view('jpatchwork/sample');
            elgg_set_viewtype('default');
            break;
        case 'frozenbubble':
            $area2 = elgg_view_title(elgg_echo('jpatchwork:frozenbubble_title'));
            // Add the form to this section
            elgg_set_viewtype('xml');
            $area2 .= elgg_view('jpatchwork/frozenbubble');
            elgg_set_viewtype('default');
            break;
        default:
            return false;
    }
    // Format page
    $body = elgg_view('page/layouts/one_sidebar', array('content' => $area2));
    // Draw it
    echo elgg_view_page(elgg_echo('jpatchwork:title'), $body);
    return true;
}
开发者ID:iionly,项目名称:jpatchwork,代码行数:31,代码来源:start.php

示例5: au_group_tag_menu_page_handler

function au_group_tag_menu_page_handler($page, $identifier)
{
    //show the page of search results
    // assumes url of group/guid/tag
    // if the tag is 'all' then will display a tagcloud
    switch ($page[0]) {
        case 'group':
            $entity = get_entity($page[1]);
            if (!elgg_instanceof($entity, 'group') || $entity->au_group_tag_menu_enable == 'no') {
                return false;
            }
            elgg_push_breadcrumb($entity->name, $entity->getURL());
            //should be OK if this is empty
            $tag = $page[2];
            elgg_push_breadcrumb($tag);
            if ($tag == "all") {
                //show a tag cloud for all group tags
                //arbitrarily set to a max of 640 tags - should be enough for anyone :-)
                $title = elgg_echo("au_group_tag_menu:tagcloud");
                $options = array('container_guid' => $entity->getGUID(), 'type' => 'object', 'threshold' => 0, 'limit' => 640, 'tag_names' => array('tags'));
                $thetags = elgg_get_tags($options);
                //make it an alphabetical tag cloud, not with most popular first
                sort($thetags);
                //find the highest tag count for scaling the font
                $max = 0;
                foreach ($thetags as $key) {
                    if ($key->total > $max) {
                        $max = $key->total;
                    }
                }
                $content = "  ";
                //loop through and generate tags so they display nicely
                //in the group, not as a dumb search page
                foreach ($thetags as $key) {
                    $url = elgg_get_site_url() . "group_tag_menu/group/" . $entity->getGUID() . "/" . urlencode($key->tag);
                    $taglink = elgg_view('output/url', array('text' => ' ' . $key->tag, 'href' => $url, 'title' => "{$key->tag} ({$key->total})", 'rel' => 'tag'));
                    //  get the font size for the tag (taken from elgg's own tagcloud code - not sure I love this)
                    $size = round(log($key->total) / log($max + 0.0001) * 100) + 30;
                    if ($size < 100) {
                        $size = 100;
                    }
                    // generate the link
                    $content .= " <a href='{$url}' style='font-size:{$size}%'>" . $key->tag . "</a> &nbsp; ";
                }
            } else {
                //show the results for the selected tag
                $title = elgg_echo("au_group_tag_menu:title") . "{$tag}";
                $options = array('type' => 'object', 'metadata_name' => 'tags', 'metadata_value' => $tag, 'container_guid' => $entity->guid, 'full_view' => false);
                $content = elgg_list_entities_from_metadata($options);
            }
            //display the page
            if (!$content) {
                $content = elgg_echo('au_group_tag_menu:noresults');
            }
            $layout = elgg_view_layout('content', array('title' => elgg_view_title($title), 'content' => $content, 'filter' => false));
            echo elgg_view_page($title, $layout);
            break;
    }
    return true;
}
开发者ID:amcfarlane1251,项目名称:ongarde,代码行数:60,代码来源:start.php

示例6: profile_page_handler

/**
 * Profile page handler
 *
 * @param array $page Array of page elements, forwarded by the page handling mechanism
 */
function profile_page_handler($page)
{
    if (isset($page[0])) {
        $username = $page[0];
        $user = get_user_by_username($username);
        elgg_set_page_owner_guid($user->guid);
    }
    // short circuit if invalid or banned username
    if (!$user || $user->isBanned() && !elgg_is_admin_logged_in()) {
        register_error(elgg_echo('profile:notfound'));
        forward();
    }
    $action = NULL;
    if (isset($page[1])) {
        $action = $page[1];
    }
    if ($action == 'edit') {
        // use the core profile edit page
        $base_dir = elgg_get_root_path();
        require "{$base_dir}pages/profile/edit.php";
        return;
    }
    // main profile page
    $params = array('content' => elgg_view('profile/wrapper'), 'num_columns' => 3);
    $content = elgg_view_layout('widgets', $params);
    $body = elgg_view_layout('one_column', array('content' => $content));
    echo elgg_view_page($title, $body);
}
开发者ID:rasul,项目名称:Elgg,代码行数:33,代码来源:start.php

示例7: handlePages

 /**
  * Handles embedded URLs
  *
  * @param array $page URL segments
  * @return boolean
  */
 function handlePages($page)
 {
     $url = get_input('url');
     $handle = get_input('handle');
     $iframe = get_input('iframe', false);
     $site = elgg_get_site_entity();
     if (!$handle) {
         $handle = $site->guid;
     }
     if (!$url || !$handle) {
         return false;
     }
     $parse = elgg_is_logged_in();
     switch ($page[0]) {
         default:
             $data = $this->model->get($url, $handle, $parse);
             $layout = elgg_view('output/card', array('href' => $url, 'handle' => $handle));
             $shell = $iframe ? 'iframe' : 'default';
             echo elgg_view_page($data['title'], $layout, $shell);
             break;
         case 'json':
             $data = $this->model->get($url, $handle, $parse);
             header('Content-Type: application/json');
             echo json_encode($data);
             exit;
     }
     return true;
 }
开发者ID:n8b,项目名称:VMN,代码行数:34,代码来源:Router.php

示例8: expages_page_handler

/**
 * External pages page handler
 *
 * @param array  $page    URL segements
 * @param string $handler Handler identifier
 * @return bool
 */
function expages_page_handler($page, $handler)
{
    if ($handler == 'expages') {
        expages_url_forwarder($page[1]);
    }
    $type = strtolower($handler);
    $title = elgg_echo("expages:{$type}");
    $header = elgg_view_title($title);
    $object = elgg_get_entities(array('type' => 'object', 'subtype' => $type, 'limit' => 1));
    if ($object) {
        $content .= elgg_view('output/longtext', array('value' => $object[0]->description));
    } else {
        $content .= elgg_echo("expages:notset");
    }
    $content = elgg_view('expages/wrapper', array('content' => $content));
    if (elgg_is_logged_in() || !elgg_get_config('walled_garden')) {
        $body = elgg_view_layout('one_column', array('title' => $title, 'content' => $content));
        echo elgg_view_page($title, $body);
    } else {
        elgg_load_css('elgg.walled_garden');
        $body = elgg_view_layout('walled_garden', array('content' => $header . $content));
        echo elgg_view_page($title, $body, 'walled_garden');
    }
    return true;
}
开发者ID:nooshin-mirzadeh,项目名称:web_2.0_benchmark,代码行数:32,代码来源:start.php

示例9: stripe_page_handler

/**
 * Stripe related pages
 *
 * @param array $page
 * @param string $handler
 * @return boolean
 */
function stripe_page_handler($page, $handler)
{
    gatekeeper();
    $username = elgg_extract(0, $page, false);
    if ($username) {
        $user = get_user_by_username($username);
    }
    if (!elgg_instanceof($user) || !$user->canEdit()) {
        $user = elgg_get_logged_in_user_entity();
        forward("{$handler}/{$user->username}");
    }
    elgg_set_context('settings');
    elgg_set_page_owner_guid($user->guid);
    elgg_push_breadcrumb(elgg_echo('stripe:billing'), 'billing');
    $context = elgg_extract(1, $page, 'cards');
    $action = elgg_extract(2, $page, 'all');
    $view = "stripe/pages/{$context}/{$action}";
    if (elgg_view_exists($view)) {
        $params = array('entity' => $user, 'id' => elgg_extract(3, $page, false), 'context' => $page);
        $title = elgg_echo("stripe:{$context}:{$action}");
        $content = elgg_view($view, $params);
        $sidebar = elgg_view('stripe/sidebar', $params);
        $filter = elgg_view("stripe/filters/{$context}/{$action}", $params);
    }
    if ($content) {
        if (elgg_is_xhr()) {
            echo $content;
        } else {
            $layout = elgg_view_layout('content', array('title' => $title, 'content' => $content, 'sidebar' => $sidebar, 'filter' => $filter));
            echo elgg_view_page($title, $layout);
        }
        return true;
    }
    return false;
}
开发者ID:Daltonmedia,项目名称:stripe,代码行数:42,代码来源:page_handlers.php

示例10: expages_page_handler

/**
 * External pages page handler
 *
 * @param array  $page    URL segements
 * @param string $handler Handler identifier
 * @return bool
 */
function expages_page_handler($page, $handler)
{
    if ($handler == 'expages') {
        expages_url_forwarder($page[1]);
    }
    $type = strtolower($handler);
    $title = elgg_echo("expages:{$type}");
    $header = elgg_view_title($title);
    $object = elgg_get_entities(array('type' => 'object', 'subtype' => $type, 'limit' => 1));
    if ($object) {
        $content .= elgg_view('output/longtext', array('value' => $object[0]->description));
    } else {
        $content .= elgg_echo("expages:notset");
    }
    $content = elgg_view('expages/wrapper', array('content' => $content));
    if (elgg_is_admin_logged_in()) {
        elgg_register_menu_item('title', array('name' => 'edit', 'text' => elgg_echo('edit'), 'href' => "admin/appearance/expages?type={$type}", 'link_class' => 'elgg-button elgg-button-action'));
    }
    if (elgg_is_logged_in() || !elgg_get_config('walled_garden')) {
        $body = elgg_view_layout('one_column', array('title' => $title, 'content' => $content));
        echo elgg_view_page($title, $body);
    } else {
        elgg_load_css('elgg.walled_garden');
        $body = elgg_view_layout('walled_garden', array('content' => $header . $content));
        echo elgg_view_page($title, $body, 'walled_garden');
    }
    return true;
}
开发者ID:thehereward,项目名称:Elgg,代码行数:35,代码来源:start.php

示例11: hflts_page_handler

function hflts_page_handler($page)
{
    if (elgg_extract(0, $page) === 'collective') {
        $content = elgg_view('hflts/collective', array('nAlternativas' => $page[1], 'nCriterios' => $page[2], 'nExpertos' => $page[3], 'G' => $page[4], 'import_file' => $page[5], 'weight_file' => $page[6]));
        $params = array('title' => 'DM con datos de samples/set_' . $page[5] . '.csv (' . $page[6] . ')', 'content' => $content, 'filter' => '');
        $body = elgg_view_layout('content', $params);
        echo elgg_view_page('hflts', $body);
        return true;
    }
    set_input('username', $page[0]);
    //necesario
    $user = elgg_get_page_owner_entity();
    // ej strem
    $guid = elgg_get_page_owner_guid();
    // id de strem
    //aqui es donde tengo que filtrar por guid como en https://elgg.org/discussion/view/2268999/doubt-in-elgg-get-entities-from-metadata
    $valorations = elgg_get_entities_from_metadata(['type' => 'object', 'subtype' => 'evaluation_content', 'metadata_name_value_pairs' => array('name' => 'user_guid', 'value' => $guid), 'limit' => $vars['entity']->num_display, 'pagination' => false, 'order_by_metadata' => ['name' => 'state', 'direction' => 'ASC', 'as' => 'text']]);
    if (!$valorations) {
        $valorations = '<p class="mtm">' . elgg_echo('evaluationcontent:none') . '</p>';
    }
    $content = elgg_view('hflts/driver', array('valorations' => $valorations));
    $params = array('title' => 'Valoraciones de ' . $user->name, 'content' => $content, 'filter' => '');
    $body = elgg_view_layout('content', $params);
    echo elgg_view_page('hflts', $body);
}
开发者ID:rosanamontes,项目名称:teranga.go,代码行数:25,代码来源:start.php

示例12: customstyle_page_handler

function customstyle_page_handler($page)
{
    gatekeeper();
    elgg_set_context('customstyle');
    elgg_set_page_owner_guid(elgg_get_logged_in_user_guid());
    $title = elgg_echo('customstyle');
    $base_dir = elgg_get_plugins_path() . 'customstyle/pages/customstyle';
    switch ($page[0]) {
        case 'colors':
            $body = elgg_view('customstyle/colors');
            break;
        case 'background':
            $body = elgg_view('customstyle/background');
            break;
        case 'personalize':
            $body = elgg_view('customstyle/default');
            break;
        default:
            $body = elgg_view('customstyle/default');
            break;
    }
    $params = array('content' => $body, 'title' => $title);
    $body = elgg_view_layout('one_sidebar', $params);
    echo elgg_view_page($title, $body);
    return true;
}
开发者ID:Ruthkaveke,项目名称:tumchat,代码行数:26,代码来源:start.php

示例13: _elgg_comments_page_handler

/**
 * Page handler for generic comments manipulation.
 *
 * @param array $page
 * @return bool
 * @access private
 */
function _elgg_comments_page_handler($page)
{
    switch ($page[0]) {
        case 'edit':
            elgg_gatekeeper();
            if (empty($page[1])) {
                register_error(elgg_echo('generic_comment:notfound'));
                forward(REFERER);
            }
            $comment = get_entity($page[1]);
            if (!$comment instanceof \ElggComment || !$comment->canEdit()) {
                register_error(elgg_echo('generic_comment:notfound'));
                forward(REFERER);
            }
            $target = $comment->getContainerEntity();
            if (!$target instanceof \ElggEntity) {
                register_error(elgg_echo('generic_comment:notfound'));
                forward(REFERER);
            }
            $title = elgg_echo('generic_comments:edit');
            elgg_push_breadcrumb($target->getDisplayName(), $target->getURL());
            elgg_push_breadcrumb($title);
            $params = array('entity' => $target, 'comment' => $comment, 'is_edit_page' => true);
            $content = elgg_view_form('comment/save', null, $params);
            $params = array('content' => $content, 'title' => $title, 'filter' => '');
            $body = elgg_view_layout('content', $params);
            echo elgg_view_page($title, $body);
            return true;
            break;
        default:
            return false;
            break;
    }
}
开发者ID:sephiroth88,项目名称:Elgg,代码行数:41,代码来源:comments.php

示例14: tagcloud_tags_page_handler

/**
 * Page hander for sitewide tag cloud
 *
 * @param array $page Page array
 *
 * @return bool
 */
function tagcloud_tags_page_handler($page)
{
    $title = elgg_echo('tagcloud:site_cloud');
    $options = array('threshold' => 0, 'limit' => 100, 'tag_name' => 'tags');
    $content = elgg_view_tagcloud($options);
    $body = elgg_view_layout('one_sidebar', array('title' => $title, 'content' => $content));
    echo elgg_view_page($title, $body);
    return true;
}
开发者ID:ibou77,项目名称:elgg,代码行数:16,代码来源:start.php

示例15: hj_framework_page_handlers

/**
 * Page handlers for hypeFramework
 *
 *
 * @param type $page
 * @return type
 */
function hj_framework_page_handlers($page)
{
    if (!isset($page[0])) {
        forward();
    }
    $path_pages = elgg_get_root_path() . 'mod/hypeFramework/pages/';
    switch ($page[0]) {
        case 'edit':
            set_input('guid', $page[1]);
            include $path_pages . 'edit/object.php';
            break;
        case 'icon':
            set_input('guid', $page[1]);
            set_input('size', $page[2]);
            include $path_pages . "icon/icon.php";
            break;
        case 'download':
            set_input('guid', $page[1]);
            include $path_pages . "file/download.php";
            break;
        case 'file':
            switch ($page[1]) {
                case 'create':
                    gatekeeper();
                    $container_guid = elgg_extract(2, $page, false);
                    if (!$container_guid) {
                        $container_guid = elgg_get_logged_in_user_guid();
                    }
                    elgg_set_page_owner_guid($container_guid);
                    set_input('container_guid', $container_guid);
                    include "{$path_pages}create/file.php";
                    break;
                case 'edit':
                    gatekeeper();
                    set_input('guid', $page[2]);
                    include "{$path_pages}edit/object.php";
                    break;
                case 'view':
                    if (!isset($page[2])) {
                        return false;
                    }
                    $entity = get_entity($page[2]);
                    if (!$entity) {
                        return false;
                    }
                    $sidebar = elgg_view('framework/file/dashboard/sidebar', array('entity' => $entity));
                    echo elgg_view_page($entity->title, elgg_view_layout('framework/entity', array('entity' => $entity, 'sidebar' => $sidebar)));
                    break;
            }
            break;
        default:
            return false;
            break;
    }
    return true;
}
开发者ID:amcfarlane1251,项目名称:ongarde,代码行数:63,代码来源:page_handlers.php


注:本文中的elgg_view_page函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。