From 751873d6fe6c0e66d5b265f241947b90c7d9701b Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 21 Feb 2017 14:42:11 +0100 Subject: [PATCH] SPR-800 remove unused function file --- detail.php | 1 - main.php | 1 - mediamanager.php | 1 - tpl_functions.php | 142 ---------------------------------------------- 4 files changed, 145 deletions(-) delete mode 100755 tpl_functions.php diff --git a/detail.php b/detail.php index 53239a1..21dda38 100755 --- a/detail.php +++ b/detail.php @@ -9,7 +9,6 @@ // must be run from within DokuWiki if (!defined('DOKU_INC')) die(); -@require_once(dirname(__FILE__).'/tpl_functions.php'); /* include hook for template functions */ header('X-UA-Compatible: IE=edge,chrome=1'); ?> diff --git a/main.php b/main.php index 4527e46..9da9a64 100755 --- a/main.php +++ b/main.php @@ -10,7 +10,6 @@ */ if (!defined('DOKU_INC')) die(); /* must be run from within DokuWiki */ -@require_once(dirname(__FILE__).'/tpl_functions.php'); /* include hook for template functions */ header('X-UA-Compatible: IE=edge,chrome=1'); $showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && !empty($_SERVER['REMOTE_USER']) ); diff --git a/mediamanager.php b/mediamanager.php index 3c30f4e..8c85a6d 100755 --- a/mediamanager.php +++ b/mediamanager.php @@ -8,7 +8,6 @@ */ // must be run from within DokuWiki if (!defined('DOKU_INC')) die(); -@require_once(dirname(__FILE__).'/tpl_functions.php'); /* include hook for template functions */ header('X-UA-Compatible: IE=edge,chrome=1'); /* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */ diff --git a/tpl_functions.php b/tpl_functions.php deleted file mode 100755 index c0e605d..0000000 --- a/tpl_functions.php +++ /dev/null @@ -1,142 +0,0 @@ - - */ -function _tpl_discussion($discussionPage, $title, $backTitle, $link=0, $wrapper=0, $return=0) { - global $ID; - $output = ''; - - $discussPage = str_replace('@ID@', $ID, $discussionPage); - $discussPageRaw = str_replace('@ID@', '', $discussionPage); - $isDiscussPage = strpos($ID, $discussPageRaw) !== false; - $backID = ':'.str_replace($discussPageRaw, '', $ID); - - if ($wrapper) $output .= "<$wrapper>"; - - if ($isDiscussPage) { - if ($link) { - ob_start(); - tpl_pagelink($backID, $backTitle); - $output .= ob_get_contents(); - ob_end_clean(); - } else { - $output .= html_btn('back2article', $backID, '', array(), 'get', 0, $backTitle); - } - } else { - if ($link) { - ob_start(); - tpl_pagelink($discussPage, $title); - $output .= ob_get_contents(); - ob_end_clean(); - } else { - $output .= html_btn('discussion', $discussPage, '', array(), 'get', 0, $title); - } - } - - if ($wrapper) $output .= ""; - if ($return) return $output; - echo $output; -} - -/** - * Create link/button to user page - * - * @author Anika Henke - */ -function _tpl_userpage($userPage, $title, $link=0, $wrapper=0, $return=0) { - if (empty($_SERVER['REMOTE_USER'])) return; - - global $conf; - $output = ''; - $userPage = str_replace('@USER@', $_SERVER['REMOTE_USER'], $userPage); - - if ($wrapper) $output .= "<$wrapper>"; - - if ($link) { - ob_start(); - tpl_pagelink($userPage, $title); - $output .= ob_get_contents(); - ob_end_clean(); - } else { - $output .= html_btn('userpage', $userPage, '', array(), 'get', 0, $title); - } - - if ($wrapper) $output .= ""; - if ($return) return $output; - echo $output; -} - -/** - * Wrapper around custom template actions - * - * @author Anika Henke - */ -function _tpl_action($type, $link=0, $wrapper=0, $return=0) { - switch ($type) { - case 'discussion': - if (tpl_getConf('discussionPage')) { - $output = _tpl_discussion(tpl_getConf('discussionPage'), tpl_getLang('discussion'), tpl_getLang('back_to_article'), $link, $wrapper, 1); - if ($return) return $output; - echo $output; - } - break; - case 'userpage': - if (tpl_getConf('userPage')) { - $output = _tpl_userpage(tpl_getConf('userPage'), tpl_getLang('userpage'), $link, $wrapper, 1); - if ($return) return $output; - echo $output; - } - break; - } -} - -/** - * copied to core (available since Detritus) - */ -if (!function_exists('tpl_toolsevent')) { - function tpl_toolsevent($toolsname, $items, $view='main') { - $data = array( - 'view' => $view, - 'items' => $items - ); - - $hook = 'TEMPLATE_'.strtoupper($toolsname).'_DISPLAY'; - $evt = new Doku_Event($hook, $data); - if($evt->advise_before()){ - foreach($evt->data['items'] as $k => $html) echo $html; - } - $evt->advise_after(); - } -} - -/** - * copied from core (available since Binky) - */ -if (!function_exists('tpl_classes')) { - function tpl_classes() { - global $ACT, $conf, $ID, $INFO; - $classes = array( - 'dokuwiki', - 'mode_'.$ACT, - 'tpl_'.$conf['template'], - !empty($_SERVER['REMOTE_USER']) ? 'loggedIn' : '', - $INFO['exists'] ? '' : 'notFound', - ($ID == $conf['start']) ? 'home' : '', - ); - return join(' ', $classes); - } -}