/**
* Renders internal and external media
*
* @author Andreas Gohr
*/
function _media ($src, $title=NULL, $align=NULL, $width=NULL,
$height=NULL, $cache=NULL, $render = true) {
$ret = '';
list($ext,$mime,$dl) = mimetype($src);
if(substr($mime,0,5) == 'image'){
// first get the $title
if (!is_null($title)) {
$title = $this->_xmlEntities($title);
}elseif($ext == 'jpg' || $ext == 'jpeg'){
//try to use the caption from IPTC/EXIF
require_once(DOKU_INC.'inc/JpegMeta.php');
$jpeg =& new JpegMeta(mediaFN($src));
if($jpeg !== false) {
$cap = $jpeg->getTitle();
if($cap){
$title = $this->_xmlEntities($cap);
}
$desc = $jpeg->getField(array('Exif.TIFFImageDescription','Exif.TIFFUserComment','Exif.UserComment','Iptc.Caption'));
if($desc){
$desc = $this->_xmlEntities($desc);
}
}
}
if (!$render) {
// if the picture is not supposed to be rendered
// return the title of the picture
if (!$title) {
// just show the sourcename
$title = $this->_xmlEntities(basename(noNS($src)));
}
return $title;
}
//add image tag
$ret .= ''.
''.$desc.' ';
$align = '';
$ret .= '
_xmlEntities($width).'"';
if ( !is_null($height) )
$ret .= ' height="'.$this->_xmlEntities($height).'"';
$ret .= ' />';
$ret .= '
';
}elseif($mime == 'application/x-shockwave-flash'){
if (!$render) {
// if the flash is not supposed to be rendered
// return the title of the flash
if (!$title) {
// just show the sourcename
$title = basename(noNS($src));
}
return $this->_xmlEntities($title);
}
$att = array();
$att['class'] = "media$align";
if($align == 'right') $att['align'] = 'right';
if($align == 'left') $att['align'] = 'left';
$ret .= html_flashobject(ml($src,array('cache'=>$cache)),$width,$height,
array('quality' => 'high'),
null,
$att,
$this->_xmlEntities($title));
}elseif($title){
// well at least we have a title to display
$ret .= $this->_xmlEntities($title);
}else{
// just show the sourcename
$ret .= $this->_xmlEntities(basename(noNS($src)));
}
return $ret;
}
===== Einfügen von inc/html.php =====
==== function html_edit(...) ====
Eine Marke eingefügt, um das Ende des Editierungsformulars anzuzeigen.
...
\\
//Von Richard Weickelt//