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
3000e8f9
Commit
3000e8f9
authored
12 years ago
by
Bart Visscher
Browse files
Options
Downloads
Patches
Plain Diff
Prepare template js and css functions for use in the js and css minimizers
parent
180243d9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/templatelayout.php
+32
-32
32 additions, 32 deletions
lib/templatelayout.php
with
32 additions
and
32 deletions
lib/templatelayout.php
+
32
−
32
View file @
3000e8f9
...
...
@@ -32,8 +32,8 @@ class OC_TemplateLayout extends OC_Template {
parent
::
__construct
(
'core'
,
'layout.guest'
);
}
// Add the
core
js files
or the js files provided by the selected theme
$jsfiles
=
$this
->
findS
cripts
(
OC_Util
::
$scripts
);
// Add the js files
$jsfiles
=
self
::
findJavas
cript
File
s
(
OC_Util
::
$scripts
);
$this
->
assign
(
'jsfiles'
,
array
(),
false
);
foreach
(
$jsfiles
as
$info
)
{
$root
=
$info
[
0
];
...
...
@@ -43,7 +43,7 @@ class OC_TemplateLayout extends OC_Template {
}
// Add the css files
$cssfiles
=
$this
->
findSty
les
(
OC_Util
::
$styles
);
$cssfiles
=
self
::
findStylesheetFi
les
(
OC_Util
::
$styles
);
$this
->
assign
(
'cssfiles'
,
array
());
foreach
(
$cssfiles
as
$info
)
{
$root
=
$info
[
0
];
...
...
@@ -69,7 +69,7 @@ class OC_TemplateLayout extends OC_Template {
* @param $web base for path
* @param $file the filename
*/
public
function
appendIfExist
(
&
$files
,
$root
,
$webroot
,
$file
)
{
static
public
function
appendIfExist
(
&
$files
,
$root
,
$webroot
,
$file
)
{
if
(
is_file
(
$root
.
'/'
.
$file
))
{
$files
[]
=
array
(
$root
,
$webroot
,
$file
);
return
true
;
...
...
@@ -77,7 +77,7 @@ class OC_TemplateLayout extends OC_Template {
return
false
;
}
public
function
findStyles
(
$styles
){
static
public
function
findStyles
heetFiles
(
$styles
){
// Read the selected theme from the config file
$theme
=
OC_Config
::
getValue
(
'theme'
);
...
...
@@ -87,19 +87,19 @@ class OC_TemplateLayout extends OC_Template {
$files
=
array
();
foreach
(
$styles
as
$style
){
// is it in 3rdparty?
if
(
$this
->
appendIfExist
(
$files
,
OC
::
$THIRDPARTYROOT
,
OC
::
$THIRDPARTYWEBROOT
,
$style
.
'.css'
))
{
if
(
self
::
appendIfExist
(
$files
,
OC
::
$THIRDPARTYROOT
,
OC
::
$THIRDPARTYWEBROOT
,
$style
.
'.css'
))
{
// or in apps?
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$APPSROOT
,
OC
::
$APPSWEBROOT
,
"apps/
$style$fext
.css"
))
{
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$APPSROOT
,
OC
::
$APPSWEBROOT
,
"apps/
$style
.css"
))
{
}
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
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"
$style$fext
.css"
))
{
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"
$style
.css"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"
$style$fext
.css"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"
$style
.css"
))
{
// or in core ?
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"core/
$style$fext
.css"
))
{
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"core/
$style
.css"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"core/
$style$fext
.css"
))
{
}
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
);
...
...
@@ -109,21 +109,21 @@ class OC_TemplateLayout extends OC_Template {
// Add the theme css files. you can override the default values here
if
(
!
empty
(
$theme
))
{
foreach
(
$styles
as
$style
){
if
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/apps/
$style$fext
.css"
))
{
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/apps/
$style
.css"
))
{
if
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/apps/
$style$fext
.css"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/apps/
$style
.css"
))
{
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/
$style$fext
.css"
))
{
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/
$style
.css"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/
$style$fext
.css"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/
$style
.css"
))
{
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/core/
$style$fext
.css"
))
{
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/core/
$style
.css"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/core/
$style$fext
.css"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/core/
$style
.css"
))
{
}
}
}
return
$files
;
}
public
function
find
S
cripts
(
$scripts
){
static
public
function
find
Javas
cript
File
s
(
$scripts
){
// Read the selected theme from the config file
$theme
=
OC_Config
::
getValue
(
'theme'
);
...
...
@@ -133,31 +133,31 @@ class OC_TemplateLayout extends OC_Template {
$files
=
array
();
foreach
(
$scripts
as
$script
){
// Is it in 3rd party?
if
(
$this
->
appendIfExist
(
$files
,
OC
::
$THIRDPARTYROOT
,
OC
::
$THIRDPARTYWEBROOT
,
$script
.
'.js'
))
{
if
(
self
::
appendIfExist
(
$files
,
OC
::
$THIRDPARTYROOT
,
OC
::
$THIRDPARTYWEBROOT
,
$script
.
'.js'
))
{
// Is it in apps and overwritten by the theme?
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/apps/
$script$fext
.js"
))
{
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/apps/
$script
.js"
))
{
}
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
(
$this
->
appendIfExist
(
$files
,
OC
::
$APPSROOT
,
OC
::
$APPSWEBROOT
,
"apps/
$script$fext
.js"
))
{
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$APPSROOT
,
OC
::
$APPSWEBROOT
,
"apps/
$script
.js"
))
{
}
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
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/
$script$fext
.js"
))
{
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/
$script
.js"
))
{
}
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"
))
{
// Is it in the owncloud root ?
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"
$script$fext
.js"
))
{
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"
$script
.js"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"
$script$fext
.js"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"
$script
.js"
))
{
// Is in core but overwritten by a theme?
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/core/
$script$fext
.js"
))
{
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/core/
$script
.js"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/core/
$script$fext
.js"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"themes/
$theme
/core/
$script
.js"
))
{
// Is it in core?
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"core/
$script$fext
.js"
))
{
}
elseif
(
$this
->
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"core/
$script
.js"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"core/
$script$fext
.js"
))
{
}
elseif
(
self
::
appendIfExist
(
$files
,
OC
::
$SERVERROOT
,
OC
::
$WEBROOT
,
"core/
$script
.js"
))
{
}
else
{
echo
(
'js file not found: script:'
.
$script
.
' formfactor:'
.
$fext
.
' webroot:'
.
OC
::
$WEBROOT
.
' serverroot:'
.
OC
::
$SERVERROOT
);
...
...
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