本文整理汇总了PHP中EfrontLesson::getDirectoryUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP EfrontLesson::getDirectoryUrl方法的具体用法?PHP EfrontLesson::getDirectoryUrl怎么用?PHP EfrontLesson::getDirectoryUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EfrontLesson
的用法示例。
在下文中一共展示了EfrontLesson::getDirectoryUrl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: import
//.........这里部分代码省略.........
break;
}
}
// exit();
if (G_VERSIONTYPE != 'community') {
#cpp#ifndef COMMUNITY
if (G_VERSIONTYPE != 'standard') {
#cpp#ifndef STANDARD
if ($scorm2004) {
foreach ($references as $key => $value) {
$ref = array_search($value['IDENTIFIERREF'], $resources);
if ($ref !== false && !is_null($ref)) {
/*SCORM 2004: The xml:base attribute provides a relative path offset for the content file(s) contained in the manifest*/
$path_offset = $tagArray[$ref]['attributes']['XML:BASE'];
$data = file_get_contents($scormPath . "/" . $path_offset . $tagArray[$ref]['attributes']['HREF']);
$primitive_hrefs[$ref] = str_replace("\\", "/", $path_offset . $tagArray[$ref]['attributes']['HREF']);
$path_part[$ref] = dirname($primitive_hrefs[$ref]);
foreach ($tagArray[$ref]['children'] as $value2) {
if ($tagArray[$value2]['tag'] == 'DEPENDENCY') {
$idx = array_search($tagArray[$value2]['attributes']['IDENTIFIERREF'], $resources);
foreach ($tagArray[$idx]['children'] as $value3) {
if ($tagArray[$value3]['tag'] == 'FILE') {
$data = preg_replace("#(\\.\\.\\/(\\w+\\/)*)?" . $tagArray[$value3]['attributes']['HREF'] . "#", $currentLesson->getDirectory() . "/" . $scormFolderName . '/' . $path_part[$ref] . "/\$1" . $tagArray[$value3]['attributes']['HREF'], $data);
}
}
}
}
//$total_fields[$key]['data'] = eF_postProcess(str_replace("'","'",$data));
//$total_fields$adl_seq_map_info[$item_key][$key]['target_objective_ID'[$key]['data'] = '<iframe height = "100%" width = "100%" frameborder = "no" name = "scormFrameName" id = "scormFrameID" src = "'.G_RELATIVELESSONSLINK.$lessons_ID."/".$scormFolderName.'/'.$primitive_hrefs[$ref]. $value['PARAMETERS']. '" onload = "eF_js_setCorrectIframeSize()"></iframe><iframe name = "commitFrame" frameborder = "no" id = "commitFrame" width = "1" height = "1" style = "display:none"></iframe>';
//
//
//
if ($parameters['embed_type'] == 'iframe') {
$total_fields[$key]['data'] = '<iframe ' . $parameters['iframe_parameters'] . ' name = "scormFrameName" id = "scormFrameID" src = "' . rtrim($currentLesson->getDirectoryUrl(), "/") . "/" . $scormFolderName . '/' . $primitive_hrefs[$ref] . $value['PARAMETERS'] . '" onload = "if (window.eF_js_setCorrectIframeSize) {eF_js_setCorrectIframeSize();} else {setIframeSize = true;}"></iframe>';
} else {
$total_fields[$key]['data'] = '
<div style = "text-align:center;height:300px">
<span>##CLICKTOSTARTUNIT##</span><br/>
<input type = "button" value = "##STARTUNIT##" class = "flatButton" onclick = \'window.open("' . rtrim($currentLesson->getDirectoryUrl(), "/") . "/" . rawurlencode($scormFolderName) . '/' . rawurlencode($primitive_hrefs[$ref]) . $value['PARAMETERS'] . '", "scormFrameName", "' . $parameters['popup_parameters'] . '")\' >
</div>';
}
/*
$total_fields[$key]['data'] = '
<style>
iframe.scormCommitFrame{width:100%;height:500px;border:1px solid red;}
</style>
<iframe name = "scormFrameName" id = "scormFrameID" class = "scormFrame" src = "'.$currentLesson -> getDirectoryUrl()."/".$scormFolderName.'/'.$primitive_hrefs[$ref]. $value['PARAMETERS']. '" onload = "eF_js_setCorrectIframeSize()"></iframe>
<iframe name = "commitFrame" id = "commitFrame" class = "scormCommitFrame">Sorry, but your browser needs to support iframes to see this</iframe>';
*/
}
}
$lastUnit = $currentContent->getLastNode();
$lastUnit ? $this_id = $lastUnit['id'] : ($this_id = 0);
//$this_id = $tree[sizeof($tree) - 1]['id'];
foreach ($total_fields as $key => $value) {
if (isset($value['ctg_type'])) {
$total_fields[$key]['previous_content_ID'] = $this_id;
if (!isset($total_fields[$key]['parent_content_ID'])) {
$total_fields[$key]['parent_content_ID'] = 0;
}
$total_fields[$key]['options'] = serialize(array('hide_navigation' => 1, 'complete_unit_setting' => EfrontUnit::COMPLETION_OPTIONS_HIDECOMPLETEUNITICON));
$this_id = eF_insertTableData("content", $total_fields[$key]);
//we want to have entry at scorm data even if all values are null
$fields_insert[$this_id]['content_ID'] = $this_id;
if (!empty($organizations[$key])) {
$organization_content_ID = $this_id;
示例2: catch
$currentUser = EfrontUserFactory::factory($_SESSION['s_login']);
} catch (EfrontException $e) {
$message = $e->getMessage() . ' (' . $e->getCode() . ')';
eF_redirect("index.php?message=" . urlencode($message) . "&message_type=failure");
exit;
}
} else {
eF_redirect("index.php?message=" . urlencode(_YOUCANNOTACCESSTHISPAGE) . "&message_type=failure");
exit;
}
try {
//There are 2 legal modes: 'lessons' and 'external'. In the first case, we read the legitimate directory from the session. In the second case, we take it from global constant
if ($_GET['mode'] == 'lesson') {
$currentLesson = new EfrontLesson($_SESSION['s_lessons_ID']);
$rootDir = new EfrontDirectory($currentLesson->getDirectory());
$filesBaseUrl = $currentLesson->getDirectoryUrl();
} elseif ($_GET['mode'] == 'external') {
$rootDir = new EfrontDirectory(G_EXTERNALPATH);
$filesBaseUrl = G_EXTERNALURL;
} elseif ($_GET['mode'] == 'upload') {
$rootDir = new EfrontDirectory(G_UPLOADPATH . $_SESSION['s_login']);
$filesBaseUrl = G_UPLOADPATH . $_SESSION['s_login'];
} else {
throw new Exception(_ILLEGALMODE);
}
//We are inside a directory. Verify that this directory is below the $rootDir, as defined previously
if (isset($_GET['directory'])) {
$directory = new EfrontDirectory($_GET['directory']);
if (strpos($directory['path'], $rootDir['path']) === false) {
$directory = $rootDir;
} else {
示例3: import
//.........这里部分代码省略.........
break;
}
}
foreach ($references as $key => $value) {
$ref = array_search($value['IDENTIFIERREF'], $resources);
if ($ref !== false && !is_null($ref)) {
/*SCORM 2004: The xml:base attribute provides a relative path offset for the content file(s) contained in the manifest*/
$path_offset = $tagArray[$ref]['attributes']['XML:BASE'];
if ($tagArray[$ref]['attributes']['TYPE'] == 'imswl_xmlv1p2') {
foreach ($tagArray[$ref]['children'] as $node) {
if ($tagArray[$node]['tag'] == 'FILE') {
$href = $tagArray[$node]['attributes']['HREF'];
//debug();
//pr($currentLesson -> getDirectory()."/".$scormFolderName."/".$path_offset.$href);
$data = file_get_contents($currentLesson->getDirectory() . "/" . $scormFolderName . "/" . $path_offset . $href);
file_put_contents($currentLesson->getDirectory() . "/" . $scormFolderName . "/" . $path_offset . dirname($href) . '/weblink.html', self::createWebLink($data));
$href = dirname($href) . '/weblink.html';
//exit;
//pr($data);exit;
}
}
} else {
if (!$tagArray[$ref]['attributes']['HREF']) {
foreach ($tagArray[$ref]['children'] as $node) {
if ($tagArray[$node]['tag'] == 'FILE') {
$href = $tagArray[$node]['attributes']['HREF'];
}
}
} else {
$href = $tagArray[$ref]['attributes']['HREF'];
}
}
$data = file_get_contents($currentLesson->getDirectory() . "/" . $scormFolderName . "/" . $path_offset . $href);
$primitive_hrefs[$ref] = $path_offset . $href;
$path_part[$ref] = dirname($primitive_hrefs[$ref]);
foreach ($tagArray[$ref]['children'] as $value2) {
if ($tagArray[$value2]['tag'] == 'DEPENDENCY') {
$idx = array_search($tagArray[$value2]['attributes']['IDENTIFIERREF'], $resources);
foreach ($tagArray[$idx]['children'] as $value3) {
if ($tagArray[$value3]['tag'] == 'FILE') {
$data = preg_replace("#(\\.\\.\\/(\\w+\\/)*)?" . $tagArray[$value3]['attributes']['HREF'] . "#", $currentLesson->getDirectory() . "/" . $scormFolderName . '/' . $path_part[$ref] . "/\$1" . $tagArray[$value3]['attributes']['HREF'], $data);
}
}
}
}
if ($parameters['embed_type'] == 'iframe') {
$total_fields[$key]['data'] = '<iframe height = "100%" width = "100%" frameborder = "no" name = "scormFrameName" id = "scormFrameID" src = "' . $currentLesson->getDirectoryUrl() . "/" . $scormFolderName . '/' . $primitive_hrefs[$ref] . $value['PARAMETERS'] . '" onload = "if (window.eF_js_setCorrectIframeSize) eF_js_setCorrectIframeSize(); else setIframeSize = true;"></iframe>';
} else {
$total_fields[$key]['data'] = '
<div style = "text-align:center;height:300px">
<span>##CLICKTOSTARTUNIT##</span><br/>
<input type = "button" value = "##STARTUNIT##" class = "flatButton" onclick = \'window.open("' . $currentLesson->getDirectoryUrl() . "/" . $scormFolderName . '/' . $primitive_hrefs[$ref] . $value['PARAMETERS'] . '", "scormFrameName", "' . $parameters['popup_parameters'] . '")\' >
</div>';
}
}
}
//pr($tagArray);exit;
$lastUnit = $currentContent->getLastNode();
$lastUnit ? $this_id = $lastUnit['id'] : ($this_id = 0);
//$this_id = $tree[sizeof($tree) - 1]['id'];
foreach ($total_fields as $key => $value) {
if (isset($value['ctg_type']) && $value['name']) {
$total_fields[$key]['previous_content_ID'] = $this_id;
if (!isset($total_fields[$key]['parent_content_ID'])) {
$total_fields[$key]['parent_content_ID'] = 0;
}
$this_id = eF_insertTableData("content", $total_fields[$key]);
//we want to have entry at scorm data even if all values are null
$fields_insert[$this_id]['content_ID'] = $this_id;
$tagArray[$key]['this_id'] = $this_id;
foreach ($tagArray[$key]['children'] as $key2 => $value2) {
if (isset($total_fields[$value2])) {
$total_fields[$value2]['parent_content_ID'] = $this_id;
}
}
} else {
unset($total_fields[$key]);
}
}
//$directory = new EfrontDirectory(G_SCORMPATH);
//$directory -> copy(EfrontDirectory :: normalize($currentLesson -> getDirectory()).'/'.$scormFolderName, true);
//foreach ($files as $key => $value) {
//$newhref = $tagArray[$tagArray[$key]['parent_index']]['attributes']['XML:BASE'];
//copy(G_SCORMPATH."/".rtrim($newhref,"/")."/".rtrim($value,"/"), rtrim($currentLesson -> getDirectory(), "/")."/$this_id/".rtrim($newhref,"/")."/".rtrim($value,"/"));
//$this_id is put here so we can be sure that the files are put in a unique folder
//}
foreach ($prerequisites as $key => $value) {
foreach ($tagArray as $key2 => $value2) {
if (isset($value2['attributes']['IDENTIFIER']) && $value2['attributes']['IDENTIFIER'] == $value) {
unset($fields_insert);
$fields_insert['users_LOGIN'] = "*";
$fields_insert['content_ID'] = $tagArray[$tagArray[$key]['parent_index']]['this_id'];
$fields_insert['rule_type'] = "hasnot_seen";
$fields_insert['rule_content_ID'] = $value2['this_id'];
$fields_insert['rule_option'] = 0;
eF_insertTableData("rules", $fields_insert);
}
}
}
}