• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP isloggedin函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: admin_pagesetup

function admin_pagesetup()
{
    global $PAGE, $CFG;
    /*
        if (isadmin()) {
            $PAGE->menu_top [] = array( 'name' => 'admin',
                                        //'html' => a_href("{$CFG->wwwroot}_admin/",
                                        //                "Administration"));
                                        'html' => "<li><a href=\"" . $CFG->wwwroot . "mod/admin/\">" . __gettext("Administration") . "</a></li>");
        }
    */
    if (defined("context") && context == "account") {
        $PAGE->menu_sub[] = array('name' => 'user:edit', 'html' => a_href("{$CFG->wwwroot}_userdetails/", __gettext("Edit user details")));
        /*$PAGE->menu_sub[] = array (
        		'name' => 'user:icon',
        		'html' => a_href("{$CFG->wwwroot}_icons/",__gettext("Your site picture")));*/
    }
    if (defined("context") && context == "admin" && isloggedin() && user_flag_get("admin", $_SESSION['userid'])) {
        $PAGE->menu_sub[] = array('name' => 'admin', 'html' => a_href(get_url(-1, 'admin::main'), __gettext("Main")));
        $PAGE->menu_sub[] = array('name' => 'admin:users:add', 'html' => a_href(get_url(-1, 'admin::users::add'), __gettext("Add users")));
        $PAGE->menu_sub[] = array('name' => 'admin:users', 'html' => a_href(get_url(-1, 'admin::users'), __gettext("Manage users")));
        $PAGE->menu_sub[] = array('name' => 'admin:users:banned', 'html' => a_href(get_url(-1, 'admin::users::banned'), __gettext("Banned users")));
        $PAGE->menu_sub[] = array('name' => 'admin:users:admin', 'html' => a_href(get_url(-1, 'admin::users::admin'), __gettext("Admin users")));
        $PAGE->menu_sub[] = array('name' => 'admin:flags', 'html' => a_href(get_url(-1, 'admin::flags'), __gettext("Manage flagged content")));
        $PAGE->menu_sub[] = array('name' => 'admin:spam', 'html' => a_href(get_url(-1, 'admin::spam'), __gettext("Spam control")));
    }
}
开发者ID:BackupTheBerlios,项目名称:tulipan-svn,代码行数:27,代码来源:lib.php


示例2: 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


示例3: 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


示例4: 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


示例5: ajaxenabled

/**
 * Returns whether ajax is enabled/allowed or not.
 * @param array $browsers optional list of alowed browsers, empty means use default list
 * @return bool
 */
function ajaxenabled(array $browsers = null)
{
    global $CFG, $USER;
    if (!empty($browsers)) {
        $valid = false;
        foreach ($browsers as $brand => $version) {
            if (check_browser_version($brand, $version)) {
                $valid = true;
            }
        }
        if (!$valid) {
            return false;
        }
    }
    $ie = check_browser_version('MSIE', 6.0);
    $ff = check_browser_version('Gecko', 20051106);
    $op = check_browser_version('Opera', 9.0);
    $sa = check_browser_version('Safari', 412);
    if (!$ie && !$ff && !$op && !$sa) {
        /** @see http://en.wikipedia.org/wiki/User_agent */
        // Gecko build 20051107 is what is in Firefox 1.5.
        // We still have issues with AJAX in other browsers.
        return false;
    }
    if (!empty($CFG->enableajax) && (!empty($USER->ajax) || !isloggedin())) {
        return true;
    } else {
        return false;
    }
}
开发者ID:vuchannguyen,项目名称:web,代码行数:35,代码来源:ajaxlib.php


示例6: blog_get_page_content_read

/**
 * Returns HTML for a blog post.
 *
 * @param int $guid of a blog entity.
 * @return string html
 */
function blog_get_page_content_read($owner_guid = NULL, $guid = NULL)
{
    $content = elgg_view('page_elements/content_header', array('context' => $context, 'type' => 'blog'));
    if ($guid) {
        $blog = get_entity($guid);
        if (!elgg_instanceof($blog, 'object', 'blog') && $blog->status == 'final') {
            $content .= elgg_echo('blog:error:post_not_found');
        } else {
            elgg_push_breadcrumb($blog->title, $blog->getURL());
            $content .= elgg_view_entity($blog, TRUE);
        }
    } else {
        $options = array('type' => 'object', 'subtype' => 'blog', 'full_view' => FALSE, 'order_by_metadata' => array('name' => 'publish_date', 'direction' => 'DESC', 'as' => 'int'));
        if ($owner_guid) {
            $options['owner_guid'] = $owner_guid;
        }
        // show all posts for admin or users looking at their own blogs
        // show only published posts for other users.
        if (!(isadminloggedin() || isloggedin() && $owner_guid == get_loggedin_userid())) {
            $options['metadata_name_value_pairs'] = array(array('name' => 'status', 'value' => 'published'), array('name' => 'publish_date', 'operand' => '<', 'value' => time()));
        }
        $content .= elgg_list_entities_from_metadata($options);
    }
    return array('content' => $content);
}
开发者ID:adamboardman,项目名称:Elgg,代码行数:31,代码来源:blog_lib.php


示例7: toolbar_mainbody

function toolbar_mainbody($vars)
{
    global $CFG;
    require_once $CFG->dirroot . 'lib/filelib.php';
    // to ensure file_get_contents()
    if (isloggedin()) {
        $toolbar = file_get_contents($CFG->dirroot . "mod/toolbar/toolbar.inc");
    } else {
        //$toolbar = file_get_contents($CFG->dirroot . "mod/toolbar/toolbarloggedout.inc");
    }
    if (isset($vars[1]) && $vars[1] == 'box') {
        $css = file_get_contents($CFG->dirroot . "mod/toolbar/css-box");
    } else {
        $css = file_get_contents($CFG->dirroot . "mod/toolbar/css");
    }
    $css = str_replace("{{url}}", $CFG->wwwroot, $css);
    $toolbar .= "{$css}";
    $toolbar = str_replace("{{url}}", $CFG->wwwroot, $toolbar);
    $toolbar = str_replace("{{menu}}", templates_variables_substitute(array(array(), "menu")), $toolbar);
    $toolbar = str_replace("{{topmenu}}", templates_variables_substitute(array(array(), "topmenu")), $toolbar);
    $toolbar = str_replace("{{logon}}", __gettext("Log on:"), $toolbar);
    $toolbar = str_replace("{{username}}", __gettext("Username"), $toolbar);
    $toolbar = str_replace("{{password}}", __gettext("Password"), $toolbar);
    $toolbar = str_replace("{{poweredby}}", __gettext("Powered by Elgg"), $toolbar);
    $toolbar = str_replace("{{remember}}", __gettext("Remember me"), $toolbar);
    if (isloggedin()) {
        $toolbar = str_replace("{{usericon}}", "<a href=\"{$CFG->wwwroot}{$_SESSION['username']}\">" . user_icon_html($_SESSION['userid'], 50) . "</a>", $toolbar);
    } else {
        $toolbar = str_replace("{{usericon}}", user_icon_html(-1, 50), $toolbar);
    }
    return $toolbar;
}
开发者ID:BackupTheBerlios,项目名称:tulipan-svn,代码行数:32,代码来源:lib.php


示例8: navbuttons_activity_showbuttons

/**
 * Check if an activity is configured to only show navbuttons when
 * complete and then check if the activity is complete
 * @param cm_info $cm the course module for the activity
 * @return boolean true if the navbuttons should be shown
 */
function navbuttons_activity_showbuttons($cm)
{
    $modname = $cm->modname;
    $show = get_config('block_navbuttons', 'activity' . $modname);
    if ($show === false || $show == NAVBUTTONS_ACTIVITY_ALWAYS) {
        return true;
        // No config or 'always show'
    }
    if ($show == NAVBUTTONS_ACTIVITY_NEVER) {
        return false;
    }
    if ($show == NAVBUTTONS_ACTIVITY_COMPLETE) {
        $completion = new completion_info($cm->get_course());
        if (!$completion->is_enabled($cm)) {
            return true;
            // No completion tracking - show the buttons
        }
        $cmcompletion = $completion->get_data($cm);
        if ($cmcompletion->completionstate == COMPLETION_INCOMPLETE) {
            return false;
        }
        return true;
    }
    if (!isloggedin() || isguestuser()) {
        return true;
        // Always show the buttons if not logged in
    }
    // NAVBUTTONS_ACTIVITY_CUSTOM
    $funcname = 'navbuttons_mod_' . $modname . '_showbuttons';
    if (!function_exists($funcname)) {
        return true;
        // Shouldn't have got to here, but allow the buttons anyway
    }
    return $funcname($cm);
}
开发者ID:kbwebsolutions,项目名称:moodle-navbuttons,代码行数:41,代码来源:activityready.php


示例9: get_content

    function get_content() {
        global $CFG;
        if ($this->content !== NULL) {
            return $this->content;
        }
		if(!isloggedin()){
			return $this->content;
		}
		//if(is_siteadmin()){
		//	return $this->content;
		//}
		//if(has_capability('local_collegestructure:manage', context_system::instance())){
		//	return $this->content;
		//}

      
        // Prep the content
        $this->content = new stdClass();
		require_once('events.php');
		$events = get_events();
        $this->content->text = $events;
        return $this->content;
        // Prepare the footer for this block
        // No footer to display
        $this->content->footer = '';
		// Return the content object
        return $this->content;
    }
开发者ID:anilch,项目名称:Personel,代码行数:28,代码来源:block_events.php


示例10: get_content

 function get_content()
 {
     if ($this->content !== NULL) {
         return $this->content;
     }
     if (empty($this->instance)) {
         return null;
     }
     $this->content->footer = '';
     $this->content->text = '';
     if (isloggedin() && !isguestuser()) {
         // Show the block
         $cmt = new stdclass();
         $cmt->context = $this->instance->context;
         $cmt->area = 'block_comments';
         $cmt->itemid = $this->instance->id;
         $cmt->course = $this->page->course;
         // this is a hack to adjust commenting UI
         // in block_comments
         $cmt->env = 'block_comments';
         $cmt->linktext = get_string('showcomments');
         $comment = new comment($cmt);
         $this->content = new stdClass();
         $this->content->text = $comment->init(true);
         $this->content->footer = '';
     }
     return $this->content;
 }
开发者ID:ajv,项目名称:Offline-Caching,代码行数:28,代码来源:block_comments.php


示例11: 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


