summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-04-26 14:52:55 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-04-26 14:52:55 +0200
commit3f64eb25ab89964127681a52265207dbeb7e1e9b (patch)
tree183f713b4d443f77b5d5bd05350ce069eecb79f0
parentb75f680b8e560be82f5c63bfc5480452a3de12d9 (diff)
downloadnextcloud-server-3f64eb25ab89964127681a52265207dbeb7e1e9b.tar.gz
nextcloud-server-3f64eb25ab89964127681a52265207dbeb7e1e9b.zip
some fixes fore movable apps
-rw-r--r--apps/bookmarks/templates/list.php2
-rw-r--r--apps/files/css/files.css4
-rw-r--r--apps/files_imageviewer/css/jquery.fancybox-1.3.4.css66
-rw-r--r--apps/gallery/css/sharing.css2
-rw-r--r--core/js/js.js2
-rw-r--r--core/js/oc-dialogs.js4
-rw-r--r--index.php6
-rw-r--r--lib/base.php15
-rwxr-xr-xlib/helper.php4
-rw-r--r--lib/template.php11
10 files changed, 67 insertions, 49 deletions
diff --git a/apps/bookmarks/templates/list.php b/apps/bookmarks/templates/list.php
index 1abdbb7f838..9fe9ee7a9a9 100644
--- a/apps/bookmarks/templates/list.php
+++ b/apps/bookmarks/templates/list.php
@@ -20,7 +20,7 @@
<div id="firstrun" style="display: none;">
<?php
echo $l->t('You have no bookmarks');
- require_once('bookmarklet.php');
+ require_once(OC::$APPSROOT . '/apps/bookmarks/templates/bookmarklet.php');
createBookmarklet();
?>
</div>
diff --git a/apps/files/css/files.css b/apps/files/css/files.css
index 445b50db09d..99623b6355e 100644
--- a/apps/files/css/files.css
+++ b/apps/files/css/files.css
@@ -20,7 +20,7 @@
#new>ul>li>p { cursor:pointer; }
#new>ul>li>input { padding:0.3em; margin:-0.3em; }
-#file_newfolder_name { background-image:url('../../../core/img/places/folder.svg'); font-weight:normal; width:7em; }
+#file_newfolder_name { background-image:url('%webroot%/core/img/places/folder.svg'); font-weight:normal; width:7em; }
.file_upload_start, .file_upload_filename { font-size:1em; }
#file_newfolder_submit, #file_upload_submit { width:3em; }
.file_upload_target { display:none; }
@@ -81,7 +81,7 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; }
.selectedActions a img { position:relative; top:.3em; }
/* add breadcrumb divider to the File item in navigation panel */
-#navigation>ul>li:first-child { background:url('../../../core/img/breadcrumb-start.svg') no-repeat 12.5em 0px; width:12.5em; padding-right:1em; position:fixed; }
+#navigation>ul>li:first-child { background:url('%webroot%/core/img/breadcrumb-start.svg') no-repeat 12.5em 0px; width:12.5em; padding-right:1em; position:fixed; }
#navigation>ul>li:first-child+li { padding-top:2.9em; }
#scanning-message{ top:40%; left:40%; position:absolute; display:none }
diff --git a/apps/files_imageviewer/css/jquery.fancybox-1.3.4.css b/apps/files_imageviewer/css/jquery.fancybox-1.3.4.css
index 1dfd9b95d35..5fdf7af14cb 100644
--- a/apps/files_imageviewer/css/jquery.fancybox-1.3.4.css
+++ b/apps/files_imageviewer/css/jquery.fancybox-1.3.4.css
@@ -35,7 +35,7 @@
left: 0;
width: 40px;
height: 480px;
- background-image: url('../img/fancybox.png');
+ background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox.png');
}
#fancybox-overlay {
@@ -99,7 +99,7 @@
right: -15px;
width: 30px;
height: 30px;
- background: transparent url('../img/fancybox.png') -40px 0px;
+ background: transparent url('%appswebroot%/apps/files_imageviewer/img/fancybox.png') -40px 0px;
cursor: pointer;
z-index: 1103;
display: none;
@@ -137,7 +137,7 @@
width: 35%;
cursor: pointer;
outline: none;
- background: transparent url('../img/blank.gif');
+ background: transparent url('%appswebroot%/apps/files_imageviewer/img/blank.gif');
z-index: 1102;
display: none;
}
@@ -163,12 +163,12 @@
}
#fancybox-left-ico {
- background-image: url('../img/fancybox.png');
+ background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox.png');
background-position: -40px -30px;
}
#fancybox-right-ico {
- background-image: url('../img/fancybox.png');
+ background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox.png');
background-position: -40px -60px;
}
@@ -199,13 +199,13 @@
top: -20px;
left: 0;
width: 100%;
- background-image: url('../img/fancybox-x.png');
+ background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox-x.png');
}
#fancybox-bg-ne {
top: -20px;
right: -20px;
- background-image: url('../img/fancybox.png');
+ background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox.png');
background-position: -40px -162px;
}
@@ -213,14 +213,14 @@
top: 0;
right: -20px;
height: 100%;
- background-image: url('../img/fancybox-y.png');
+ background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox-y.png');
background-position: -20px 0px;
}
#fancybox-bg-se {
bottom: -20px;
right: -20px;
- background-image: url('../img/fancybox.png');
+ background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox.png');
background-position: -40px -182px;
}
@@ -228,14 +228,14 @@
bottom: -20px;
left: 0;
width: 100%;
- background-image: url('../img/fancybox-x.png');
+ background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox-x.png');
background-position: 0px -20px;
}
#fancybox-bg-sw {
bottom: -20px;
left: -20px;
- background-image: url('../img/fancybox.png');
+ background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox.png');
background-position: -40px -142px;
}
@@ -243,13 +243,13 @@
top: 0;
left: -20px;
height: 100%;
- background-image: url('../img/fancybox-y.png');
+ background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox-y.png');
}
#fancybox-bg-nw {
top: -20px;
left: -20px;
- background-image: url('../img/fancybox.png');
+ background-image: url('%appswebroot%/apps/files_imageviewer/img/fancybox.png');
background-position: -40px -122px;
}
@@ -282,7 +282,7 @@
#fancybox-title-over {
padding: 10px;
- background-image: url('../img/fancy_title_over.png');
+ background-image: url('%appswebroot%/apps/files_imageviewer/img/fancy_title_over.png');
display: block;
}
@@ -306,7 +306,7 @@
#fancybox-title-float-left {
padding: 0 0 0 15px;
- background: url('../img/fancybox.png') -40px -90px no-repeat;
+ background: url('%appswebroot%/apps/files_imageviewer/img/fancybox.png') -40px -90px no-repeat;
}
#fancybox-title-float-main {
@@ -314,25 +314,25 @@
line-height: 29px;
font-weight: bold;
padding: 0 0 3px 0;
- background: url('../img/fancybox-x.png') 0px -40px;
+ background: url('%appswebroot%/apps/files_imageviewer/img/fancybox-x.png') 0px -40px;
}
#fancybox-title-float-right {
padding: 0 0 0 15px;
- background: url('../img/fancybox.png') -55px -90px no-repeat;
+ background: url('%appswebroot%/apps/files_imageviewer/img/fancybox.png') -55px -90px no-repeat;
}
/* IE6 */
-.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../img/fancy_close.png', sizingMethod='scale'); }
+.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_close.png', sizingMethod='scale'); }
-.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../img/fancy_nav_left.png', sizingMethod='scale'); }
-.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../img/fancy_nav_right.png', sizingMethod='scale'); }
+.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_nav_left.png', sizingMethod='scale'); }
+.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_nav_right.png', sizingMethod='scale'); }
-.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../img/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
-.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../img/fancy_title_left.png', sizingMethod='scale'); }
-.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../img/fancy_title_main.png', sizingMethod='scale'); }
-.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../img/fancy_title_right.png', sizingMethod='scale'); }
+.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
+.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_title_left.png', sizingMethod='scale'); }
+.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_title_main.png', sizingMethod='scale'); }
+.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_title_right.png', sizingMethod='scale'); }
.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame {
height: expression(this.parentNode.clientHeight + "px");
@@ -343,17 +343,17 @@
top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px');
}
-#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../img/fancy_loading.png', sizingMethod='scale'); }
+#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_loading.png', sizingMethod='scale'); }
/* IE6, IE7, IE8 */
.fancybox-ie .fancybox-bg { background: transparent !important; }
-.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../img/fancy_shadow_n.png', sizingMethod='scale'); }
-.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../img/fancy_shadow_ne.png', sizingMethod='scale'); }
-.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../img/fancy_shadow_e.png', sizingMethod='scale'); }
-.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../img/fancy_shadow_se.png', sizingMethod='scale'); }
-.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../img/fancy_shadow_s.png', sizingMethod='scale'); }
-.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../img/fancy_shadow_sw.png', sizingMethod='scale'); }
-.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../img/fancy_shadow_w.png', sizingMethod='scale'); }
-.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../img/fancy_shadow_nw.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_shadow_n.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_shadow_ne.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_shadow_e.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_shadow_se.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_shadow_s.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_shadow_sw.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_shadow_w.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%appswebroot%/apps/files_imageviewer/img/fancy_shadow_nw.png', sizingMethod='scale'); }
diff --git a/apps/gallery/css/sharing.css b/apps/gallery/css/sharing.css
index eaac82ebd60..d061fc3e6c1 100644
--- a/apps/gallery/css/sharing.css
+++ b/apps/gallery/css/sharing.css
@@ -5,4 +5,4 @@ div.gallery_box:hover { color: black; }
div.gallery_box h1 {font-size: 17px; font-weight: normal;}
div#breadcrumb { border: 0; width: 70%; margin: 0 auto; padding: 25px 0; font-family: Verdana; text-align: center;}
span.breadcrumbelement { margin: 10px; margin-right: 0; cursor: pointer;}
-span.inside { background-image: url('../img/breadcrumb.png'); padding-left: 20px; background-position: left; background-repeat: no-repeat;}
+span.inside { background-image: url('%appswebroot%/apps/gallery/img/breadcrumb.png'); padding-left: 20px; background-position: left; background-repeat: no-repeat;}
diff --git a/core/js/js.js b/core/js/js.js
index a4369deb283..12303d7dd91 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -53,7 +53,7 @@ OC={
filePath:function(app,type,file){
var isCore=OC.coreApps.indexOf(app)!=-1;
var link=OC.webroot;
- if(file.substring(file.length-3) == 'php' && !isCore){
+ if((file.substring(file.length-3) == 'php' || file.substring(file.length-3) == 'css') && !isCore){
link+='/?app=' + app + '&getfile=';
if(type){
link+=encodeURI(type + '/');
diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js
index a3aa1e8c149..6a3dac02ea7 100644
--- a/core/js/oc-dialogs.js
+++ b/core/js/oc-dialogs.js
@@ -107,7 +107,7 @@ OCdialogs = {
$(c_id + ' #dirtree').focus(function() { var t = $(this); t.data('oldval', t.val())})
.change({dcid: c_id}, OC.dialogs.handleTreeListSelect);
$(c_id).ready(function(){
- $.getJSON(OC.webroot+'/files/ajax/rawlist.php', {mimetype: mimetype_filter} ,function(r){OC.dialogs.fillFilePicker(r, c_id, callback)});
+ $.getJSON(OC.filePath('files', 'ajax', 'rawlist.php'), {mimetype: mimetype_filter} ,function(r){OC.dialogs.fillFilePicker(r, c_id, callback)});
}).data('multiselect', multiselect).data('mimetype',mimetype_filter);
// build buttons
var b = [
@@ -222,7 +222,7 @@ OCdialogs = {
$(this).children().each(function(i, element) { if (skip_first) {skip_first = false; return; }path += '/'+$(element).text(); });
$(event.data.dcid).data('path', path);
$(event.data.dcid + ' .filepicker_loader').css('visibility', 'visible');
- $.getJSON(OC.webroot+'/files/ajax/rawlist.php', {dir: path, mimetype: $(event.data.dcid).data('mimetype')}, function(r){OC.dialogs.fillFilePicker(r, event.data.dcid)});
+ $.getJSON(OC.filePath('files', 'ajax', 'rawlist.php'), {dir: path, mimetype: $(event.data.dcid).data('mimetype')}, function(r){OC.dialogs.fillFilePicker(r, event.data.dcid)});
},
// this function is in early development state, please dont use it unlsess you know what you are doing
handlePickerClick:function(element, name, dcid) {
diff --git a/index.php b/index.php
index a3835c6d2f3..787485555fb 100644
--- a/index.php
+++ b/index.php
@@ -50,14 +50,12 @@ if($_SERVER['REQUEST_METHOD']=='PROPFIND'){
// Someone is logged in :
elseif(OC_User::isLoggedIn()) {
+ OC_App::loadApps();
if(isset($_GET["logout"]) and ($_GET["logout"])) {
- OC_App::loadApps();
OC_User::logout();
header("Location: ".OC::$WEBROOT.'/');
exit();
- }
- else {
- OC_App::loadApps();
+ }else{
if(is_null(OC::$REQUESTEDFILE)){
OC::loadapp();
}else{
diff --git a/lib/base.php b/lib/base.php
index c8a99d3ac30..bb6dc3d8d70 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -279,13 +279,24 @@ class OC{
if(file_exists(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP)){
require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/index.php');
}else{
- trigger_error('The requested App was not found.', E_USER_ERROR);
+ trigger_error('The requested App was not found.', E_USER_ERROR);//load default app instead?
}
}
public static function loadfile(){
if(file_exists(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE)){
- require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE);
+ if(substr(OC::$REQUESTEDFILE, -3) == 'css'){
+ $appswebroot = (string) OC::$APPSWEBROOT;
+ $webroot = (string) OC::$WEBROOT;
+ $cssfile = file_get_contents(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE);
+ $cssfile = str_replace('%appswebroot%', $appswebroot, $cssfile);
+ $cssfile = str_replace('%webroot%', $webroot, $cssfile);
+ header('Content-Type: text/css');
+ echo $cssfile;
+ exit;
+ }elseif(substr(OC::$REQUESTEDFILE, -3) == 'php'){
+ require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE);
+ }
}else{
header('HTTP/1.0 404 Not Found');
exit;
diff --git a/lib/helper.php b/lib/helper.php
index 2bc738e6650..a89aa4d37fc 100755
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -41,11 +41,11 @@ class OC_Helper {
$app .= '/';
// Check if the app is in the app folder
if( file_exists( OC::$APPSROOT . '/apps/'. $app.$file )){
- if(substr($file, -3) == 'php'){
+ if(substr($file, -3) == 'php' || substr($file, -3) == 'css'){
if(substr($app, -1, 1) == '/'){
$app = substr($app, 0, strlen($app) - 1);
}
- $urlLinkTo = OC::$APPSWEBROOT . '/?app=' . $app;
+ $urlLinkTo = OC::$WEBROOT . '/?app=' . $app;
$urlLinkTo .= ($file!='index.php')?'&getfile=' . urlencode($file):'';
}else{
$urlLinkTo = OC::$APPSWEBROOT . '/apps/' . $app . $file;
diff --git a/lib/template.php b/lib/template.php
index eeba2410b68..eccf011e8d2 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -323,7 +323,16 @@ class OC_Template{
*/
public function appendIfExist($type, $root, $web, $file) {
if (is_file($root.'/'.$file)) {
- $this->append( $type, $web.'/'.$file);
+ if($type == 'cssfiles' && $root == OC::$APPSROOT){
+ $pathes = explode('/', $file);
+ $app = $pathes['1'];
+ unset($pathes['0']);
+ unset($pathes['1']);
+ $path = implode('/', $pathes);
+ $this->append( $type, OC_Helper::linkTo($app, $path));
+ }else{
+ $this->append( $type, $web.'/'.$file);
+ }
return true;
}
return false;