merge breadcrumb root into navigation

This commit is contained in:
Jan-Christoph Borchardt 2012-10-28 17:10:31 +01:00
commit d7abd44dea
15 changed files with 2029 additions and 193 deletions

View File

@ -3,6 +3,6 @@ $l=OC_L10N::get('files');
OCP\App::registerAdmin('files', 'admin');
OCP\App::addNavigationEntry( array( "id" => "files_index", "order" => 0, "href" => OCP\Util::linkTo( "files", "index.php" ), "icon" => OCP\Util::imagePath( "core", "places/home.svg" ), "name" => $l->t("Files") ));
OCP\App::addNavigationEntry( array( "id" => "files_index", "order" => 0, "href" => OCP\Util::linkTo( "files", "index.php" ), "icon" => OCP\Util::imagePath( "core", "places/files.svg" ), "name" => $l->t("Files") ));
OC_Search::registerProvider('OC_Search_Provider_File');

View File

@ -12,7 +12,7 @@
.file_upload_wrapper, #file_newfolder_name { background-repeat:no-repeat; background-position:.5em .5em; padding-left:2em; }
.file_upload_wrapper { font-weight:bold; display:-moz-inline-box; /* fallback for older firefox versions*/ display:block; float:left; padding-left:0; overflow:hidden; position:relative; margin:0; margin-left:2px; }
.file_upload_wrapper .file_upload_button_wrapper { position:absolute; top:0; left:0; width:100%; height:100%; cursor:pointer; z-index:1000; }
#new { background-color:#5bb75b; float:left; margin:0 0 0 1em; border-right:none; z-index:1010; height:1.3em; }
#new { background-color:#5bb75b; float:left; margin:0; border-right:none; z-index:1010; height:1.3em; }
#new:hover, a.file_upload_button_wrapper:hover + button.file_upload_filename { background-color:#4b964b; }
#new.active { border-bottom-left-radius:0; border-bottom-right-radius:0; border-bottom:none; }
#new>a { padding:.5em 1.2em .3em; color:#fff; text-shadow:0 1px 0 #51a351; }
@ -81,10 +81,6 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; }
.selectedActions a { display:inline; margin:-.5em 0; padding:.5em !important; }
.selectedActions a img { position:relative; top:.3em; }
/* add breadcrumb divider to the File item in navigation panel */
#navigation>ul>li:first-child { background:url('%webroot%/core/img/breadcrumb-start.svg') no-repeat 64px 0; width:64px; padding-right:1em; position:fixed; }
#navigation>ul>li:first-child+li { padding-top:68px; }
#scanning-message{ top:40%; left:40%; position:absolute; display:none; }
div.crumb a{ padding: 0.9em 0 0.7em 0; }

View File

