Merged in url fixes.
parent
8ed7e39ddf
commit
419aed308a
|
@ -9,7 +9,7 @@ class H5PDevelopment {
|
|||
const MODE_CONTENT = 1;
|
||||
const MODE_LIBRARY = 2;
|
||||
|
||||
private $h5pF, $libraries, $language;
|
||||
private $h5pF, $libraries, $language, $filesPath;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
@ -23,6 +23,7 @@ class H5PDevelopment {
|
|||
public function __construct($H5PFramework, $filesPath, $language, $libraries = NULL) {
|
||||
$this->h5pF = $H5PFramework;
|
||||
$this->language = $language;
|
||||
$this->filesPath = $filesPath;
|
||||
if ($libraries !== NULL) {
|
||||
$this->libraries = $libraries;
|
||||
}
|
||||
|
@ -86,7 +87,7 @@ class H5PDevelopment {
|
|||
$library['libraryId'] = $this->h5pF->getLibraryId($library['machineName'], $library['majorVersion'], $library['minorVersion']);
|
||||
$this->h5pF->saveLibraryData($library, $library['libraryId'] === FALSE);
|
||||
|
||||
$library['path'] = $libraryPath;
|
||||
$library['path'] = 'development/' . $contents[$i];
|
||||
$this->libraries[H5PDevelopment::libraryToString($library['machineName'], $library['majorVersion'], $library['minorVersion'])] = $library;
|
||||
}
|
||||
|
||||
|
@ -144,7 +145,7 @@ class H5PDevelopment {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
return $this->getFileContents($this->libraries[$library]['path'] . '/semantics.json');
|
||||
return $this->getFileContents($this->filesPath . $this->libraries[$library]['path'] . '/semantics.json');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -162,7 +163,7 @@ class H5PDevelopment {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
return $this->getFileContents($this->libraries[$library]['path'] . '/language/' . $language . '.json');
|
||||
return $this->getFileContents($this->filesPath . $this->libraries[$library]['path'] . '/language/' . $language . '.json');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1493,7 +1493,7 @@ Class H5PExport {
|
|||
$library = $dependency['library'];
|
||||
|
||||
// Copy library to h5p
|
||||
$source = isset($library['path']) ? $library['path'] : $h5pDir . 'libraries' . DIRECTORY_SEPARATOR . H5PCore::libraryToString($library, TRUE);
|
||||
$source = $h5pDir . (isset($library['path']) ? $library['path'] : 'libraries' . DIRECTORY_SEPARATOR . H5PCore::libraryToString($library, TRUE));
|
||||
$destination = $tempPath . DIRECTORY_SEPARATOR . $library['machineName'];
|
||||
$this->h5pC->copyFileTree($source, $destination);
|
||||
|
||||
|
@ -1637,7 +1637,7 @@ class H5PCore {
|
|||
$this->development_mode = $development_mode;
|
||||
|
||||
if ($development_mode & H5PDevelopment::MODE_LIBRARY) {
|
||||
$this->h5pD = new H5PDevelopment($this->h5pF, $path, $language);
|
||||
$this->h5pD = new H5PDevelopment($this->h5pF, $path . '/', $language);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1783,7 +1783,7 @@ class H5PCore {
|
|||
|
||||
foreach ($dependency[$type] as $file) {
|
||||
$assets[] = (object) array(
|
||||
'path' => $prefix . $dependency['path'] . '/' . trim(is_array($file) ? $file['path'] : $file),
|
||||
'path' => $prefix . '/' . $dependency['path'] . '/' . trim(is_array($file) ? $file['path'] : $file),
|
||||
'version' => $dependency['version']
|
||||
);
|
||||
}
|
||||
|
@ -1831,7 +1831,7 @@ class H5PCore {
|
|||
);
|
||||
foreach ($dependencies as $dependency) {
|
||||
if (isset($dependency['path']) === FALSE) {
|
||||
$dependency['path'] = '/libraries/' . H5PCore::libraryToString($dependency, TRUE);
|
||||
$dependency['path'] = 'libraries/' . H5PCore::libraryToString($dependency, TRUE);
|
||||
$dependency['preloadedJs'] = explode(',', $dependency['preloadedJs']);
|
||||
$dependency['preloadedCss'] = explode(',', $dependency['preloadedCss']);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue