2008-09-18
svend
Hello,
I've thought about this as well and a different style for links to nonexisting media files would be quite useful.
I did a modification and the only thing that have to be done is to add a line to the internalmedia() function
in xhtml.php
}else{
// add file icons
$class = preg_replace('/[^_\-a-z0-9]+/i','_',$ext);
$link['class'] .= ' mediafile mf_'.$class;
$link['url'] = ml($src,array('id'=>$ID,'cache'=>$cache),true);
if (!$exists) $link['class'] .= ' broken_link'; // this is the added line
}
and then to modify the css file to reflect the new broken_link class, the place that worked for me was
the lib\exe\css.php 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: 18px;';
echo ' padding-bottom: 1px;';
echo '}';
echo 'a.broken_link { //this was added
color: __missing__ !important;
text-decoration: none !important;
border-bottom: dashed 1px __missing__ !important;
}';
Maybe there's a nicer way to do this, but this works quite fine and I'm sure other users would appreciate it as well.
And thanks for all the great work you're doing.
Sven