Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
BRIC
dokuwiki
Commits
d15166e5
Commit
d15166e5
authored
19 years ago
by
Andreas Gohr
Browse files
Options
Downloads
Patches
Plain Diff
use classes for file icons like in interwiki links
darcs-hash:20051105155911-7ad00-ecba6272c534f73fc1ace47152187be87ef7c6d3.gz
parent
9ab75d9e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
inc/parser/xhtml.php
+2
-18
2 additions, 18 deletions
inc/parser/xhtml.php
lib/exe/css.php
+29
-1
29 additions, 1 deletion
lib/exe/css.php
with
31 additions
and
19 deletions
inc/parser/xhtml.php
+
2
−
18
View file @
d15166e5
...
...
@@ -703,22 +703,13 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$link
[
'title'
]
=
$this
->
_xmlEntities
(
$src
);
list
(
$ext
,
$mime
)
=
mimetype
(
$src
);
if
(
substr
(
$mime
,
0
,
5
)
==
'image'
){
// link only jpeg images
// if ($ext != 'jpg' && $ext != 'jpeg') $noLink = TRUE;
$link
[
'url'
]
=
ml
(
$src
,
array
(
'id'
=>
$ID
,
'cache'
=>
$cache
),(
$linking
==
'direct'
));
}
elseif
(
$mime
==
'application/x-shockwave-flash'
){
// don't link flash movies
$noLink
=
TRUE
;
}
else
{
// add file icons
$link
[
'class'
]
=
'urlextern'
;
if
(
@
file_exists
(
DOKU_INC
.
'lib/images/fileicons/'
.
$ext
.
'.png'
)){
$link
[
'style'
]
=
'background-image: url('
.
DOKU_BASE
.
'lib/images/fileicons/'
.
$ext
.
'.png)'
;
}
elseif
(
@
file_exists
(
DOKU_INC
.
'lib/images/fileicons/'
.
$ext
.
'.gif'
)){
$link
[
'style'
]
=
'background-image: url('
.
DOKU_BASE
.
'lib/images/fileicons/'
.
$ext
.
'.gif)'
;
}
else
{
$link
[
'style'
]
=
'background-image: url('
.
DOKU_BASE
.
'lib/images/fileicons/file.png)'
;
}
$link
[
'class'
]
.
=
' mediafile mf_'
.
$ext
;
$link
[
'url'
]
=
ml
(
$src
,
array
(
'id'
=>
$ID
,
'cache'
=>
$cache
),
true
);
}
$link
[
'name'
]
=
$this
->
_media
(
$src
,
$title
,
$align
,
$width
,
$height
,
$cache
);
...
...
@@ -757,14 +748,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$noLink
=
TRUE
;
}
else
{
// add file icons
$link
[
'class'
]
=
'urlextern'
;
if
(
@
file_exists
(
DOKU_INC
.
'lib/images/fileicons/'
.
$ext
.
'.png'
)){
$link
[
'style'
]
=
'background-image: url('
.
DOKU_BASE
.
'lib/images/fileicons/'
.
$ext
.
'.png)'
;
}
elseif
(
@
file_exists
(
DOKU_INC
.
'lib/images/fileicons/'
.
$ext
.
'.gif'
)){
$link
[
'style'
]
=
'background-image: url('
.
DOKU_BASE
.
'lib/images/fileicons/'
.
$ext
.
'.gif)'
;
}
else
{
$link
[
'style'
]
=
'background-image: url('
.
DOKU_BASE
.
'lib/images/fileicons/file.png)'
;
}
$link
[
'class'
]
.
=
' mediafile mf_'
.
$ext
;
}
//output formatted
...
...
This diff is collapsed.
Click to expand it.
lib/exe/css.php
+
29
−
1
View file @
d15166e5
...
...
@@ -66,8 +66,9 @@ function css_out(){
// start output buffering and build the stylesheet
ob_start
();
// print the default classes for
I
nterwikilinks
// print the default classes for
i
nterwiki
links
and file downloads
css_interwiki
();
css_filetypes
();
// load files
foreach
(
$files
as
$file
=>
$location
){
...
...
@@ -163,7 +164,34 @@ function css_interwiki(){
echo
'}'
;
}
}
}
/**
* Prints classes for file download links
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function
css_filetypes
(){
// default style
echo
'a.mediafile {'
;
echo
' background: transparent url('
.
DOKU_BASE
.
'lib/images/fileicons/file.png) 0px 1px no-repeat;'
;
echo
' padding-left: 16px;'
;
echo
'}'
;
// additional styles when icon available
$mimes
=
getMimeTypes
();
foreach
(
array_keys
(
$mimes
)
as
$mime
){
if
(
@
file_exists
(
DOKU_INC
.
'lib/images/fileicons/'
.
$mime
.
'.png'
)){
echo
"a.mf_
$mime
{"
;
echo
' background-image: url('
.
DOKU_BASE
.
'lib/images/fileicons/'
.
$mime
.
'.png)'
;
echo
'}'
;
}
elseif
(
@
file_exists
(
DOKU_INC
.
'lib/images/fileicons/'
.
$mime
.
'.gif'
)){
echo
"a.mf_
$mime
{"
;
echo
' background-image: url('
.
DOKU_BASE
.
'lib/images/fileicons/'
.
$mime
.
'.gif)'
;
echo
'}'
;
}
}
}
/**
...
...
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