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


PHP page_owner函数代码示例

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


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

示例1: bookmarks_pagesetup

function bookmarks_pagesetup()
{
    global $CONFIG;
    // Set up menu for logged in users
    //add submenu options
    if (get_context() == "bookmarks") {
        if (isloggedin()) {
            add_submenu_item(elgg_echo('bookmarks:inbox'), $CONFIG->wwwroot . "pg/bookmarks/" . $_SESSION['user']->username . "/inbox");
            if (page_owner()) {
                $page_owner = page_owner_entity();
                add_submenu_item(sprintf(elgg_echo('bookmarks:read'), $page_owner->name), $CONFIG->wwwroot . "pg/bookmarks/" . $page_owner->username . "/items");
            }
            if (!$page_owner instanceof ElggGroup) {
                add_submenu_item(elgg_echo('bookmarks:friends'), $CONFIG->wwwroot . "pg/bookmarks/" . $_SESSION['user']->username . "/friends");
            }
        }
        //if(!$page_owner instanceof ElggGroup)
        //	add_submenu_item(elgg_echo('bookmarks:everyone'),$CONFIG->wwwroot."mod/bookmarks/everyone.php");
        // Bookmarklet
        if (isloggedin() && page_owner() && can_write_to_container(0, page_owner())) {
            $page_owner = page_owner_entity();
            $bmtext = elgg_echo('bookmarks:bookmarklet');
            if ($page_owner instanceof ElggGroup) {
                $bmtext = elgg_echo('bookmarks:bookmarklet:group');
            }
            add_submenu_item($bmtext, $CONFIG->wwwroot . "pg/bookmarks/{$page_owner->username}/bookmarklet");
        }
    }
    $page_owner = page_owner_entity();
    if ($page_owner instanceof ElggGroup && get_context() == 'groups') {
        if ($page_owner->bookmarks_enable != "no") {
            add_submenu_item(sprintf(elgg_echo("bookmarks:group"), $page_owner->name), $CONFIG->wwwroot . "pg/bookmarks/" . $page_owner->username . '/items');
        }
    }
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:35,代码来源:start.php

示例2: file_pagesetup

function file_pagesetup()
{
    // register links --
    global $profile_id;
    global $PAGE;
    global $CFG;
    global $metatags;
    require_once dirname(__FILE__) . "/lib/file_config.php";
    $page_owner = $profile_id;
    if (isloggedin()) {
        if (defined("context") && context == "files" && $page_owner == $_SESSION['userid']) {
            $PAGE->menu[] = array('name' => 'files', 'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/files/\" class=\"selected\" >" . __gettext("Photos") . '</a></li>');
        } else {
            $PAGE->menu[] = array('name' => 'files', 'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/files/\" >" . __gettext("Photos") . '</a></li>');
        }
    }
    if (defined("context") && context == "files") {
        $files_username = user_info('username', $page_owner);
        if ($page_owner != -1) {
            if ($page_owner == $_SESSION['userid'] && $page_owner != -1) {
                $PAGE->menu_sub[] = array('name' => 'file:rss', 'html' => '<a href="' . $CFG->wwwroot . $_SESSION['username'] . '/files/rss/"><img src="' . $CFG->wwwroot . 'mod/template/icons/rss.png" border="0" alt="rss" /></a>');
            }
        }
        if ($page_owner == $_SESSION['userid'] && $page_owner != -1) {
            $PAGE->menu_sub[] = array('name' => 'file:add', 'html' => a_href("{$CFG->wwwroot}{$_SESSION['username']}/files/addphoto", __gettext("Add a Photo")));
        }
        if ($page_owner == $_SESSION['userid'] && $page_owner != -1) {
            $PAGE->menu_sub[] = array('name' => 'file:add', 'html' => a_href("{$CFG->wwwroot}{$_SESSION['username']}/files/addfolder", __gettext("Add a folder")));
        }
    }
    // Adding the file's selector wizard
    $options = array('options' => 'width=600,height=300,left=20,top=20,scrollbars=yes,resizable=yes', 'name' => 'mediapopup', 'url' => $CFG->wwwroot . "mod/file/file_include_wizard.php?owner=" . page_owner());
    add_content_tool_button("mediapopup", __gettext("Add File"), "image.png", "f", $options);
}
开发者ID:BackupTheBerlios,项目名称:tulipan-svn,代码行数:34,代码来源:lib.php

示例3: page_owner_entity

/**
 * Gets the page owner for the current page.
 * @uses $CONFIG
 * @return ElggUser|false The current page owner (false if none).
 */
function page_owner_entity()
{
    global $CONFIG;
    $page_owner = page_owner();
    if ($page_owner > 0) {
        return get_entity($page_owner);
    }
    return false;
}
开发者ID:ashwiniravi,项目名称:Elgg-Social-Network-Single-Sign-on-and-Web-Statistics,代码行数:14,代码来源:pageowner.php

示例4: thewire_pagesetup

function thewire_pagesetup()
{
    global $CONFIG;
    //add submenu options
    if (get_context() == "thewire") {
        if ((page_owner() == $_SESSION['guid'] || !page_owner()) && isloggedin()) {
            add_submenu_item(elgg_echo('thewire:read'), $CONFIG->wwwroot . "pg/thewire/" . $_SESSION['user']->username);
            add_submenu_item(elgg_echo('thewire:everyone'), $CONFIG->wwwroot . "mod/thewire/everyone.php");
            //add_submenu_item(elgg_echo('thewire:add'),$CONFIG->wwwroot."mod/thewire/add.php");
        }
    }
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:12,代码来源:start.php

示例5: blog_pagesetup

function blog_pagesetup()
{
    global $CONFIG;
    //add submenu options
    if (get_context() == "blog") {
        $page_owner = page_owner_entity();
        if ((page_owner() == $_SESSION['guid'] || !page_owner()) && isloggedin()) {
            add_submenu_item(elgg_echo('blog:your'), $CONFIG->wwwroot . "pg/blog/" . $_SESSION['user']->username);
            add_submenu_item(elgg_echo('blog:friends'), $CONFIG->wwwroot . "pg/blog/" . $_SESSION['user']->username . "/friends/");
            add_submenu_item(elgg_echo('blog:everyone'), $CONFIG->wwwroot . "mod/blog/everyone.php");
        } else {
            if (page_owner()) {
                add_submenu_item(sprintf(elgg_echo('blog:user'), $page_owner->name), $CONFIG->wwwroot . "pg/blog/" . $page_owner->username);
                if ($page_owner instanceof ElggUser) {
                    // Sorry groups, this isn't for you.
                    add_submenu_item(sprintf(elgg_echo('blog:user:friends'), $page_owner->name), $CONFIG->wwwroot . "pg/blog/" . $page_owner->username . "/friends/");
                }
                add_submenu_item(elgg_echo('blog:everyone'), $CONFIG->wwwroot . "mod/blog/everyone.php");
            } else {
                add_submenu_item(elgg_echo('blog:everyone'), $CONFIG->wwwroot . "mod/blog/everyone.php");
            }
        }
        if (can_write_to_container(0, page_owner()) && isloggedin()) {
            add_submenu_item(elgg_echo('blog:addpost'), $CONFIG->wwwroot . "pg/blog/{$page_owner->username}/new/");
        }
        if (!defined('everyoneblog') && page_owner()) {
            if ($dates = get_entity_dates('object', 'blog', page_owner())) {
                foreach ($dates as $date) {
                    $timestamplow = mktime(0, 0, 0, substr($date, 4, 2), 1, substr($date, 0, 4));
                    $timestamphigh = mktime(0, 0, 0, (int) substr($date, 4, 2) + 1, 1, substr($date, 0, 4));
                    if (!isset($page_owner)) {
                        $page_owner = page_owner_entity();
                    }
                    $link = $CONFIG->wwwroot . 'pg/blog/' . $page_owner->username . '/archive/' . $timestamplow . '/' . $timestamphigh;
                    add_submenu_item(sprintf(elgg_echo('date:month:' . substr($date, 4, 2)), substr($date, 0, 4)), $link, 'filter');
                }
            }
        }
    }
    // Group submenu
    $page_owner = page_owner_entity();
    if ($page_owner instanceof ElggGroup && get_context() == 'groups') {
        if ($page_owner->blog_enable != "no") {
            add_submenu_item(sprintf(elgg_echo("blog:group"), $page_owner->name), $CONFIG->wwwroot . "pg/blog/" . $page_owner->username);
        }
    }
}
开发者ID:ashwiniravi,项目名称:Elgg-Social-Network-Single-Sign-on-and-Web-Statistics,代码行数:47,代码来源:start.php

示例6: dirname

 * @package ElggProfile
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Curverider Ltd <info@elgg.com>
 * @copyright Curverider Ltd 2008-2009
 * @link http://elgg.com/
 */
// Get the Elgg engine
require_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php";
// If we're not logged on, forward the user elsewhere
if (!isloggedin()) {
    forward();
}
$selected_item;
///
// Get current user for now
if ($user1 = page_owner()) {
    $selected_item = $user1;
    $user = page_owner_entity();
} else {
    $user = $_SESSION['user'];
    if (!$user) {
        $user = get_entity($_SESSION['id']);
    }
    set_page_owner($user->getGUID());
}
// Get form, if we're allowed to edit
//If user allowed to edit
//  OR
//If the content item belongs to the user
$query = "SELECT * FROM {$CONFIG->dbprefix}users_entity join {$CONFIG->dbprefix}_content_item_discrimination on {$CONFIG->dbprefix}users_entity.guid = {$CONFIG->dbprefix}_content_item_discrimination.guid and {$CONFIG->dbprefix}_content_item_discrimination.creator_guid = \"" . $_SESSION['id'] . "\"";
$result = get_data($query);
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:edit.php

示例7: get_input

<?php

/**
 * List a developer's plugins
 */
$type = get_input('type', '');
//$tag = get_input('tag', '');
plugins_add_type_menu(page_owner());
//set the title
$types_string = elgg_echo("plugins:types:{$type}");
if (page_owner() == get_loggedin_userid()) {
    $title = sprintf(elgg_echo('plugins:yours'), $types_string);
} else {
    $title = sprintf(elgg_echo("plugins:user"), page_owner_entity()->name, $types_string);
}
$content = elgg_view_title($title);
//$pop = get_input('pop');
//$area2 = list_entities_from_annotation_count("object", "plugin_project", "download", 10, 0, 0, false, true, false);
// list plugins
set_context('search');
$params = array('types' => 'object', 'subtypes' => 'plugin_project', 'owner_guid' => page_owner(), 'limit' => 10, 'full_view' => FALSE);
if ($type) {
    $params['metadata_name'] = 'plugin_type';
    $params['metadata_value'] = $type;
    $content .= elgg_list_entities_from_metadata($params);
} else {
    $content .= elgg_list_entities($params);
}
$body = elgg_view_layout('two_column_left_sidebar', '', $content);
page_draw($title, $body);
开发者ID:nohup,项目名称:community_plugins,代码行数:30,代码来源:developer.php

示例8: elgg_view

//set some variables
$location = elgg_view("output/tags", array('value' => $user->location));
$section = $vars['section'];
if ($section == 'details') {
    $icon = elgg_view("profile/icon", array('entity' => $user, 'size' => 'large', 'override' => 'true'));
    $icon_class = "large";
} else {
    $icon = elgg_view("profile/icon", array('entity' => $user, 'size' => 'small'));
    $more_info = "<div class='owner_block_contents clearfloat'>";
    $more_info .= "<h3><a href='{$url}'>{$user->name}</a></h3>";
    $more_info .= "<p class='profile_info briefdescription'>{$user->briefdescription}</p>";
    $more_info .= "<p class='profile_info location'>{$location}</p>";
    $more_info .= "</div>";
}
$profile_actions = "";
if (get_loggedin_user()->getGuid() == page_owner()) {
    $profile_actions = "<div class='clearfloat profile_actions'>";
    $profile_actions .= "<a href='{$vars['url']}pg/profile/{$user->username}/edit/details' class='action_button'>Edit profile</a>";
    $profile_actions .= "<a href='{$vars['url']}pg/profile/{$user->username}/edit/icon' class='action_button'>Edit profile icon</a>";
    $profile_actions .= "</div>";
} else {
    $profile_actions = "<div class='profile_actions'>";
    if (isloggedin()) {
        if ($_SESSION['user']->getGUID() != $user->getGUID()) {
            $ts = time();
            $token = generate_action_token($ts);
            if ($user->isFriend()) {
                $profile_actions .= "<a href=\"{$vars['url']}action/friends/remove?friend={$user->getGUID()}&__elgg_token={$token}&__elgg_ts={$ts}\" class='action_button'>" . elgg_echo('friend:remove') . "</a>";
            } else {
                $profile_actions .= "<a href=\"{$vars['url']}action/friends/add?friend={$user->getGUID()}&__elgg_token={$token}&__elgg_ts={$ts}\" class='action_button'>" . elgg_echo('friend:add') . "</a>";
            }
开发者ID:adamboardman,项目名称:Elgg,代码行数:31,代码来源:profile_ownerblock.php

示例9: add_submenu_item

    add_submenu_item(elgg_echo('pages:all'), $CONFIG->wwwroot . "mod/pages/world.php", 'pageslinksgeneral');
}
if ($owner instanceof ElggEntity && can_write_to_container(0, $owner->guid)) {
    add_submenu_item(elgg_echo('pages:new'), $CONFIG->url . "pg/pages/new/?container_guid=" . page_owner(), 'pagesactions');
    if ($owner instanceof ElggUser) {
        add_submenu_item(elgg_echo('pages:welcome'), $CONFIG->url . "pg/pages/welcome/", 'pagesactions');
    }
}
if (is_callable('group_gatekeeper')) {
    group_gatekeeper();
}
$limit = get_input("limit", 10);
$offset = get_input("offset", 0);
if ($owner instanceof ElggGroup) {
    $title = sprintf(elgg_echo("pages:group"), $owner->name);
} else {
    $title = sprintf(elgg_echo("pages:user"), $owner->name);
}
// Get objects
$context = get_context();
set_context('search');
$objects = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'container_guid' => page_owner(), 'limit' => $limit, 'full_view' => FALSE));
set_context($context);
//get the owners latest welcome message
$welcome_message = elgg_get_entities(array('types' => 'object', 'subtypes' => 'pages_welcome', 'owner_guid' => $owner->guid, 'limit' => 1));
$body = elgg_view_title($title);
$body .= elgg_view("pages/welcome", array('entity' => $welcome_message));
$body .= $objects;
$body = elgg_view_layout('two_column_left_sidebar', '', $body);
// Finally draw the page
page_draw($title, $body);
开发者ID:ashwiniravi,项目名称:Elgg-Social-Network-Single-Sign-on-and-Web-Statistics,代码行数:31,代码来源:index.php

示例10: file_submenus

/**
 * Sets up submenus for the file system.  Triggered on pagesetup.
 *
 */
function file_submenus()
{
    global $CONFIG;
    $page_owner = page_owner_entity();
    // Group submenu option
    if ($page_owner instanceof ElggGroup && get_context() == "groups") {
        if ($page_owner->files_enable != "no") {
            add_submenu_item(sprintf(elgg_echo("file:group"), $page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username);
        }
    }
    // General submenu options
    if (get_context() == "file") {
        if ((page_owner() == $_SESSION['guid'] || !page_owner()) && isloggedin()) {
            add_submenu_item(sprintf(elgg_echo("file:yours"), $page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username);
            add_submenu_item(sprintf(elgg_echo('file:yours:friends'), $page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username . "/friends/");
        } else {
            if (page_owner()) {
                add_submenu_item(sprintf(elgg_echo("file:user"), $page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username);
                if ($page_owner instanceof ElggUser) {
                    // This one's for users, not groups
                    add_submenu_item(sprintf(elgg_echo('file:friends'), $page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username . "/friends/");
                }
            }
        }
        add_submenu_item(elgg_echo('file:all'), $CONFIG->wwwroot . "mod/file/world.php");
        if (can_write_to_container($_SESSION['guid'], page_owner())) {
            add_submenu_item(elgg_echo('file:upload'), $CONFIG->wwwroot . "pg/file/" . $page_owner->username . "/new/");
        }
    }
}
开发者ID:eokyere,项目名称:elgg,代码行数:34,代码来源:start.php

示例11: set_page_owner

    } else {
        if ($owner_guid > 0 && !is_array($owner_guid)) {
            set_page_owner($owner_guid);
        }
    }
}
if (is_callable('group_gatekeeper')) {
    group_gatekeeper();
}
if (empty($tag)) {
    $area2 = elgg_view_title(elgg_echo('file:type:all'));
} else {
    if (is_array($owner_guid)) {
        $area2 = elgg_view_title(elgg_echo("file:friends:type:" . $tag));
    } else {
        if (page_owner() && page_owner() != $_SESSION['guid']) {
            $area2 = elgg_view_title(sprintf(elgg_echo("file:user:type:" . $tag), page_owner_entity()->name));
        } else {
            $area2 = elgg_view_title(elgg_echo("file:type:" . $tag));
        }
    }
}
if ($friends) {
    $area1 = get_filetype_cloud($friends, true);
} else {
    if ($owner_guid) {
        $area1 = get_filetype_cloud($owner_guid);
    } else {
        $area1 = get_filetype_cloud();
    }
}
开发者ID:eokyere,项目名称:elgg,代码行数:31,代码来源:search.php

示例12: dirname

<?php

require_once dirname(dirname(__FILE__)) . "/../includes.php";
// Initialise functions for user details, icon management and profile management
run("userdetails:init");
run("profile:init");
run("files:init");
define("context", "file");
templates_page_setup();
$title = user_info("name", page_owner()) . " :: " . __gettext("Add new Photo");
$body = run('photo:add');
templates_page_output($title, $body);
开发者ID:BackupTheBerlios,项目名称:tulipan-svn,代码行数:12,代码来源:photoaddnew.php

示例13: dirname

 * @author Curverider Ltd
 * @copyright Curverider Ltd 2008-2009
 * @link http://elgg.com/
 * 
 * 
 * TODO: File icons, download & mime types
 */
//require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
require_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php";
if (is_callable('group_gatekeeper')) {
    group_gatekeeper();
}
//set the title
if (page_owner() == $_SESSION['user']) {
    $area2 = elgg_view_title($title = elgg_echo('file:yours'));
} else {
    $area2 = elgg_view_title($title = elgg_echo('files'));
}
// Get objects
set_context('search');
$area2 .= list_entities("object", "file", page_owner(), 10);
set_context('file');
$get_filter = get_filetype_cloud(page_owner());
if ($get_filter) {
    $area1 = $get_filter;
} else {
    $area2 .= elgg_view('page_elements/contentwrapper', array('body' => elgg_echo("file:none")));
}
$body = elgg_view_layout('two_column_left_sidebar', $area1, $area2);
// Finally draw the page
page_draw(sprintf(elgg_echo("file:user"), page_owner_entity()->name), $body);
开发者ID:eokyere,项目名称:elgg,代码行数:31,代码来源:index.php

示例14: plugins_add_submenus

/**
 * Sets up submenus. Triggered on pagesetup.
 *
 */
function plugins_add_submenus()
{
    global $CONFIG;
    $plugins_base = "{$CONFIG->wwwroot}pg/plugins";
    if (get_context() == 'admin') {
        $title = elgg_echo("plugins:admin:menu");
        add_submenu_item($title, "{$plugins_base}/admin/");
        return;
    }
    if (get_context() != "plugins") {
        return;
    }
    $page_owner = page_owner_entity();
    if (isloggedin() && page_owner() == get_loggedin_userid()) {
        $title = sprintf(elgg_echo("plugins:yours"), elgg_echo('plugins:types:'));
        add_submenu_item($title, "{$plugins_base}/developer/{$page_owner->username}");
        //add_submenu_item(sprintf(elgg_echo('plugins:yours:friends'),page_owner_entity()->name), $CONFIG->wwwroot . "pg/plugins/". $page_owner->username . "/friends/");
    } else {
        if (page_owner()) {
            $title = sprintf(elgg_echo("plugins:user"), $page_owner->name, elgg_echo('plugins:types:'));
            add_submenu_item($title, "{$plugins_base}/developer/{$page_owner->username}");
            //if ($page_owner instanceof ElggUser) // This one's for users, not groups
            //add_submenu_item(sprintf(elgg_echo('plugins:friends'),$page_owner->name), $CONFIG->wwwroot . "pg/plugins/". $page_owner->username . "/friends/");
        }
    }
    add_submenu_item(elgg_echo('plugins:all'), "{$plugins_base}/all/");
    // add upload link when viewing own plugin page
    if (get_loggedin_userid() == page_owner()) {
        add_submenu_item(elgg_echo('plugins:upload'), "{$plugins_base}/new/project/{$page_owner->username}");
    }
}
开发者ID:nohup,项目名称:community_plugins,代码行数:35,代码来源:start.php

示例15: page_owner

} else {
    // if we are editing video
    $izapLoadedValues = $video->getAttributes();
}
if ($page_owner instanceof ElggGroup) {
    if (!empty($page_owner->group_acl)) {
        $izapLoadedValues->access_id = $page_owner->group_acl;
    }
}
if (is_null($izapLoadedValues->access_id)) {
    $izapLoadedValues->access_id = ACCESS_DEFAULT;
}
if ($video->converted == 'no' && $video->videotype == 'uploaded') {
    $remove_access_id = TRUE;
}
$izapLoadedValues->container_guid = page_owner();
?>
<div class="contentWrapper">
  <?php 
echo $tabs;
?>

  <form action="<?php 
echo $vars['url'];
?>
action/izapAddEdit" method="POST" enctype="multipart/form-data" id="video_form" >

    <?php 
echo $modular_form;
?>
    <div id="extra_form">
开发者ID:rimpy,项目名称:izap_videos,代码行数:31,代码来源:_partial.php


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