* @link https://www.dokuwiki.org/template:prsnl10 * @link https://www.dokuwiki.org/devel:templates * @link https://www.dokuwiki.org/devel:coding_style * @link https://www.dokuwiki.org/devel:environment * @link https://www.dokuwiki.org/devel:action_modes * @link http://blog.andreas-haerter.com/2011/03/16/how-to-create-a-maintainable-dokuwiki-template */ //check if we are running within the DokuWiki environment if (!defined("DOKU_INC")){ die(); } /** * Stores the name the current client used to login * * @var string * @author ARSAVA */ $loginname = ""; if (!empty($conf["useacl"])){ if (isset($_SERVER["REMOTE_USER"]) && //no empty() but isset(): "0" may be a valid username... $_SERVER["REMOTE_USER"] !== ""){ $loginname = $_SERVER["REMOTE_USER"]; //$INFO["client"] would not work here (-> e.g. when //current IP differs from the one used to login) } } //get needed language array include DOKU_TPLINC."lang/en/lang.php"; //overwrite English language values with available translations if (!empty($conf["lang"]) && $conf["lang"] != "en" && file_exists(DOKU_TPLINC."/lang/".$conf["lang"]."/lang.php")){ //get language file (partially translated language files are no problem //cause non translated stuff is still existing as English array value) include DOKU_TPLINC."/lang/".$conf["lang"]."/lang.php"; } //detect revision $rev = (int)$INFO["rev"]; //$INFO comes from the DokuWiki core if ($rev < 1){ $rev = (int)$INFO["lastmod"]; } ?> " lang="" dir=""> <?php tpl_pagetitle(); echo " - ".hsc($conf["title"]); ?> ://fonts.googleapis.com/css?family=Droid+Sans" /> "; //include default or userdefined favicon // //note: since 2011-04-22 "Rincewind RC1", there is a core function named // "tpl_getFavicon()". But its functionality is not really fitting the // behaviour of this template, therefore I don't use it here exclusively. if (file_exists(DOKU_TPLINC."user/favicon.ico")){ //user defined - you might find http://tools.dynamicdrive.com/favicon/ //useful to generate one echo "\n\n"; }elseif (file_exists(DOKU_TPLINC."user/favicon.png")){ //note: I do NOT recommend PNG for favicons (cause it is not supported by //all browsers). echo "\n\n"; }else{ //default echo "\n\n"; } //include default or userdefined Apple Touch Icon (see for //details) if (file_exists(DOKU_TPLINC."user/apple-touch-icon.png")){ echo "\n"; }else{ //default echo "\n"; } //load userdefined js? if (tpl_getConf("prsnl10_loaduserjs") && file_exists(DOKU_TPLINC."user/user.js")){ echo "\n"; } ?>
>
\n \"\"/"; }elseif (file_exists(DOKU_TPLINC."user/logo.gif")){ //user defined GIF echo ">\"\"/"; }elseif (file_exists(DOKU_TPLINC."user/logo.jpg")){ //user defined JPG echo ">\"\"/"; }else{ //default echo " class=\"tmpl_header_logo_txt\">".hsc($conf["title"]).""; } echo "\n
\n"; ?>
\n "; //we have to show a custom navigation if (empty($conf["useacl"]) || auth_quickaclcheck(cleanID(tpl_getConf("prsnl10_headernav_location")))){ //current user got access? //get the rendered content of the defined wiki article to use as custom navigation $interim = tpl_include_page(tpl_getConf("prsnl10_headernav_location"), false); if ($interim === "" || $interim === false){ //show creation/edit link if the defined page got no content echo "[ "; tpl_pagelink(tpl_getConf("prsnl10_headernav_location"), hsc($lang["prsnl10_fillplaceholder"]." (".tpl_getConf("prsnl10_headernav_location").")")); echo " ]
"; }else{ //show the rendered page content echo $interim; } } echo "\n
\n"; } ?>
>
"; } ?>