@ -1,191 +1,189 @@
var FileActions={
actions:{},
defaults:{},
icons:{},
currentFile:null,
register:function(mime,name,permissions,icon,action){
if(!FileActions.actions[mime]){
FileActions.actions[mime]={};
var FileActions = {
actions: {},
defaults: {},
icons: {},
currentFile: null,
register: function (mime, name, permissions, icon, action) {
if (!FileActions.actions[mime]) {
FileActions.actions[mime] = {};
}
if (!FileActions.actions[mime][name]) {
FileActions.actions[mime][name] = {};
}
FileActions.actions[mime][name]['action'] = action;
FileActions.actions[mime][name]['permissions'] = permissions;
FileActions.icons[name]=icon;
FileActions.icons[name] = icon;
},
setDefault:function(mime,name){
FileActions.defaults[mime]=name;
setDefault: function (mime, name) {
FileActions.defaults[mime] = name;
},
get:function(mime,type,permissions){
var actions={};
if(FileActions.actions.all){
actions=$.extend( actions, FileActions.actions.all );
get: function (mime, type, permissions) {
var actions = {};
if (FileActions.actions.all) {
actions = $.extend(actions, FileActions.actions.all);
}
if(mime){
if(FileActions.actions[mime]){
actions=$.extend( actions, FileActions.actions[mime] );
if (mime) {
if (FileActions.actions[mime]) {
actions = $.extend(actions, FileActions.actions[mime]);
}
var mimePart=mime.substr(0,mime.indexOf('/'));
if(FileActions.actions[mimePart]){
actions=$.extend( actions, FileActions.actions[mimePart] );
var mimePart = mime.substr(0, mime.indexOf('/'));
if (FileActions.actions[mimePart]) {
actions = $.extend(actions, FileActions.actions[mimePart]);
}
}
if(type){//type is 'dir' or 'file'
if(FileActions.actions[type]){
actions=$.extend( actions, FileActions.actions[type] );
if (type) {//type is 'dir' or 'file'
if (FileActions.actions[type]) {
actions = $.extend(actions, FileActions.actions[type]);
}
}
var filteredActions = {};
$.each(actions, function(name, action) {
$.each(actions, function (name, action) {
if (action.permissions & permissions) {
filteredActions[name] = action.action;
}
});
return filteredActions;
},
getDefault:function(mime,type,permissions){
if(mime){
var mimePart=mime.substr(0,mime.indexOf('/'));
getDefault: function (mime, type, permissions) {
if (mime) {
var mimePart = mime.substr(0, mime.indexOf('/'));
}
var name=false;
if(mime && FileActions.defaults[mime]){
name=FileActions.defaults[mime];
}else if(mime && FileActions.defaults[mimePart]){
name=FileActions.defaults[mimePart];
}else if(type && FileActions.defaults[type]){
name=FileActions.defaults[type];
}else{
name=FileActions.defaults.all;
var name = false;
if (mime && FileActions.defaults[mime]) {
name = FileActions.defaults[mime];
} else if (mime && FileActions.defaults[mimePart]) {
name = FileActions.defaults[mimePart];
} else if (type && FileActions.defaults[type]) {
name = FileActions.defaults[type];
} else {
name = FileActions.defaults.all;
}
var actions=this.get(mime,type,permissions);
var actions = this.get(mime, type, permissions);
return actions[name];
},
display:function(parent){
FileActions.currentFile=parent;
$('#fileList span.fileactions, #fileList td.date a.action').remove();
var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType(), FileActions.getCurrentPermissions());
var file=FileActions.getCurrentFile();
if($('tr').filterAttr('data-file',file).data('renaming')){
display: function (parent) {
FileActions.currentFile = parent;
var actions = FileActions.get(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions());
var file = FileActions.getCurrentFile();
if ($('tr').filterAttr('data-file', file).data('renaming')) {
return;
}
parent.children('a.name').append('<span class="fileactions" />');
var defaultAction=FileActions.getDefault(FileActions.getCurrentMimeType(),FileActions.getCurrentType(), FileActions.getCurrentPermissions());
for(name in actions){
var defaultAction = FileActions.getDefault(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions());
for (name in actions) {
// NOTE: Temporary fix to prevent rename action in root of Shared directory
if (name == 'Rename' && $('#dir').val() == '/Shared') {
if (name === 'Rename' && $('#dir').val() === '/Shared') {
continue;
}
if((name=='Download' || actions[name]!=defaultAction) && name!='Delete'){
var img=FileActions.icons[name];
if(img.call){
img=img(file);
if ((name === 'Download' || actions[name] !== defaultAction) && name !== 'Delete') {
var img = FileActions.icons[name];
if (img.call) {
img = img(file);
}
var html='<a href="#" class="action" style="display:none">';
if(img) { html+='<img src="'+img+'"/> '; }
html += t('files', name) +'</a>';
var element=$(html);
element.data('action',name);
element.click(function(event){
var html = '<a href="#" class="action">';
if (img) {
html += '<img src="' + img + '"/> ';
}
html += t('files', name) + '</a>';
var element = $(html);
element.data('action', name);
element.click(function (event) {
FileActions.currentFile = $(this).parent().parent().parent();
event.stopPropagation();
event.preventDefault();
var action=actions[$(this).data('action')];
var currentFile=FileActions.getCurrentFile();
FileActions.hide();
var action = actions[$(this).data('action')];
var currentFile = FileActions.getCurrentFile();
action(currentFile);
});
element.hide();
parent.find('a.name>span.fileactions').append(element);
}
}
if(actions['Delete']){
var img=FileActions.icons['Delete'];
if(img.call){
img=img(file);
if (actions['Delete']) {
var img = FileActions.icons['Delete'];
if (img.call) {
img = img(file);
}
// NOTE: Temporary fix to allow unsharing of files in root of Shared folder
if ($('#dir').val() == '/Shared') {
var html = '<a href="#" original-title="' + t('files', 'Unshare') + '" class="action delete" style="display:none" />';
var html = '<a href="#" original-title="' + t('files', 'Unshare') + '" class="action delete" />';
} else {
var html='<a href="#" original-title="' + t('files', 'Delete') + '" class="action delete" style="display:none" />';
var html = '<a href="#" original-title="' + t('files', 'Delete') + '" class="action delete" />';
}
var element=$(html);
if(img){
element.append($('<img src="'+img+'"/>'));
var element = $(html);
if (img) {
element.append($('<img src="' + img + '"/>'));
}
element.data('action','Delete');
element.click(function(event){
element.data('action', 'Delete');
element.click(function (event) {
event.stopPropagation();
event.preventDefault();
var action=actions[$(this).data('action')];
var currentFile=FileActions.getCurrentFile();
FileActions.hide();
var action = actions[$(this).data('action')];
var currentFile = FileActions.getCurrentFile();
action(currentFile);
});
element.hide();
parent.parent().children().last().append(element);
}
$('#fileList .action').css('-o-transition-property','none');//temporarly disable
$('#fileList .action').fadeIn(200,function(){
$('#fileList .action').css('-o-transition-property','opacity');
});
return false;
},
hide:function(){
$('#fileList span.fileactions, #fileList td.date a.action').fadeOut(200,function(){
$(this).remove();
});
},
getCurrentFile:function(){
getCurrentFile: function () {
return FileActions.currentFile.parent().attr('data-file');
},
getCurrentMimeType:function(){
getCurrentMimeType: function () {
return FileActions.currentFile.parent().attr('data-mime');
},
getCurrentType:function(){
getCurrentType: function () {
return FileActions.currentFile.parent().attr('data-type');
},
getCurrentPermissions:function() {
getCurrentPermissions: function () {
return FileActions.currentFile.parent().data('permissions');
}
};
$(document).ready(function(){
if($('#allowZipDownload').val() == 1){
$(document).ready(function () {
if ($('#allowZipDownload').val() == 1) {
var downloadScope = 'all';
} else {
var downloadScope = 'file';
}
FileActions.register(downloadScope,'Download', OC.PERMISSION_READ, function(){return OC.imagePath('core','actions/download');},function(filename){
window.location=OC.filePath('files', 'ajax', 'download.php') + '?files='+encodeURIComponent(filename)+'&dir='+encodeURIComponent($('#dir').val());
FileActions.register(downloadScope, 'Download', OC.PERMISSION_READ, function () {
return OC.imagePath('core', 'actions/download');
}, function (filename) {
window.location = OC.filePath('files', 'ajax', 'download.php') + '?files=' + encodeURIComponent(filename) + '&dir=' + encodeURIComponent($('#dir').val());
});
$('#fileList tr').each(function(){
FileActions.display($(this).children('td.filename'));
});
});
FileActions.register('all','Delete', OC.PERMISSION_DELETE, function(){return OC.imagePath('core','actions/delete');},function(filename){
if(Files.cancelUpload(filename)) {
if(filename.substr){
filename=[filename];
FileActions.register('all', 'Delete', OC.PERMISSION_DELETE, function () {
return OC.imagePath('core', 'actions/delete');
}, function (filename) {
if (Files.cancelUpload(filename)) {
if (filename.substr) {
filename = [filename];
}
$.each(filename,function(index,file){
var filename = $('tr').filterAttr('data-file',file);
$.each(filename, function (index, file) {
var filename = $('tr').filterAttr('data-file', file);
filename.hide();
filename.find('input[type="checkbox"]').removeAttr('checked');
filename.removeClass('selected');
});
procesSelection();
}else{
} else {
FileList.do_delete(filename);
}
$('.tipsy').remove();
});
// t('files', 'Rename')
FileActions.register('all','Rename', OC.PERMISSION_UPDATE, function(){return OC.imagePath('core','actions/rename');},function(filename){
FileActions.register('all', 'Rename', OC.PERMISSION_UPDATE, function () {
return OC.imagePath('core', 'actions/rename');
}, function (filename) {
FileList.rename(filename);
});
FileActions.register('dir','Open', OC.PERMISSION_READ, '', function(filename){
window.location=OC.linkTo('files', 'index.php') + '?dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
FileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename) {
window.location = OC.linkTo('files', 'index.php') + '?dir=' + encodeURIComponent($('#dir').val()).replace(/%2F/g, '/') + '/' + encodeURIComponent(filename);
});
FileActions.setDefault('dir','Open');
FileActions.setDefault('dir', 'Open');

View File

@ -62,14 +62,6 @@ $(document).ready(function() {
return false;
});
// Sets the file-action buttons behaviour :
$('tr').live('mouseenter',function(event) {
FileActions.display($(this).children('td.filename'));
});
$('tr').live('mouseleave',function(event) {
FileActions.hide();
});
var lastChecked;
// Sets the file link behaviour :

View File

@ -1,6 +1,13 @@
<?php if(count($_["breadcrumb"])):?>
<div class="crumb">
<a href="<?php echo $_['baseURL'].urlencode($crumb['dir']); ?>">
<img src="<?php echo OCP\image_path('core','places/home.svg');?>" />
</a>
</div>
<?php endif;?>
<?php for($i=0; $i<count($_["breadcrumb"]); $i++):
$crumb = $_["breadcrumb"][$i]; ?>
<div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo urlencode($crumb["dir"]);?>' style='background-image:url("<?php echo OCP\image_path('core','breadcrumb.png');?>")'>
<a href="<?php echo $_['baseURL'].urlencode($crumb["dir"]); ?>"><?php echo OCP\Util::sanitizeHTML($crumb["name"]); ?></a>
<div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo urlencode($crumb["dir"]);?>'>
<a href="<?php echo $_['baseURL'].urlencode($crumb['dir']); ?>"><?php echo OCP\Util::sanitizeHTML($crumb["name"]); ?></a>
</div>
<?php endfor;?>

View File

@ -126,10 +126,11 @@ label.infield { cursor: text !important; }
#notification { z-index:101; background-color:#fc4; border:0; padding:0 .7em .3em; display:none; position:fixed; left:50%; top:0; -moz-border-radius-bottomleft:1em; -webkit-border-bottom-left-radius:1em; border-bottom-left-radius:1em; -moz-border-radius-bottomright:1em; -webkit-border-bottom-right-radius:1em; border-bottom-right-radius:1em; }
#notification span { cursor:pointer; font-weight:bold; margin-left:1em; }
.action, .selectedActions a { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; filter:alpha(opacity=50); opacity:.5; -webkit-transition:opacity 200ms; -moz-transition:opacity 200ms; -o-transition:opacity 200ms; transition:opacity 200ms; }
.action { width: 16px; height: 16px; }
tr .action, .selectedActions a { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter:alpha(opacity=0); opacity:0; -webkit-transition:opacity 200ms; -moz-transition:opacity 200ms; -o-transition:opacity 200ms; transition:opacity 200ms; }
tr:hover .action, .selectedActions a { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; filter:alpha(opacity=50); opacity:.5; }
tr .action { width: 16px; height: 16px; }
.header-action { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; filter:alpha(opacity=80); opacity:.8; }
.action:hover, .selectedActions a:hover, .header-action:hover { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter:alpha(opacity=100); opacity:1; }
tr:hover .action:hover, .selectedActions a:hover, .header-action:hover { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter:alpha(opacity=100); opacity:1; }
table:not(.nostyle) tr { -webkit-transition:background-color 200ms; -moz-transition:background-color 200ms; -o-transition:background-color 200ms; transition:background-color 200ms; }
tbody tr:hover, tr:active { background-color:#f8f8f8; }
@ -190,6 +191,7 @@ a.bookmarklet { background-color: #ddd; border:1px solid #ccc; padding: 5px;padd
.arrow.down { -webkit-transform: rotate(180deg); -moz-transform: rotate(180deg); -o-transform: rotate(180deg); -ms-transform: rotate(180deg); transform: rotate(180deg); }
/* ---- BREADCRUMB ---- */
div.crumb { float:left; display:block; background:no-repeat right 0; padding:.75em 1.5em 0 1em; height:2.9em; }
div.crumb:first-child { padding-left:1em; }
div.crumb.last { font-weight:bold; }
div.crumb { float:left; display:block; background:url('../img/breadcrumb.svg') no-repeat right 0; padding:.75em 1.5em 0 1em; height:2.9em; }
div.crumb:first-child { padding:10px 20px 10px 5px; }
div.crumb.last { font-weight:bold; background:none; padding-right:10px; }
div.crumb a{ padding: 0.9em 0 0.7em 0; }

BIN
core/img/places/files.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 884 B

83
core/img/places/files.svg Normal file
View File

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="32"
id="svg3349"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="home.svg"
inkscape:export-filename="home.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs3351" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="11.2"
inkscape:cx="32.824304"
inkscape:cy="7.991749"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1280"
inkscape:window-height="800"
inkscape:window-x="0"
inkscape:window-y="-31"
inkscape:window-maximized="1" />
<metadata
id="metadata3354">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(573.14286,110.2963)">
<path
inkscape:connector-curvature="0"
d="m -557.14286,-107.23533 -16,15.93883 6,0 0,12.0002 20,0 0,-12.0002 6,0 -6,-6.061184 0,-7.939046 -6,0 0,2.16233 -4,-4.10093 z"
id="path3307"
style="opacity:0.1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<path
style="opacity:0.7;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="path3883"
d="m -557.14286,-108.23534 -16,15.938823 6,0 0,12.0002 20,0 0,-12.0002 6,0 -6,-6.061183 0,-7.93905 -6,0 0,2.16234 -4,-4.10093 z"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
d="m -525.14286,-108.23534 -16,15.938823 6,0 0,12.0002 20,0 0,-12.0002 6,0 -6,-6.061183 0,-7.93905 -6,0 0,2.16234 -4,-4.10093 z"
id="path3328"
style="opacity:0.3;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<path
style="opacity:0.9;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m -525.14286,-109.2343 -16,15.937766 1,0 15,-14.937746 4,4.12507 0,-1.00002 -4,-4.12507 z m 4,1.93753 0,1.00002 6,0 0,-1.00002 -6,0 z m 6,7.937635 0,1.000017 5,5.062584 1,0 -6,-6.062601 z"
id="path3330"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 884 B

After

Width:  |  Height:  |  Size: 364 B

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

@ -483,15 +483,14 @@ $(document).ready(function() {
$('#linkPass').toggle('blind');
});
$('#linkPassText').live('keyup', function(event) {
if (event.keyCode == 13) {
var itemType = $('#dropdown').data('item-type');
var itemSource = $('#dropdown').data('item-source');
OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, $(this).val(), OC.PERMISSION_READ, function() {
$('#linkPassText').val('');
$('#linkPassText').attr('placeholder', t('core', 'Password protected'));
});
}
$('#linkPassText').live('focusout', function(event) {
var itemType = $('#dropdown').data('item-type');
var itemSource = $('#dropdown').data('item-source');
OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, $(this).val(), OC.PERMISSION_READ, function() {
$('#linkPassText').val('');
$('#linkPassText').attr('placeholder', t('core', 'Password protected'));
});
$('#linkPassText').attr('placeholder', t('core', 'Password protected'));
});
$('#expirationCheckbox').live('click', function() {

View File

@ -111,7 +111,7 @@
</p>
<p class="infield">
<label for="dbname" class="infield"><?php echo $l->t( 'Database name' ); ?></label>
<input type="text" name="dbname" id="dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" autocomplete="off" />
<input type="text" name="dbname" id="dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" autocomplete="off" pattern="[0-9a-zA-Z$_]+" />
</p>
</div>
<?php endif; ?>

View File

@ -70,6 +70,9 @@ class OC_Setup {
if(empty($options['dbname'])) {
$error[] = "$dbprettyname enter the database name.";
}
if(substr_count($options['dbname'], '.') >= 1){
$error[] = "$dbprettyname you may not use dots in the database name";
}
if($dbtype != 'oci' && empty($options['dbhost'])) {
$error[] = "$dbprettyname set the database host.";
}

View File

@ -21,6 +21,22 @@
*
*/
/**
* Prints an XSS escaped string
* @param string $string the string which will be escaped and printed
*/
function p($string){
print(OC_Util::sanitizeHTML($string));
}
/**
* Prints an unescaped string
* @param string $string the string which will be printed as it is
*/
function print_unescaped($string){
print($string);
}
/**
* @brief make OC_Helper::linkTo available as a simple function
* @param string $app app

View File

@ -24,6 +24,11 @@ class OC_Util {
$user = OC_User::getUser();
}
// load all filesystem apps before, so no setup-hook gets lost
if(!$RUNTIME_NOAPPS) {
OC_App::loadApps(array('filesystem'));
}
// the filesystem will finish when $user is not empty,
// mark fs setup here to avoid doing the setup from loading
// OC_Filesystem
@ -62,7 +67,7 @@ class OC_Util {
OC_Filesystem::tearDown();
self::$fsSetup=false;
}
public static function loadUserMountPoints($user) {
$user_dir = '/'.$user.'/files';
$user_root = OC_User::getHome($user);
@ -74,14 +79,14 @@ class OC_Util {
OC_Filesystem::mount($options['class'], $options['options'], $mountPoint);
}
}
$mtime=filemtime($user_root.'/mount.php');
$previousMTime=OC_Preferences::getValue($user,'files','mountconfigmtime',0);
if($mtime>$previousMTime) {//mount config has changed, filecache needs to be updated
OC_FileCache::triggerUpdate($user);
OC_Preferences::setValue($user,'files','mountconfigmtime',$mtime);
}
}
}
}
/**
@ -429,7 +434,7 @@ class OC_Util {
}
return true;
}
/**
* Redirect to the user default page
*/