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