示例12: get_content

 function get_content()
 {
     global $CFG, $USER, $DB, $OUTPUT;
     // shortcut -  only for logged in users!
     if (!isloggedin() || isguestuser()) {
         return false;
     }
     // according to start_jump_session,
     // remote users can't on-jump
     // so don't show this block to them
     if (is_mnet_remote_user($USER)) {
         if (debugging() and !empty($CFG->debugdisplay)) {
             $this->content = new stdClass();
             $this->content->footer = html_writer::tag('span', get_string('error_localusersonly', 'block_mnet_hosts'), array('class' => 'error'));
             return $this->content;
         } else {
             return '';
         }
     }
     if (!is_enabled_auth('mnet')) {
         if (debugging() and !empty($CFG->debugdisplay)) {
             $this->content = new stdClass();
             $this->content->footer = html_writer::tag('span', get_string('error_authmnetneeded', 'block_mnet_hosts'), array('class' => 'error'));
             return $this->content;
         } else {
             return '';
         }
     }
     if (!has_capability('moodle/site:mnetlogintoremote', get_context_instance(CONTEXT_SYSTEM), NULL, false)) {
         if (debugging() and !empty($CFG->debugdisplay)) {
             $this->content = new stdClass();
             $this->content->footer = html_writer::tag('span', get_string('error_roamcapabilityneeded', 'block_mnet_hosts'), array('class' => 'error'));
             return $this->content;
         } else {
             return '';
         }
     }
     if ($this->content !== NULL) {
         return $this->content;
     }
     // TODO: Test this query - it's appropriate? It works?
     // get the hosts and whether we are doing SSO with them
     $sql = "\n             SELECT DISTINCT\n                 h.id,\n                 h.name,\n                 h.wwwroot,\n                 a.name as application,\n                 a.display_name\n             FROM\n                 {mnet_host} h,\n                 {mnet_application} a,\n                 {mnet_host2service} h2s_IDP,\n                 {mnet_service} s_IDP,\n                 {mnet_host2service} h2s_SP,\n                 {mnet_service} s_SP\n             WHERE\n                 h.id <> ? AND\n                 h.id <> ? AND\n                 h.id = h2s_IDP.hostid AND\n                 h.deleted = 0 AND\n                 h.applicationid = a.id AND\n                 h2s_IDP.serviceid = s_IDP.id AND\n                 s_IDP.name = 'sso_idp' AND\n                 h2s_IDP.publish = '1' AND\n                 h.id = h2s_SP.hostid AND\n                 h2s_SP.serviceid = s_SP.id AND\n                 s_SP.name = 'sso_idp' AND\n                 h2s_SP.publish = '1'\n             ORDER BY\n                 a.display_name,\n                 h.name";
     $hosts = $DB->get_records_sql($sql, array($CFG->mnet_localhost_id, $CFG->mnet_all_hosts_id));
     $this->content = new stdClass();
     $this->content->items = array();
     $this->content->icons = array();
     $this->content->footer = '';
     if ($hosts) {
         foreach ($hosts as $host) {
             $icon = '<img src="' . $OUTPUT->pix_url('i/' . $host->application . '_host') . '"' . ' class="icon" alt="' . get_string('server', 'block_mnet_hosts') . '" />&nbsp;';
             if ($host->id == $USER->mnethostid) {
                 $this->content->items[] = "<a title=\"" . s($host->name) . "\" href=\"{$host->wwwroot}\">" . $icon . s($host->name) . "</a>";
             } else {
                 $this->content->items[] = "<a title=\"" . s($host->name) . "\" href=\"{$CFG->wwwroot}/auth/mnet/jump.php?hostid={$host->id}\">" . $icon . s($host->name) . "</a>";
             }
         }
     }
     return $this->content;
 }
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:60,代码来源:block_mnet_hosts.php


示例13: render_custom_menu

 /**
  * Renders a custom menu object (located in outputcomponents.php)
  *
  * The custom menu this method override the render_custom_menu function
  * in outputrenderers.php
  * @staticvar int $menucount
  * @param custom_menu $menu
  * @return string
  */
 protected function render_custom_menu(custom_menu $menu)
 {
     // Generate custom My Courses dropdown.
     $mycourses = $this->page->navigation->get('mycourses');
     $mycoursetitle = $this->page->theme->settings->mycoursetitle;
     if (isloggedin() && $mycourses && $mycourses->has_children()) {
         $branchurl = new moodle_url('/my/index.php');
         $branchsort = 10000;
         if ($mycoursetitle == 'module') {
             $branchlabel = get_string('mymodules', 'theme_rocket');
         } else {
             if ($mycoursetitle == 'unit') {
                 $branchlabel = get_string('myunits', 'theme_rocket');
             } else {
                 if ($mycoursetitle == 'class') {
                     $branchlabel = get_string('myclasses', 'theme_rocket');
                 } else {
                     $branchlabel = get_string('mycourses', 'theme_rocket');
                 }
             }
         }
         $branchtitle = $branchlabel;
         $branch = $menu->add($branchlabel, $branchurl, $branchtitle, $branchsort);
         foreach ($mycourses->children as $coursenode) {
             $branch->add($coursenode->get_content(), $coursenode->action, $coursenode->get_title());
         }
     } else {
         if ($mycoursetitle == 'module') {
             $branchlabel = get_string('allmodules', 'theme_rocket');
         } else {
             if ($mycoursetitle == 'unit') {
                 $branchlabel = get_string('allunits', 'theme_rocket');
             } else {
                 if ($mycoursetitle == 'class') {
                     $branchlabel = get_string('allclasses', 'theme_rocket');
                 } else {
                     $branchlabel = get_string('allcourses', 'theme_rocket');
                 }
             }
         }
         $branchtitle = $branchlabel;
         $branchurl = new moodle_url('/course/index.php');
         $branchsort = 10000;
         $branch = $menu->add($branchlabel, $branchurl, $branchtitle, $branchsort);
     }
     // If the menu has no children return an empty string.
     if (!$menu->has_children()) {
         return '';
     }
     // Initialise this custom menu.
     $content = html_writer::start_tag('ul', array('class' => 'dropdown dropdown-horizontal'));
     // Render each child.
     foreach ($menu->get_children() as $item) {
         $content .= $this->render_custom_menu_item($item);
     }
     // Close the open tags.
     $content .= html_writer::end_tag('ul');
     // Return the custom menu.
     return $content;
 }
开发者ID:Herrerapan,项目名称:moodle-theme_rocket,代码行数:69,代码来源:renderers.php


示例14: local_obu_apps_extend_navigation

/**
 * OBU Apps - Provide left hand navigation links
 *
 * @package    obu_apps
 * @category   local
 * @copyright  2015, Oxford Brookes University {@link http://www.brookes.ac.uk/}
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
function local_obu_apps_extend_navigation($navigation)
{
    global $CFG;
    if (!isloggedin() || isguestuser()) {
        return;
    }
    // Find the 'apps' node
    $nodeApps = $navigation->find(get_string('apps', 'local_obu_apps'), navigation_node::TYPE_SYSTEM);
    // If necessary, add the 'apps' node to 'home'
    if (!$nodeApps) {
        $nodeHome = $navigation->children->get('1')->parent;
        if ($nodeHome) {
            $nodeApps = $nodeHome->add(get_string('apps', 'local_obu_apps'), null, navigation_node::TYPE_SYSTEM);
        }
    }
    if ($nodeApps) {
        // BRISC
        if (get_config('local_obu_apps', 'showbrisc') == '1' && has_capability('moodle/blog:create', context_system::instance())) {
            $nodeApps->add('BRISC', '/local/obu_apps/brisc.php');
            // BRISC web app
        }
        // QuAK
        if (get_config('local_obu_apps', 'showquak') == '1' && !empty($CFG->navadduserpostslinks)) {
            $nodeApps->add('QuAK', '/local/obu_apps/quak.php');
            // QuAK web app
        }
        // Polls
        if (get_config('local_obu_apps', 'showpolls') == '1') {
            $nodeApps->add('polls.brookes', '/local/obu_apps/polls.php');
            // Polls web app
        }
    }
}
开发者ID:OBU-OBIS,项目名称:moodle-local_obu_apps,代码行数:41,代码来源:lib.php


示例15: newsclient_pagesetup

function newsclient_pagesetup()
{
    // register links --
    global $profile_id;
    global $PAGE;
    global $CFG;
    $page_owner = $profile_id;
    $rss_username = user_info('username', $page_owner);
    if (isloggedin()) {
        /*if (defined("context") && context == "resources" && $page_owner == $_SESSION['userid']) {
              $PAGE->menu[] = array( 'name' => 'feeds',
                                     'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/feeds/\" class=\"selected\" >" .__gettext("Your Resources").'</a></li>');
          } else {
              $PAGE->menu[] = array( 'name' => 'feeds',
                                     'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/feeds/\" >" .__gettext("Your Resources").'</a></li>');
          }*/
    }
    if (defined("context") && context == "resources") {
        if ($page_owner != -1) {
            $PAGE->menu_sub[] = array('name' => 'newsfeed:subscription', 'html' => a_href($CFG->wwwroot . $rss_username . "/feeds/", __gettext("Feeds")));
            if (permissions_check("profile", $page_owner) && isloggedin()) {
                $PAGE->menu_sub[] = array('name' => 'newsfeed:subscription:publish:blog', 'html' => a_href($CFG->wwwroot . "_rss/blog.php?profile_name=" . user_info("username", $page_owner), __gettext("Publish to blog")));
            }
            $PAGE->menu_sub[] = array('name' => 'newsclient', 'html' => a_href($CFG->wwwroot . $rss_username . "/feeds/all/", __gettext("View aggregator")));
        }
        $PAGE->menu_sub[] = array('name' => 'feed', 'html' => a_href($CFG->wwwroot . "_rss/popular.php", __gettext("Popular Feeds")));
        /*
        $PAGE->menu_sub[] = array( 'name' => 'feed',
                                   'html' => a_href( $CFG->wwwroot."help/feeds_help.php",
                                                      "Page help"));
        */
    }
}
开发者ID:BackupTheBerlios,项目名称:tulipan-svn,代码行数:33,代码来源:lib.php


