Commit bf9b7ccd authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Use get_my_files_js in site files (bug 3038)

parent 0805dd06
......@@ -35,21 +35,14 @@ require(dirname(dirname(dirname(__FILE__))) . '/init.php');
safe_require('artefact', 'file');
define('TITLE', get_string('sitefiles', 'admin'));
$copyright = get_field('site_content', 'content', 'name', 'uploadcopyright');
$wwwroot = get_config('wwwroot');
$javascript = <<<JAVASCRIPT
var copyrightnotice = '{$copyright}';
var browser = new FileBrowser('filelist', '{$wwwroot}artefact/file/myfiles.json.php', {'institution':'mahara'});
var uploader = new FileUploader('uploader', '{$wwwroot}artefact/file/upload.php', {'institution':'mahara'},
null, null, browser.refresh, browser.fileexists);
browser.changedircallback = uploader.updatedestination;
JAVASCRIPT;
$smarty = smarty(array('tablerenderer',
'artefact/file/js/file.js'));
$javascript = ArtefactTypeFileBase::get_my_files_js(param_integer('folder', null));
$javascript .= <<<JS
browser.source += '?institution=mahara';
browser.createfolderscript += '?institution=mahara';
uploader.uploadscript += '?institution=mahara';
JS;
$smarty = smarty(array('tablerenderer', 'artefact/file/js/file.js'));
$smarty->assign('INLINEJAVASCRIPT', $javascript);
$smarty->assign('descriptionstrargs', array('<a href="' . get_config('wwwroot') . 'admin/site/menu.php">', '</a>'));
$smarty->assign('heading', get_string('sitefiles', 'admin'));
......
......@@ -579,11 +579,12 @@ abstract class ArtefactTypeFileBase extends ArtefactType {
}
$copyright = get_field('site_content', 'content', 'name', 'uploadcopyright');
$wwwroot = get_config('wwwroot');
$javascript = <<<JAVASCRIPT
var copyrightnotice = '{$copyright}';
var browser = new FileBrowser('filelist', 'myfiles.json.php', null, null, null, null, {$enc_folders});
var uploader = new FileUploader('uploader', 'upload.php', {}, null, null, browser.refresh, browser.fileexists);
var browser = new FileBrowser('filelist', '{$wwwroot}artefact/file/myfiles.json.php', null, null, null, null, {$enc_folders});
var uploader = new FileUploader('uploader', '{$wwwroot}artefact/file/upload.php', {}, null, null, browser.refresh, browser.fileexists);
browser.changedircallback = uploader.updatedestination;
var highlightfiles = {$enc_files};
JAVASCRIPT;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment