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

PHP url_get_full_url函数代码示例

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

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



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

示例1: url_display_embed

/**
 * Display embedded url file.
 * @param object $url
 * @param object $cm
 * @param object $course
 * @return does not return
 */
function url_display_embed($url, $cm, $course)
{
    global $CFG, $PAGE, $OUTPUT;
    $mimetype = resourcelib_guess_url_mimetype($url->externalurl);
    $fullurl = url_get_full_url($url, $cm, $course);
    $title = $url->name;
    $link = html_writer::tag('a', $fullurl, array('href' => str_replace('&', '&', $fullurl)));
    $clicktoopen = get_string('clicktoopen', 'url', $link);
    $moodleurl = new moodle_url($fullurl);
    $extension = resourcelib_get_extension($url->externalurl);
    $mediamanager = core_media_manager::instance();
    $embedoptions = array(core_media_manager::OPTION_TRUSTED => true, core_media_manager::OPTION_BLOCK => true);
    if (in_array($mimetype, array('image/gif', 'image/jpeg', 'image/png'))) {
        // It's an image
        $code = resourcelib_embed_image($fullurl, $title);
    } else {
        if ($mediamanager->can_embed_url($moodleurl, $embedoptions)) {
            // Media (audio/video) file.
            $code = $mediamanager->embed_url($moodleurl, $title, 0, 0, $embedoptions);
        } else {
            // anything else - just try object tag enlarged as much as possible
            $code = resourcelib_embed_general($fullurl, $title, $clicktoopen, $mimetype);
        }
    }
    url_print_header($url, $cm, $course);
    url_print_heading($url, $cm, $course);
    echo $code;
    url_print_intro($url, $cm, $course);
    echo $OUTPUT->footer();
    die;
}
开发者ID:lucaboesch,项目名称:moodle,代码行数:38,代码来源:locallib.php


示例2: url_export_contents

/**
 * Export URL resource contents
 *
 * @return array of file content
 */
function url_export_contents($cm, $baseurl)
{
    global $CFG, $DB;
    require_once "{$CFG->dirroot}/mod/url/locallib.php";
    $contents = array();
    $context = get_context_instance(CONTEXT_MODULE, $cm->id);
    $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
    $url = $DB->get_record('url', array('id' => $cm->instance), '*', MUST_EXIST);
    $fullurl = str_replace('&', '&', url_get_full_url($url, $cm, $course));
    $isurl = clean_param($fullurl, PARAM_URL);
    if (empty($isurl)) {
        return null;
    }
    $url = array();
    $url['type'] = 'url';
    $url['filename'] = $url->name;
    $url['filepath'] = null;
    $url['filesize'] = 0;
    $url['fileurl'] = $fullurl;
    $url['timecreated'] = null;
    $url['timemodified'] = $url->timemodified;
    $url['sortorder'] = null;
    $url['userid'] = null;
    $url['author'] = null;
    $url['license'] = null;
    $contents[] = $url;
    return $contents;
}
开发者ID:nmicha,项目名称:moodle,代码行数:33,代码来源:lib.php


示例3: url_display_embed

/**
 * Display embedded url file.
 * @param object $url
 * @param object $cm
 * @param object $course
 * @param stored_file $file main file
 * @return does not return
 */
function url_display_embed($url, $cm, $course)
{
    global $CFG, $PAGE, $OUTPUT;
    $mimetype = resourcelib_guess_url_mimetype($url->externalurl);
    $fullurl = url_get_full_url($url, $cm, $course);
    $title = $url->name;
    $link = html_writer::tag('a', $fullurl, array('href' => str_replace('&', '&', $fullurl)));
    $clicktoopen = get_string('clicktoopen', 'url', $link);
    $extension = resourcelib_get_extension($url->externalurl);
    if (in_array($mimetype, array('image/gif', 'image/jpeg', 'image/png'))) {
        // It's an image
        $code = resourcelib_embed_image($fullurl, $title);
    } else {
        if ($mimetype == 'audio/mp3') {
            // MP3 audio file
            $code = resourcelib_embed_mp3($fullurl, $title, $clicktoopen);
        } else {
            if ($mimetype == 'video/x-flv' or $extension === 'f4v') {
                // Flash video file
                $code = resourcelib_embed_flashvideo($fullurl, $title, $clicktoopen);
            } else {
                if ($mimetype == 'application/x-shockwave-flash') {
                    // Flash file
                    $code = resourcelib_embed_flash($fullurl, $title, $clicktoopen);
                } else {
                    if (substr($mimetype, 0, 10) == 'video/x-ms') {
                        // Windows Media Player file
                        $code = resourcelib_embed_mediaplayer($fullurl, $title, $clicktoopen);
                    } else {
                        if ($mimetype == 'video/quicktime') {
                            // Quicktime file
                            $code = resourcelib_embed_quicktime($fullurl, $title, $clicktoopen);
                        } else {
                            if ($mimetype == 'video/mpeg') {
                                // Mpeg file
                                $code = resourcelib_embed_mpeg($fullurl, $title, $clicktoopen);
                            } else {
                                if ($mimetype == 'audio/x-pn-realaudio-plugin') {
                                    // RealMedia file
                                    $code = resourcelib_embed_real($fullurl, $title, $clicktoopen);
                                } else {
                                    // anything else - just try object tag enlarged as much as possible
                                    $code = resourcelib_embed_general($fullurl, $title, $clicktoopen, $mimetype);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    url_print_header($url, $cm, $course);
    url_print_heading($url, $cm, $course);
    echo $code;
    url_print_intro($url, $cm, $course);
    echo $OUTPUT->footer();
    die;
}
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:66,代码来源:locallib.php


示例4: get_coursemodule_from_instance

    $cm = get_coursemodule_from_instance('url', $url->id, $url->course, false, MUST_EXIST);
} else {
    $cm = get_coursemodule_from_id('url', $id, 0, false, MUST_EXIST);
    $url = $DB->get_record('url', array('id' => $cm->instance), '*', MUST_EXIST);
}
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
require_course_login($course, true, $cm);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
require_capability('mod/url:view', $context);
add_to_log($course->id, 'url', 'view', 'view.php?id=' . $cm->id, $url->id, $cm->id);
// Update 'viewed' state if required by completion system
$completion = new completion_info($course);
$completion->set_module_viewed($cm);
$PAGE->set_url('/mod/url/view.php', array('id' => $cm->id));
if ($redirect) {
    // coming from course page or url index page,
    // the redirection is needed for completion tracking and logging
    $fullurl = url_get_full_url($url, $cm, $course);
    redirect(str_replace('&', '&', $fullurl));
}
switch (url_get_final_display_type($url)) {
    case RESOURCELIB_DISPLAY_EMBED:
        url_display_embed($url, $cm, $course);
        break;
    case RESOURCELIB_DISPLAY_FRAME:
        url_display_frame($url, $cm, $course);
        break;
    default:
        url_print_workaround($url, $cm, $course);
        break;
}
开发者ID:vuchannguyen,项目名称:web,代码行数:31,代码来源:view.php


示例5: unset

}
unset($exturl);

$displaytype = url_get_final_display_type($url);
if ($displaytype == RESOURCELIB_DISPLAY_OPEN) {
    // For 'open' links, we always redirect to the content - except if the user
    // just chose 'save and display' from the form then that would be confusing
    if (!isset($_SERVER['HTTP_REFERER']) || strpos($_SERVER['HTTP_REFERER'], 'modedit.php') === false) {
        $redirect = true;
    }
}

if ($redirect) {
    // coming from course page or url index page,
    // the redirection is needed for completion tracking and logging
    $fullurl = str_replace('&', '&', url_get_full_url($url, $cm, $course));

    if (!course_get_format($course)->has_view_page()) {
        // If course format does not have a view page, add redirection delay with a link to the edit page.
        // Otherwise teacher is redirected to the external URL without any possibility to edit activity or course settings.
        $editurl = null;
        if (has_capability('moodle/course:manageactivities', $context)) {
            $editurl = new moodle_url('/course/modedit.php', array('update' => $cm->id));
            $edittext = get_string('editthisactivity');
        } else if (has_capability('moodle/course:update', $context->get_course_context())) {
            $editurl = new moodle_url('/course/edit.php', array('id' => $course->id));
            $edittext = get_string('editcoursesettings');
        }
        if ($editurl) {
            redirect($fullurl, html_writer::link($editurl, $edittext)."<br/>".
                    get_string('pageshouldredirect'), 10);
开发者ID:rwijaya,项目名称:moodle,代码行数:31,代码来源:view.php


示例6: url_display_embed

/**
 * Display embedded url file.
 * @param object $url
 * @param object $cm
 * @param object $course
 * @param stored_file $file main file
 * @return does not return
 */
function url_display_embed($url, $cm, $course)
{
    global $CFG, $PAGE;
    $clicktoopen = get_string('clicktoopen', 'url', $url->externalurl);
    $mimetype = resourcelib_guess_url_mimetype($url->externalurl);
    $fullurl = url_get_full_url($url, $cm, $course);
    $title = $url->name;
    if (in_array($mimetype, array('image/gif', 'image/jpeg', 'image/png'))) {
        // It's an image
        $code = resourcelib_embed_image($fullurl, $title);
    } else {
        if ($mimetype == 'audio/mp3') {
            // MP3 audio file
            $code = resourcelib_embed_mp3($fullurl, $title, $clicktoopen);
        } else {
            if ($mimetype == 'video/x-flv') {
                // Flash video file
                $code = resourcelib_embed_flashvideo($fullurl, $title, $clicktoopen);
            } else {
                if ($mimetype == 'application/x-shockwave-flash') {
                    // Flash file
                    $code = resourcelib_embed_flash($fullurl, $title, $clicktoopen);
                } else {
                    if (substr($mimetype, 0, 10) == 'video/x-ms') {
                        // Windows Media Player file
                        $code = resourcelib_embed_mediaplayer($fullurl, $title, $clicktoopen);
                    } else {
                        if ($mimetype == 'video/quicktime') {
                            // Quicktime file
                            $code = resourcelib_embed_quicktime($fullurl, $title, $clicktoopen);
                        } else {
                            if ($mimetype == 'video/mpeg') {
                                // Mpeg file
                                $code = resourcelib_embed_mpeg($fullurl, $title, $clicktoopen);
                            } else {
                                if ($mimetype == 'audio/x-pn-realaudio') {
                                    // RealMedia file
                                    $code = resourcelib_embed_real($fullurl, $title, $clicktoopen);
                                } else {
                                    // anything else - just try object tag enlarged as much as possible
                                    $code = resourcelib_embed_general($fullurl, $title, $clicktoopen, $mimetype);
                                    $PAGE->requires->yui_lib('dom')->in_head();
                                    $PAGE->requires->js('mod/url/functions.js')->in_head();
                                    $PAGE->requires->js_function_call('url_init_object');
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    url_print_header($url, $cm, $course);
    url_print_heading($url, $cm, $course);
    echo $code;
    url_print_intro($url, $cm, $course);
    print_footer();
    die;
}
开发者ID:ajv,项目名称:Offline-Caching,代码行数:67,代码来源:locallib.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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