Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
d22f805b
Commit
d22f805b
authored
12 years ago
by
Brice Maron
Browse files
Options
Downloads
Patches
Plain Diff
Correct inclusion paths
parent
e5c56b24
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/templatelayout.php
+42
-17
42 additions, 17 deletions
lib/templatelayout.php
remote.php
+3
-4
3 additions, 4 deletions
remote.php
with
45 additions
and
21 deletions
lib/templatelayout.php
+
42
−
17
View file @
d22f805b
...
...
@@ -9,6 +9,7 @@
class
OC_TemplateLayout
extends
OC_Template
{
public
function
__construct
(
$renderas
){
// Decide which page we show
if
(
$renderas
==
'user'
){
parent
::
__construct
(
'core'
,
'layout.user'
);
$this
->
assign
(
'searchurl'
,
OC_Helper
::
linkTo
(
'search'
,
'index.php'
),
false
);
...
...
@@ -32,6 +33,12 @@ class OC_TemplateLayout extends OC_Template {
parent
::
__construct
(
'core'
,
'layout.guest'
);
}
$apps_paths
=
array
();
foreach
(
OC_App
::
getEnabledApps
()
as
$app
){
$apps_paths
[
$app
]
=
OC_App
::
getAppWebPath
(
$app
);
}
$this
->
assign
(
'apps_paths'
,
str_replace
(
'\\/'
,
'/'
,
json_encode
(
$apps_paths
)),
false
);
// Ugly unescape slashes waiting for better solution
// Add the js files
$jsfiles
=
self
::
findJavascriptFiles
(
OC_Util
::
$scripts
);
$this
->
assign
(
'jsfiles'
,
array
(),
false
);
...
...
@@ -44,19 +51,29 @@ class OC_TemplateLayout extends OC_Template {
// Add the css files
$cssfiles
=
self
::
findStylesheetFiles
(
OC_Util
::
$styles
);
$this
->
assign
(
'cssfiles'
,
array
());
foreach
(
$cssfiles
as
$info
)
{
$root
=
$info
[
0
];
$web
=
$info
[
1
];
$file
=
$info
[
2
];
$paths
=
explode
(
'/'
,
$file
);
if
(
$root
==
OC
::
$APPSROOT
&&
$paths
[
0
]
==
'apps'
){
$app
=
$paths
[
1
];
$in_root
=
false
;
foreach
(
OC
::
$APPSROOTS
as
$app_root
)
{
if
(
$root
==
$app_root
[
'path'
])
{
$in_root
=
true
;
break
;
}
}
if
(
$in_root
)
{
$app
=
$paths
[
0
];
unset
(
$paths
[
0
]);
unset
(
$paths
[
1
]);
$path
=
implode
(
'/'
,
$paths
);
$this
->
append
(
'cssfiles'
,
OC_Helper
::
linkTo
(
$app
,
$path
));
}
else
{
}
else
{
$this
->
append
(
'cssfiles'
,
$web
.
'/'
.
$file
);
}
}
...
...
@@ -89,10 +106,6 @@ class OC_TemplateLayout extends OC_Template {
// is it in 3rdparty?
if
(
self
::
appendIfExist
(
$files
,
OC
::
$THIRDPARTYROOT
,
OC
::
$THIRDPARTYWEBROOT
,
$style
.
'.css'
))
{
// or in apps?
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$APPSROOT
,
OC
::
$APPSWEBROOT
,
"apps/
$style$fext
.css"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$APPSROOT
,
OC
::
$APPSWEBROOT
,
"apps/
$style
.css"
))
{
// or in the owncloud root?
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"
$style$fext
.css"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"
$style
.css"
))
{
...
...
@@ -102,10 +115,19 @@ class OC_TemplateLayout extends OC_Template {
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"core/
$style
.css"
))
{
}
else
{
echo
(
'css file not found: style:'
.
$style
.
' formfactor:'
.
$fext
.
' webroot:'
.
OC
::
$WEBROOT
.
' serverroot:'
.
OC
::
$SERVERROOT
);
$append
=
false
;
// or in apps?
foreach
(
OC
::
$APPSROOTS
as
$apps_dir
)
{
if
(
self
::
appendIfExist
(
$files
,
$apps_dir
[
'path'
],
$apps_dir
[
'url'
],
"
$style$fext
.css"
))
{
$append
=
true
;
break
;
}
elseif
(
self
::
appendIfExist
(
$files
,
$apps_dir
[
'path'
],
$apps_dir
[
'url'
],
"
$style
.css"
))
{
$append
=
true
;
break
;
}
}
if
(
!
$append
)
{
echo
(
'css file not found: style:'
.
$script
.
' formfactor:'
.
$fext
.
' webroot:'
.
OC
::
$WEBROOT
.
' serverroot:'
.
OC
::
$SERVERROOT
);
die
();
}
}
}
// Add the theme css files. you can override the default values here
if
(
!
empty
(
$theme
))
{
foreach
(
$styles
as
$style
){
...
...
@@ -139,10 +161,6 @@ class OC_TemplateLayout extends OC_Template {
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/apps/
$script$fext
.js"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/apps/
$script
.js"
))
{
// Is it part of an app?
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$APPSROOT
,
OC
::
$APPSWEBROOT
,
"apps/
$script$fext
.js"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$APPSROOT
,
OC
::
$APPSWEBROOT
,
"apps/
$script
.js"
))
{
// Is it in the owncloud root but overwritten by the theme?
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/
$script$fext
.js"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/
$script
.js"
))
{
...
...
@@ -160,9 +178,16 @@ class OC_TemplateLayout extends OC_Template {
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"core/
$script
.js"
))
{
}
else
{
// Is it part of an app?
$append
=
false
;
foreach
(
OC
::
$APPSROOTS
as
$apps_dir
)
{
if
(
self
::
appendIfExist
(
$files
,
$apps_dir
[
'path'
],
$apps_dir
[
'url'
],
"
$script$fext
.js"
))
{
$append
=
true
;
break
;
}
elseif
(
self
::
appendIfExist
(
$files
,
$apps_dir
[
'path'
],
$apps_dir
[
'url'
],
"
$script
.js"
))
{
$append
=
true
;
break
;
}
}
if
(
!
$append
)
{
echo
(
'js file not found: script:'
.
$script
.
' formfactor:'
.
$fext
.
' webroot:'
.
OC
::
$WEBROOT
.
' serverroot:'
.
OC
::
$SERVERROOT
);
die
();
}
}
}
return
$files
;
...
...
This diff is collapsed.
Click to expand it.
remote.php
+
3
−
4
View file @
d22f805b
...
...
@@ -20,7 +20,6 @@ if(is_null($file)){
OC_Response
::
setStatus
(
OC_Response
::
STATUS_NOT_FOUND
);
exit
;
}
if
(
count
(
explode
(
'/'
,
$file
))
==
3
)
{
$parts
=
explode
(
'/'
,
$file
);
$app
=
$parts
[
2
];
...
...
@@ -28,9 +27,9 @@ if(count(explode('/',$file)) == 3) {
$baseuri
=
OC
::
$WEBROOT
.
'/remote.php/'
.
$service
.
'/'
;
require_once
(
OC
::
$SERVERROOT
.
$file
);
}
else
{
$parts
=
explode
(
'/'
,
$file
,
2
);
$app
=
$parts
[
0
];
$parts
=
explode
(
'/'
,
$file
,
4
);
$app
=
$parts
[
2
];
OC_App
::
loadApp
(
$app
);
$baseuri
=
OC
::
$WEBROOT
.
'/remote.php/'
.
$service
.
'/'
;
require_once
(
OC_App
::
getAppPath
(
$app
)
.
'/'
.
$parts
[
1
]);
require_once
(
OC_App
::
getAppPath
(
$app
)
.
'/'
.
$parts
[
3
]);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment