Merge branch 'patch-1' of github.com:GuillaumeAmat/core into GuillaumeAmat-patch-1

This commit is contained in:
Vincent Petry 2014-02-20 14:49:54 +01:00
commit 6cf83de60e
2 changed files with 48 additions and 3 deletions

View file

@ -18,6 +18,15 @@ window.FileList={
$(this).attr('data-file',decodeURIComponent($(this).attr('data-file')));
});
},
/**
* Sets a new page title
*/
setPageTitle: function(title){
// Sets the page title with the " - ownCloud" suffix as in templates
window.document.title = title + ' - ' + oc_defaults.title;
return true;
},
/**
* Returns the tr element for a given file name
*/
@ -186,12 +195,22 @@ window.FileList={
changeDirectory: function(targetDir, changeUrl, force) {
var $dir = $('#dir'),
url,
currentDir = $dir.val() || '/';
currentDir = $dir.val() || '/',
baseDir = OC.basename(targetDir),
targetDir = targetDir || '/';
if (!force && currentDir === targetDir) {
return;
}
if (baseDir !== '') {
FileList.setPageTitle(baseDir);
}
else {
FileList.setPageTitle(t('files', 'Files'));
}
FileList.setCurrentDir(targetDir, changeUrl);
$('#fileList').trigger(
jQuery.Event('changeDirectory', {
dir: targetDir,
@ -847,7 +866,8 @@ window.FileList={
};
$(document).ready(function() {
var isPublic = !!$('#isPublic').val();
var baseDir,
isPublic = !!$('#isPublic').val();
// handle upload events
var file_upload_start = $('#file_upload_start');
@ -1132,5 +1152,13 @@ $(document).ready(function() {
}
}
baseDir = OC.basename(parseCurrentDirFromUrl());
if (baseDir !== '') {
FileList.setPageTitle(baseDir);
}
FileList.createFileSummary();
});

View file

@ -16,6 +16,9 @@ header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
// Enable l10n support
$l = OC_L10N::get('core');
// Enable OC_Defaults support
$defaults = new OC_Defaults();
// Get the config
$apps_paths = array();
foreach(OC_App::getEnabledApps() as $app) {
@ -60,6 +63,20 @@ $array = array(
'session_lifetime' => \OCP\Config::getSystemValue('session_lifetime', ini_get('session.gc_maxlifetime')),
'session_keepalive' => \OCP\Config::getSystemValue('session_keepalive', true)
)
),
"oc_defaults" => json_encode(
array(
'entity' => $defaults->getEntity(),
'name' => $defaults->getName(),
'title' => $defaults->getTitle(),
'baseUrl' => $defaults->getBaseUrl(),
'syncClientUrl' => $defaults->getSyncClientUrl(),
'docBaseUrl' => $defaults->getDocBaseUrl(),
'slogan' => $defaults->getSlogan(),
'logoClaim' => $defaults->getLogoClaim(),
'shortFooter' => $defaults->getShortFooter(),
'longFooter' => $defaults->getLongFooter()
)
)
);