本文整理汇总了PHP中get_module_url函数的典型用法代码示例。如果您正苦于以下问题:PHP get_module_url函数的具体用法?PHP get_module_url怎么用?PHP get_module_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_module_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getToolbar
/**
* Get area wiki syntax toolbar
* @return string toolbar javascript code
*/
public function getToolbar()
{
$toolbar = '';
$toolbar .= '<script type="text/javascript" src="' . document_web_path() . '/js/toolbar.js"></script>' . "\n";
$toolbar .= "<script type=\"text/javascript\">if (document.getElementById) {\n var tb = new dcToolBar(document.getElementById('" . $this->attributeList['id'] . "'),\n 'wiki','" . get_module_url('CLWIKI') . "/img/toolbar/');\n\n tb.btStrong('" . get_lang('Bold') . "');\n tb.btEm('" . get_lang('Italic') . "');\n tb.btIns('" . get_lang('Underline') . "');\n tb.btDel('" . get_lang('Strike') . "');\n tb.btQ('" . get_lang('Inline quote') . "');\n tb.btCode('" . get_lang('Code') . "');\n tb.addSpace(10);\n tb.btBr('" . get_lang('Line break') . "');\n tb.addSpace(10);\n tb.btBquote('" . get_lang('Blockquote') . "');\n tb.btPre('" . get_lang('Preformated text') . "');\n tb.btList('" . get_lang('Unordered list') . "','ul');\n tb.btList('" . get_lang('Ordered list') . "','ol');\n tb.addSpace(10);\n tb.btLink('" . get_lang('External link') . "','" . get_lang('URL?') . "','" . get_lang('Language') . "','" . $GLOBALS['iso639_1_code'] . "');\n tb.btImgLink('" . get_lang('External image') . "','" . get_lang('URL') . "');\n tb.draw('');\n}\n</script>\n";
return $toolbar;
}
示例2: resolve
public function resolve(ResourceLocator $locator)
{
if ($locator->hasResourceId()) {
$context = Claro_Context::getCurrentContext();
$context[CLARO_CONTEXT_COURSE] = $locator->getCourseId();
if ($locator->inGroup()) {
$context[CLARO_CONTEXT_GROUP] = $locator->getGroupId();
}
$path = get_path('coursesRepositorySys') . claro_get_course_path($locator->getCourseId());
// in a group
if ($locator->inGroup()) {
$groupData = claro_get_group_data($context);
$path .= '/group/' . $groupData['directory'];
$groupId = $locator->getGroupId();
} else {
$path .= '/document';
}
$path .= '/' . ltrim($locator->getResourceId(), '/');
$resourcePath = '/' . ltrim($locator->getResourceId(), '/');
$path = secure_file_path($path);
if (!file_exists($path)) {
throw new Exception("Resource not found {$path}");
} elseif (is_dir($path)) {
$url = new Url(get_module_entry_url('CLDOC'));
$url->addParam('cmd', 'exChDir');
$url->addParam('file', base64_encode($resourcePath));
return $url->toUrl();
} else {
return get_module_url('CLDOC') . '/connector/cllp.frames.cnr.php';
return claro_get_file_download_url($resourcePath, Claro_Context::getUrlContext($context));
}
} else {
return get_module_entry_url('CLDOC');
}
}
示例3: CLANN_write_ical
/**
* CLAROLINE
*
* @version $Revision: 13708 $
* @copyright (c) 2001-2011, Universite catholique de Louvain (UCL)
* @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
* @package CLANN
* @subpackage CLICAL
* @author Claro Team <cvs@claroline.net>
*/
function CLANN_write_ical($iCal, $context)
{
if (is_array($context) && count($context) > 0) {
$courseId = array_key_exists(CLARO_CONTEXT_COURSE, $context) ? $context[CLARO_CONTEXT_COURSE] : claro_get_current_course_id();
}
require_once dirname(__FILE__) . '/../lib/announcement.lib.php';
$courseData = claro_get_course_data($courseId);
$toolNameList = claro_get_tool_name_list();
$announcementList = announcement_get_item_list($context, 'DESC');
$organizer = (array) array($courseData['titular'], $courseData['email']);
$attendees = array();
$categories = array(get_conf('siteName'), $courseData['officialCode'], trim($toolNameList['CLANN']));
foreach ($announcementList as $announcementItem) {
if ('SHOW' == $announcementItem['visibility']) {
/*
$rssList[] = array( 'title' => trim($announcementItem['title'])
, 'category' => trim($toolNameList['CLANN'])
, 'guid' => get_module_url('CLANN') . '/announcements.php?cidReq='.claro_get_current_course_id().'&l#ann'.$announcementItem['id']
, 'link' => get_module_url('CLANN') . '/announcements.php?cidReq='.claro_get_current_course_id().'&l#ann'.$announcementItem['id']
, 'description' => trim(str_replace('<!-- content: html -->','',$announcementItem['content']))
, 'pubDate' => date('r', stripslashes(strtotime($announcementItem['time'])))
//, 'author' => $_course['email']
);
*/
$iCal->addJournal(trim($announcementItem['title']), trim(str_replace('<!-- content: html -->', '', $announcementItem['content'])), strtotime($announcementItem['time']), strtotime($announcementItem['time']), time(), 1, 1, $organizer, $attendees, $categories, 5, 10, 1, array(), 0, '', get_path('rootWeb') . get_module_url('CLANN') . '/announcements.php?cidReq=' . $courseId . '&l#ann' . $announcementItem['id'], get_locale('iso639_1_code'), '');
}
}
return $iCal;
}
示例4: render
public function render()
{
if ($this->hidden) {
return '<!-- footer hidden -->' . "\n";
}
$currentCourse = claro_get_current_course_data();
if (claro_is_in_a_course()) {
$courseManagerOutput = '<div id="courseManager">' . get_lang('Manager(s) for %course_code', array('%course_code' => $currentCourse['officialCode'])) . ' : ';
$currentCourseTitular = empty($currentCourse['titular']) ? get_lang('Course manager') : $currentCourse['titular'];
if (empty($currentCourse['email'])) {
$courseManagerOutput .= '<a href="' . get_module_url('CLUSR') . '/user.php">' . $currentCourseTitular . '</a>';
} else {
$courseManagerOutput .= '<a href="mailto:' . $currentCourse['email'] . '?body=' . $currentCourse['officialCode'] . '&subject=[' . rawurlencode(get_conf('siteName')) . ']' . '">' . $currentCourseTitular . '</a>';
}
$courseManagerOutput .= '</div>';
$this->assign('courseManager', $courseManagerOutput);
} else {
$this->assign('courseManager', '');
}
$platformManagerOutput = '<div id="platformManager">' . get_lang('Administrator for %site_name', array('%site_name' => get_conf('siteName'))) . ' : ' . '<a href="mailto:' . get_conf('administrator_email') . '?subject=[' . rawurlencode(get_conf('siteName')) . ']' . '">' . get_conf('administrator_name') . '</a>';
if (get_conf('administrator_phone') != '') {
$platformManagerOutput .= '<br />' . "\n" . get_lang('Phone : %phone_number', array('%phone_number' => get_conf('administrator_phone')));
}
$platformManagerOutput .= '</div>';
$this->assign('platformManager', $platformManagerOutput);
$poweredByOutput = '<span class="poweredBy">' . get_lang('Powered by') . ' <a href="http://www.claroline.net" target="_blank">Claroline</a> ' . '© 2001 - 2013' . '</span>';
$this->assign('poweredBy', $poweredByOutput);
return parent::render();
}
示例5: renderTitle
public function renderTitle()
{
$output = '<img ' . 'src="' . get_icon_url('headline', 'CLTI') . '"' . 'alt="' . get_lang('Headline') . '" /> ' . get_lang('Headlines');
if (claro_is_allowed_to_edit()) {
$output .= ' <span class="separator">|</span> <a href="' . claro_htmlspecialchars(Url::Contextualize(get_module_url('CLTI') . '/index.php')) . '">' . '<img src="' . get_icon_url('settings') . '" alt="' . get_lang('Settings') . '" /> ' . get_lang('Manage') . '</a>';
}
return $output;
}
示例6: resolve
/**
* Function called to resolve an URL based on a resourceId.
*
* @param ResourceLocator $locator The locator of the resource.
* @return string the URL of the item
*/
public function resolve(ResourceLocator $locator)
{
if ($locator->hasResourceId()) {
return get_module_url('CLLNP') . "/learningPath.php?path_id={$locator->getResourceId()}&cidReq={$locator->getCourseId()}";
} else {
return get_module_entry_url('CLLNP');
}
}
示例7: renderTitle
public function renderTitle()
{
$output = '<img ' . 'src="' . get_icon_url('announcement', 'CLANN') . '" ' . 'alt="Announcement icon" /> ' . get_lang('Latest announcements');
if (claro_is_allowed_to_edit()) {
$output .= ' <span class="separator">|</span> <a href="' . claro_htmlspecialchars(Url::Contextualize(get_module_url('CLANN') . '/announcements.php')) . '">' . '<img src="' . get_icon_url('settings') . '" alt="' . get_lang('Settings') . '" /> ' . get_lang('Manage') . '</a>';
}
return $output;
}
示例8: getModuleLinkList
protected function getModuleLinkList()
{
//$toolNameList = claro_get_tool_name_list();
$claro_notifier = Claroline::getInstance()->notification;
// Get tool id where new events have been recorded since last login
if ($this->userId) {
$date = $claro_notifier->get_notification_date($this->userId);
$modified_tools = $claro_notifier->get_notified_tools($this->courseCode, $date, $this->userId);
} else {
$modified_tools = array();
}
$toolLinkList = array();
$toolName = get_lang('Course homepage');
// Trick to find how to build URL, must be IMPROVED
$url = claro_htmlspecialchars(Url::Contextualize(get_path('url') . '/claroline/course/index.php?cid=' . $this->courseCode));
$icon = get_icon_url('coursehome');
$htmlId = 'id="courseHomePage"';
$removableTool = false;
$classCurrent = empty($GLOBALS['tlabelReq']) ? ' currentTool' : '';
$toolLinkList[] = '<a ' . $htmlId . 'class="item' . $classCurrent . '" href="' . $url . '">' . '<img class="clItemTool" src="' . $icon . '" alt="" /> ' . $toolName . '</a>' . "\n";
// Generate tool lists
$toolListSource = claro_get_course_tool_list($this->courseCode, $this->profileId, true);
foreach ($toolListSource as $thisTool) {
// Special case when display mode is student and tool invisible doesn't display it
if ($this->viewMode == 'STUDENT' && !$thisTool['visibility']) {
continue;
}
if (isset($thisTool['label'])) {
$thisToolName = $thisTool['name'];
$toolName = get_lang($thisToolName);
// Trick to find how to build URL, must be IMPROVED
$url = claro_htmlspecialchars(Url::Contextualize(get_module_url($thisTool['label']) . '/' . $thisTool['url'], $this->currentCourseContext));
$icon = get_module_url($thisTool['label']) . '/' . $thisTool['icon'];
$htmlId = 'id="' . $thisTool['label'] . '"';
$removableTool = false;
} else {
if (!empty($thisTool['external_name'])) {
$toolName = $thisTool['external_name'];
} else {
$toolName = '<i>no name</i>';
}
$url = claro_htmlspecialchars(trim($thisTool['url']));
$icon = get_icon_url('link');
$htmlId = '';
$removableTool = true;
}
$style = !$thisTool['visibility'] ? 'invisible ' : '';
$classItem = in_array($thisTool['id'], $modified_tools) ? ' hot' : '';
$classCurrent = isset($thisTool['label']) && $thisTool['label'] == $GLOBALS['tlabelReq'] ? ' currentTool' : '';
if (!empty($url)) {
$toolLinkList[] = '<a ' . $htmlId . 'class="' . $style . 'item' . $classItem . $classCurrent . '" href="' . $url . '">' . '<img class="clItemTool" src="' . $icon . '" alt="" /> ' . $toolName . '</a>' . "\n";
} else {
$toolLinkList[] = '<span ' . $style . '>' . '<img class="clItemTool" src="' . $icon . '" alt="" /> ' . $toolName . '</span>' . "\n";
}
}
return $toolLinkList;
}
示例9: resolve
public function resolve(ResourceLocator $locator)
{
if ($locator->hasResourceId()) {
$assignement_id = $locator->getResourceId();
$url = new Url(get_module_url('CLWRK') . '/work_list.php');
$url->addParam('assigId', (int) $assignement_id);
return $url->toUrl();
} else {
return get_module_entry_url('CLWRK');
}
}
示例10: get_icon_url
/**
* Returns the url of the given icon
*
* @param string $fileName file name with or without extension
* @param string $moduleLabel label of the module (optional)
* @return string icon url
* mixed null if icon not found
*/
function get_icon_url($fileName, $moduleLabel = null)
{
$fileInfo = pathinfo($fileName);
$currentModuleLabel = get_current_module_label();
$imgPath = array();
// Search kernel first for performance !
// claroline theme iconset
$imgPath[get_current_iconset_path()] = get_current_iconset_url();
// claroline web/img <--- is now the default location find using get_current_iconset_url
//$imgPath[get_path( 'rootSys' ) . 'web/img/'] = get_path('url') . '/web/img/';
if (!empty($moduleLabel)) {
// module img directory
$imgPath[get_module_path($moduleLabel) . '/img/'] = get_module_url($moduleLabel) . '/img/';
// module root directory
$imgPath[get_module_path($moduleLabel) . '/'] = get_module_url($moduleLabel) . '/';
}
if (!empty($currentModuleLabel)) {
// module img directory
$imgPath[get_module_path($currentModuleLabel) . '/img/'] = get_module_url($currentModuleLabel) . '/img/';
// module root directory
$imgPath[get_module_path($currentModuleLabel) . '/'] = get_module_url($currentModuleLabel) . '/';
}
// img directory in working directory
$imgPath['./img/'] = './img/';
// working directory
$imgPath['./'] = './';
if (!empty($fileInfo['extension'])) {
$img = array($fileName);
} else {
$img = array($fileName . '.png', $fileName . '.gif');
}
foreach ($imgPath as $tryPath => $tryUrl) {
foreach ($img as $tryImg) {
if (claro_debug_mode()) {
pushClaroMessage("Try " . $tryPath . $tryImg, 'debug');
}
if (file_exists($tryPath . $tryImg)) {
if (claro_debug_mode()) {
pushClaroMessage("Using " . $tryPath . $tryImg, 'debug');
}
return $tryUrl . $tryImg . '?' . filemtime($tryPath . $tryImg);
}
}
}
if (claro_debug_mode()) {
pushClaroMessage("Icon {$fileName} not found", 'error');
}
// WORKAROUND : avoid double submission if missing image !!!!
return 'image_not_found.png';
}
示例11: resolve
public function resolve(ResourceLocator $locator)
{
if ($locator->hasResourceId()) {
$parts = explode('/', ltrim($locator->getResourceId(), '/'));
if (count($parts) == 1) {
$url = new Url(get_module_url('CLWIKI') . '/wiki.php');
$url->addParam('wikiId', (int) $parts[0]);
return $url->toUrl();
} elseif (count($parts) == 2) {
$url = new Url(get_module_url('CLWIKI') . '/page.php');
$url->addParam('wikiId', (int) $parts[0]);
$url->addParam('title', $parts[1]);
return $url->toUrl();
} else {
return get_module_entry_url('CLWIKI');
}
} else {
return get_module_entry_url('CLWIKI');
}
}
示例12: resolve
public function resolve(ResourceLocator $locator)
{
if ($locator->hasResourceId()) {
if ($locator->inGroup()) {
// $resourceElements = explode( '/', ltrim( $locator->getResourceId(), '/') );
return get_module_url('CLFRM') . "/viewtopic.php?topic=" . (int) ltrim($locator->getResourceId(), '/');
} else {
$resourceElements = explode('/', ltrim($locator->getResourceId(), '/'));
if (count($resourceElements) == 1) {
return get_module_url('CLFRM') . "/viewforum.php?forum=" . (int) $resourceElements[0];
} elseif (count($resourceElements) == 2) {
return get_module_url('CLFRM') . "/viewtopic.php?topic=" . (int) $resourceElements[1];
} else {
return get_module_entry_url('CLFRM');
}
}
} else {
return get_module_entry_url('CLFRM');
}
}
示例13: CLCAL_write_ical
/**
* CLAROLINE
*
* @version $Revision: 13708 $
* @copyright (c) 2001-2011, Universite catholique de Louvain (UCL)
* @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
* @package CLCAL
* @subpackage CLRSS
* @author Claro Team <cvs@claroline.net>
*/
function CLCAL_write_ical($iCal, $context)
{
if (is_array($context) && count($context) > 0) {
$courseId = array_key_exists(CLARO_CONTEXT_COURSE, $context) ? $context[CLARO_CONTEXT_COURSE] : claro_get_current_course_id();
}
if (false !== ($courseData = claro_get_course_data($courseId))) {
$toolNameList = claro_get_tool_name_list();
require_once dirname(__FILE__) . '/../lib/agenda.lib.php';
$eventList = agenda_get_item_list($context, 'ASC');
$organizer = (array) array($courseData['titular'], $courseData['email']);
$attendees = array();
$categories = array(get_conf('siteName'), $courseData['officialCode'], trim($toolNameList['CLCAL']));
foreach ($eventList as $thisEvent) {
if ('SHOW' == $thisEvent['visibility']) {
$eventDuration = isset($thisEvent['duration']) ? $thisEvent['duration'] : get_conf('defaultEventDuration', '60');
$startDate = strtotime($thisEvent['day'] . ' ' . $thisEvent['hour']);
// Start Time (timestamp; for an allday event the startdate has to start at YYYY-mm-dd 00:00:00)
$endDate = $startDate + $eventDuration;
$iCal->addEvent($organizer, $startDate, $endDate, '', 0, $categories, trim(str_replace('<!-- content: html -->', '', $thisEvent['content'])), trim($thisEvent['title']), 1, $attendees, 5, 0, 0, 0, array(), 1, '', 0, 1, get_path('rootWeb') . get_module_url('CLCAL') . '/agenda.php?cidReq=' . $courseId . '&l#item' . $thisEvent['id'], get_locale('iso639_1_code'), '');
}
}
}
return $iCal;
}
示例14: loadFromModule
public function loadFromModule($moduleLabel, $lib, $media = 'all')
{
$lib = secure_file_path($lib);
$moduleLabel = secure_file_path($moduleLabel);
if (!get_module_data($moduleLabel)) {
pushClaroMessage(__CLASS__ . "::{$moduleLabel} does not exists", 'error');
return false;
}
if (claro_debug_mode()) {
pushClaroMessage(__CLASS__ . "::Try to find {$lib} for {$moduleLabel}", 'debug');
}
$cssPath = array(0 => array('path' => get_path('rootSys') . 'platform/css/' . $moduleLabel . '/' . $lib . '.css', 'url' => get_path('url') . '/platform/css/' . $moduleLabel . '/' . $lib . '.css'), 1 => array('path' => get_module_path($moduleLabel) . '/css/' . $lib . '.css', 'url' => get_module_url($moduleLabel) . '/css/' . $lib . '.css'));
/*$path = get_module_path( $moduleLabel ) . '/css/' . $lib . '.css';
$url = get_module_url( $moduleLabel ) . '/css/' . $lib . '.css';*/
foreach ($cssPath as $cssTry) {
$path = $cssTry['path'];
$url = $cssTry['url'];
if (claro_debug_mode()) {
pushClaroMessage(__CLASS__ . "::Try {$path}::{$url} for {$moduleLabel}", 'debug');
}
if (file_exists($path)) {
if (array_key_exists($path, $this->css)) {
return false;
}
$this->css[$path] = array('url' => $url . '?' . filemtime($path), 'media' => $media);
if (claro_debug_mode()) {
pushClaroMessage(__CLASS__ . "::Use {$path}::{$url} for {$moduleLabel}", 'debug');
}
ClaroHeader::getInstance()->addHtmlHeader('<link rel="stylesheet" type="text/css"' . ' href="' . $url . '"' . ' media="' . $media . '" />');
return true;
} else {
if (claro_debug_mode()) {
pushClaroMessage(__CLASS__ . "::Cannot found css {$lib} for {$moduleLabel}", 'error');
}
return false;
}
}
}
示例15: claro_set_display_mode_available
}
// module_id
if (isset($_GET['module_id']) && $_GET['module_id'] != '') {
$_SESSION['module_id'] = $_GET['module_id'];
}
// use viewMode
claro_set_display_mode_available(true);
$is_allowedToEdit = claro_is_allowed_to_edit();
// as teacher
//-- breadcrumbs
if ($is_allowedToEdit) {
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Learning path'), Url::Contextualize(get_module_url('CLLNP') . '/learningPathAdmin.php'));
} else {
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Learning path'), Url::Contextualize(get_module_url('CLLNP') . '/learningPath.php'));
}
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Learning path list'), Url::Contextualize(get_module_url('CLLNP') . '/learningPathList.php'));
$nameTools = get_lang('Module');
// tables names
$tbl_cdb_names = claro_sql_get_course_tbl();
$TABLELEARNPATH = $tbl_cdb_names['lp_learnPath'];
$TABLEMODULE = $tbl_cdb_names['lp_module'];
$TABLELEARNPATHMODULE = $tbl_cdb_names['lp_rel_learnPath_module'];
$TABLEASSET = $tbl_cdb_names['lp_asset'];
$TABLEUSERMODULEPROGRESS = $tbl_cdb_names['lp_user_module_progress'];
// exercises
$tbl_quiz_exercise = $tbl_cdb_names['qwz_exercise'];
$dbTable = $TABLEASSET;
// for old functions of document tool
//lib of this tool
require_once get_path('incRepositorySys') . "/lib/learnPath.lib.inc.php";
require_once get_path('incRepositorySys') . "/lib/fileDisplay.lib.php";