xref: /template/wikiweko/mediamanager.php (revision e4280d084687e8c17ace82a1378d3d25e87b496e)
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 <development@andreas-haerter.com>
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">
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<?php
32//show meta-tags
33tpl_metaheaders();
34echo "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />";
35
36//manually load needed CSS? this is a workaround for PHP Bug #49642. In some
37//version/os combinations PHP is not able to parse INI-file entries if there
38//are slashes "/" used for the keynames (see bugreport for more information:
39//<http://bugs.php.net/bug.php?id=49692>). to trigger this workaround, simply
40//delete/rename vector's style.ini.
41if (!file_exists(DOKU_TPLINC."style.ini")){
42    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
43}
44
45//include default or userdefined favicon
46//
47//note: since 2011-04-22 "Rincewind RC1", there is a core function named
48//      "tpl_getFavicon()". But its functionality is not really fitting the
49//      behaviour of this template, therefore I don't use it here.
50if (file_exists(DOKU_TPLINC."user/favicon.ico")){
51    //user defined - you might find http://tools.dynamicdrive.com/favicon/
52    //useful to generate one
53    echo "\n<link rel=\"shortcut icon\" href=\"".DOKU_TPL."user/favicon.ico\" />\n";
54}elseif (file_exists(DOKU_TPLINC."user/favicon.png")){
55    //note: I do NOT recommend PNG for favicons (cause it is not supported by
56    //all browsers), but some users requested this feature.
57    echo "\n<link rel=\"shortcut icon\" href=\"".DOKU_TPL."user/favicon.png\" />\n";
58}else{
59    //default
60    echo "\n<link rel=\"shortcut icon\" href=\"".DOKU_TPL."static/3rd/dokuwiki/favicon.ico\" />\n";
61}
62
63//include default or userdefined Apple Touch Icon (see <http://j.mp/sx3NMT> for
64//details)
65if (file_exists(DOKU_TPLINC."user/apple-touch-icon.png")){
66    echo "<link rel=\"apple-touch-icon\" href=\"".DOKU_TPL."user/apple-touch-icon.png\" />\n";
67}else{
68    //default
69    echo "<link rel=\"apple-touch-icon\" href=\"".DOKU_TPL."static/3rd/dokuwiki/apple-touch-icon.png\" />\n";
70}
71
72//load userdefined js?
73if (tpl_getConf("vector_loaduserjs")){
74    echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".DOKU_TPL."user/user.js\"></script>\n";
75}
76
77//load language specific css hacks?
78if (file_exists(DOKU_TPLINC."lang/".$conf["lang"]."/style.css")){
79  $interim = trim(file_get_contents(DOKU_TPLINC."lang/".$conf["lang"]."/style.css"));
80  if (!empty($interim)){
81      echo "<style type=\"text/css\" media=\"all\">\n".hsc($interim)."\n</style>\n";
82  }
83}
84?>
85<!--[if lte IE 8]><link rel="stylesheet" media="all" type="text/css" href="<?php echo DOKU_TPL; ?>static/css/screen_iehacks.css" /><![endif]-->
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