示例16: get_content

 function get_content()
 {
     global $CFG, $USER;
     if ($this->content !== NULL) {
         return $this->content;
     }
     $content = '';
     $footer = '';
     $nologin_auths = block_repository_nopasswd_auths();
     if (!empty($USER->auth) && in_array($USER->auth, $nologin_auths)) {
         return '';
     }
     if (isloggedin() && file_exists($CFG->dirroot . '/file/repository/alfresco/repository.php')) {
         require_once $CFG->dirroot . '/file/repository/repository.class.php';
         if (isset($CFG->repository_plugins_enabled) && strstr($CFG->repository_plugins_enabled, 'alfresco')) {
             if ($repo = repository_factory::factory('alfresco')) {
                 if ($repo->alfresco_userdir($USER->username) !== false) {
                     // Fix username
                     $username = repository_plugin_alfresco::fix_username($USER->username);
                     // So that we don't conflict with the default Alfresco admin account.
                     $username = $username == 'admin' ? $CFG->repository_alfresco_admin_username : $username;
                     $hastenant = false;
                     // We must include the tenant portion of the username here.
                     if (($tenantname = strpos($CFG->repository_alfresco_server_username, '@')) > 0) {
                         $username .= substr($CFG->repository_alfresco_server_username, $tenantname);
                         $hastenant = true;
                     }
                     // Display a link to access the Alfresco repository directly.
                     $content .= get_string('webappaccess', 'block_repository', $repo->get_webapp_url()) . '<br /><br />';
                     // Display a link to the configured embedded WebDAV client (if defined).
                     if (!empty($CFG->block_course_repository_webdav_client)) {
                         $content .= get_string('embeddedwebdavlink', 'block_repository', $CFG->block_course_repository_webdav_client) . '<br /><br />';
                     }
                     if ($hastenant || $username != $USER->username) {
                         $content .= get_string('usernametenantinfo', 'block_repository', $username);
                     } else {
                         $content .= get_string('usernameinfo', 'block_repository', $username);
                     }
                     // Display a link to defined help files
                     if (!empty($CFG->block_course_repository_help_link)) {
                         $footer = get_string('helpfileslink', 'block_repository', $CFG->block_course_repository_help_link);
                     }
                 }
             }
         }
     }
     // If there is no content and the current user can actually modify the site settings, display some text
     // in the block explaining what is happening.
     if (empty($content) && has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
         if (file_exists($CFG->dirroot . '/admin/file/repositories.php')) {
             $content = get_string('alfresconotconfigured', 'block_repository', $CFG->wwwroot . '/admin/file/' . 'repositories.php');
         } else {
             $content = get_string('norepositorypluginsystem', 'block_repository');
         }
     }
     $this->content = new stdClass();
     $this->content->text = $content;
     $this->content->footer = $footer;
     return $this->content;
 }
开发者ID:remotelearner,项目名称:elis.alfresco,代码行数:60,代码来源:block_repository.php


示例17: newsclient_pagesetup

