1<?php 2 3/** 4 * DokuWiki Media Manager Popup 5 * 6 * NOTE: Based on the mediamanager.php out of the "starter" template by 7 * Anika Henke. 8 * 9 * 10 * LICENSE: This file is open source software (OSS) and may be copied under 11 * certain conditions. See COPYING file for details or try to contact 12 * the author(s) of this file in doubt. 13 * 14 * @license GPLv2 (http://www.gnu.org/licenses/gpl2.html) 15 * @author Andreas Haerter <ah@bitkollektiv.org> 16 * @link http://www.dokuwiki.org/template:vector 17 * @link http://www.dokuwiki.org/devel:templates 18 */ 19 20//check if we are running within the DokuWiki environment 21if (!defined("DOKU_INC")){ 22 die(); 23} 24 25?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 26 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 27<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo hsc($conf["lang"]); ?>" lang="<?php echo hsc($conf["lang"]); ?>" dir="<?php echo hsc($lang["direction"]); ?>" class="popup no-js"> 28<head> 29<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 30<title><?php echo hsc($lang["mediaselect"]); echo " - ".hsc($conf["title"]); ?></title> 31<script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script> 32<?php 33//show meta-tags 34tpl_metaheaders(); 35echo "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />"; 36 37//manually load needed CSS? this is a workaround for PHP Bug #49642. In some 38//version/os combinations PHP is not able to parse INI-file entries if there 39//are slashes "/" used for the keynames (see bugreport for more information: 40//<http://bugs.php.net/bug.php?id=49692>). to trigger this workaround, simply 41//delete/rename vector's style.ini. 42if (!file_exists(DOKU_TPLINC."style.ini")){ 43 echo "<link rel=\"stylesheet\" media=\"all\" type=\"text/css\" href=\"".DOKU_TPL."bug49642.php".((!empty($lang["direction"]) && $lang["direction"] === "rtl") ? "?langdir=rtl" : "")."\" />\n"; //var comes from DokuWiki core 44} 45 46//include default or userdefined favicon 47// 48//note: since 2011-04-22 "Rincewind RC1", there is a core function named 49// "tpl_getFavicon()". But its functionality is not really fitting the 50// behaviour of this template, therefore I don't use it here. 51if (file_exists(DOKU_TPLINC."user/favicon.ico")){ 52 //user defined - you might find http://tools.dynamicdrive.com/favicon/ 53 //useful to generate one 54 echo "\n<link rel=\"shortcut icon\" href=\"".DOKU_TPL."user/favicon.ico\" />\n"; 55}elseif (file_exists(DOKU_TPLINC."user/favicon.png")){ 56 //note: I do NOT recommend PNG for favicons (cause it is not supported by 57 //all browsers), but some users requested this feature. 58 echo "\n<link rel=\"shortcut icon\" href=\"".DOKU_TPL."user/favicon.png\" />\n"; 59}else{ 60 //default 61 echo "\n<link rel=\"shortcut icon\" href=\"".DOKU_TPL."static/3rd/dokuwiki/favicon.ico\" />\n"; 62} 63 64//include default or userdefined Apple Touch Icon (see <http://j.mp/sx3NMT> for 65//details) 66if (file_exists(DOKU_TPLINC."user/apple-touch-icon.png")){ 67 echo "<link rel=\"apple-touch-icon\" href=\"".DOKU_TPL."user/apple-touch-icon.png\" />\n"; 68}else{ 69 //default 70 echo "<link rel=\"apple-touch-icon\" href=\"".DOKU_TPL."static/3rd/dokuwiki/apple-touch-icon.png\" />\n"; 71} 72 73//load userdefined js? 74if (tpl_getConf("vector_loaduserjs")){ 75 echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".DOKU_TPL."user/user.js\"></script>\n"; 76} 77 78//load language specific css hacks? 79if (file_exists(DOKU_TPLINC."lang/".$conf["lang"]."/style.css")){ 80 $interim = trim(file_get_contents(DOKU_TPLINC."lang/".$conf["lang"]."/style.css")); 81 if (!empty($interim)){ 82 echo "<style type=\"text/css\" media=\"all\">\n".hsc($interim)."\n</style>\n"; 83 } 84} 85?> 86<!--[if lt IE 7]><style type="text/css">body{behavior:url("<?php echo DOKU_TPL; ?>static/3rd/vector/csshover.htc")}</style><![endif]--> 87</head> 88 89<body> 90 <div id="media__manager" class="dokuwiki"> 91 <?php html_msgarea() ?> 92 <div id="mediamgr__aside"><div class="pad"> 93 <h1><?php echo hsc($lang['mediaselect'])?></h1> 94 95 <?php /* keep the id! additional elements are inserted via JS here */?> 96 <div id="media__opts"></div> 97 98 <?php tpl_mediaTree() ?> 99 </div></div> 100 101 <div id="mediamgr__content"><div class="pad"> 102 <?php tpl_mediaContent() ?> 103 </div></div> 104 </div> 105</body> 106</html> 107