function newsclient_pagesetup()
{
    // register links --
    global $profile_id;
    global $PAGE;
    global $CFG;
    $page_owner = $profile_id;
    if (isloggedin() && $CFG->your_resources_enabled) {
        if (defined("context") && context == "resources" && $page_owner == $_SESSION['userid']) {
            $PAGE->menu[] = array('name' => 'resources', 'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/feeds/\" class=\"selected\" >" . gettext("Your Resources") . '</a></li>');
        } else {
            $PAGE->menu[] = array('name' => 'resources', 'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/feeds/\" >" . gettext("Your Resources") . '</a></li>');
        }
        $rss_username = run("users:id_to_name", $page_owner);
    }
    if (defined("context") && context == "resources" && $CFG->your_resources_enabled) {
        if ($page_owner != -1) {
            if (run("permissions:check", "rss") && logged_on && $page_owner == $_SESSION['userid']) {
                $PAGE->menu_sub[] = array('name' => 'newsfeed:subscription', 'html' => a_hrefg($CFG->wwwroot . $_SESSION['username'] . "/feeds/", gettext("Feeds")));
                $PAGE->menu_sub[] = array('name' => 'newsfeed:subscription:publish:blog', 'html' => a_hrefg($CFG->wwwroot . "_rss/blog.php?page_owner=" . $_SESSION['userid'], gettext("Publish to blog")));
            }
            $PAGE->menu_sub[] = array('name' => 'newsclient', 'html' => a_hrefg($CFG->wwwroot . $rss_username . "/feeds/all/", gettext("View aggregator")));
        }
        $PAGE->menu_sub[] = array('name' => 'feed', 'html' => a_hrefg($CFG->wwwroot . "_rss/popular.php", gettext("Popular Feeds")));
        /*
        $PAGE->menu_sub[] = array( 'name' => 'feed',
                                   'html' => a_hrefg( $CFG->wwwroot."help/feeds_help.php", 
                                                      "Page help"));
        */
    }
}
开发者ID:pzingg,项目名称:saugus_elgg,代码行数:31,代码来源:lib.php


示例18: get_content

 function get_content()
 {
     global $THEME, $CFG, $USER;
     // only for logged in users!
     if (!isloggedin() || isguest()) {
         return false;
     }
     // check for outgoing roaming permission first
     if (!has_capability('moodle/site:mnetlogintoremote', get_context_instance(CONTEXT_SYSTEM), NULL, false)) {
         return '';
     }
     if ($this->content !== NULL) {
         return $this->content;
     }
     // TODO: Test this query - it's appropriate? It works?
     // get the hosts and whether we are doing SSO with them
     $sql = "\n             SELECT DISTINCT \n                 h.id, \n                 h.name,\n                 h.wwwroot,\n                 a.name as application,\n                 a.display_name\n             FROM \n                 {$CFG->prefix}mnet_host h,\n                 {$CFG->prefix}mnet_application a,\n                 {$CFG->prefix}mnet_host2service h2s_IDP,\n                 {$CFG->prefix}mnet_service s_IDP,\n                 {$CFG->prefix}mnet_host2service h2s_SP,\n                 {$CFG->prefix}mnet_service s_SP\n             WHERE\n                 h.id != '{$CFG->mnet_localhost_id}' AND\n                 h.id = h2s_IDP.hostid AND\n                 h.applicationid = a.id AND\n                 h2s_IDP.serviceid = s_IDP.id AND\n                 s_IDP.name = 'sso_idp' AND\n                 h2s_IDP.publish = '1' AND\n                 h.id = h2s_SP.hostid AND\n                 h2s_SP.serviceid = s_SP.id AND\n                 s_SP.name = 'sso_idp' AND\n                 h2s_SP.publish = '1'\n             ORDER BY\n                 a.display_name,\n                 h.name";
     $hosts = get_records_sql($sql);
     $this->content = new stdClass();
     $this->content->items = array();
     $this->content->icons = array();
     $this->content->footer = '';
     if ($hosts) {
         foreach ($hosts as $host) {
             $icon = '<img src="' . $CFG->pixpath . '/i/' . $host->application . '_host.gif"' . ' class="icon" alt="' . get_string('server', 'block_mnet_hosts') . '" />';
             $this->content->icons[] = $icon;
             if ($host->id == $USER->mnethostid) {
                 $this->content->items[] = "<a title=\"" . s($host->name) . "\" href=\"{$host->wwwroot}\">" . s($host->name) . "</a>";
             } else {
                 $this->content->items[] = "<a title=\"" . s($host->name) . "\" href=\"{$CFG->wwwroot}/auth/mnet/jump.php?hostid={$host->id}\">" . s($host->name) . "</a>";
             }
         }
     }
     return $this->content;
 }
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:35,代码来源:block_mnet_hosts.php


示例19: get_area_backup_course

 /**
  * Gets a stored file for the backup course filearea directory.
  *
  * @param int $itemid item ID
  * @param string $filepath file path
  * @param string $filename file name
  * @return file_info|null file_i 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP islogin函数代码示例发布时间:2022-05-15
下一篇:
PHP isimplexml_load_string函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap