Skip to content

Commit

Permalink
Release 1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardnico authored Jul 22, 2021
1 parent becc5c2 commit 6cfaf98
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 80 deletions.
59 changes: 2 additions & 57 deletions class/TplUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ class TplUtility

const CONF_FOOTER_SLOT_PAGE_NAME = "footerSlotPageName";

const CONF_HEIGHT_FIXED_TOP_NAVBAR_OLD = 'heightFixedTopNavbar';
const CONF_HEIGHT_FIXED_TOP_MENUBAR = 'heightFixedTopMenuBar';

/**
* @deprecated for {@link TplUtility::CONF_BOOTSTRAP_VERSION_STYLESHEET}
Expand Down Expand Up @@ -170,51 +168,6 @@ static function renderTrailBreadcrumb($sep = '�')
return true;
}

/**
*
* Return the padding top in pixel that must be applied when using a top bar
* @return int
*/
public static function getPaddingTop()
{
// The padding top for the top fix bar
$paddingTop = 0;
$heightTopBar = self::getTopFixedHeightForMenuBar();
if ($heightTopBar != 0) {
$paddingTop = $heightTopBar + 10;
}
return $paddingTop;
}


/**
* When using a topbar, all header and top element should
* get this style in order to navigate correctly
* @return string
* As the top-nav-bar is fix, the two below values must be equal to the navbar offset
* in order to get a correct navigation to the anchor
* See http://stackoverflow.com/questions/17181355/boostrap-using-fixed-navbar-and-anchor-tags-to-jump-to-sections
*/
public static function getHeadStyleNodeForFixedTopNavbar()
{
$headStyle = "";
$heightTopBar = self::getTopFixedHeightForMenuBar();
if ($heightTopBar !== 0) {
$paddingTop = 2 * $heightTopBar + 10; // + 10 to get the message area not below the topnavbar
$marginTop = -2 * $heightTopBar;
$topHeaderStyle = "padding-top:{$paddingTop}px;margin-top:{$marginTop}px;z-index:-1";

$headStyle = <<<EOF
<style class="snippet-top-menubar-combo">
main > h1, main > h2, main > h3, main > h4, main > h5, #dokuwiki__top {
$topHeaderStyle
}
</style>
EOF;
}
return $headStyle;
}

/**
* @param string $text add a comment into the HTML page
*/
Expand Down Expand Up @@ -379,14 +332,6 @@ private static function getBootStrapMajorVersion()
return self::getBootStrapVersion()[0];
}

public static function getTopFixedHeightForMenuBar()
{
$height = tpl_getConf(self::CONF_HEIGHT_FIXED_TOP_MENUBAR, null);
if ($height == null) {
$height = tpl_getConf(self::CONF_HEIGHT_FIXED_TOP_NAVBAR_OLD, 0);
}
return $height;
}

public static function getSideKickSlotPageName()
{
Expand Down Expand Up @@ -1220,10 +1165,10 @@ static function renderFaviconMetaLinks()

// Icon Png
$possibleLocation = array(':wiki:favicon-32x32.png', ':favicon-32x32.png', 'images/favicon-32x32.png');
$return .= '<link rel="icon" type="image/png" sizes="32x32" href="' . tpl_getMediaFile($possibleLocation, $fallback = true) . '">';
$return .= '<link rel="icon" type="image/png" sizes="32x32" href="' . tpl_getMediaFile($possibleLocation, $fallback = true) . '"/>';

$possibleLocation = array(':wiki:favicon-16x16.png', ':favicon-16x16.png', 'images/favicon-16x16.png');
$return .= '<link rel="icon" type="image/png" sizes="16x16" href="' . tpl_getMediaFile($possibleLocation, $fallback = true) . '">';
$return .= '<link rel="icon" type="image/png" sizes="16x16" href="' . tpl_getMediaFile($possibleLocation, $fallback = true) . '"/>';

// Apple touch icon
$possibleLocation = array(':wiki:apple-touch-icon.png', ':apple-touch-icon.png', 'images/apple-touch-icon.png');
Expand Down
6 changes: 0 additions & 6 deletions conf/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@

$conf['gridColumns'] = 12;

/**
* The height of the menu bar when
* it's fixed in order to calculate the needed style
* @see {@link \ComboStrap\TplUtility::CONF_HEIGHT_FIXED_TOP_MENUBAR}
*/
$conf['heightFixedTopMenuBar'] = 0;

$conf['preloadCss'] = 0;

Expand Down
2 changes: 0 additions & 2 deletions conf/metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@

$meta[TplUtility::CONF_GRID_COLUMNS] = array('multichoice', '_choices' => array('12', '16'));

$meta[TplUtility::CONF_HEIGHT_FIXED_TOP_MENUBAR] = array('string');

$meta['preloadCss'] = array('onoff');

$meta['privateToolbar'] = array('onoff');
Expand Down
4 changes: 2 additions & 2 deletions detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

</head>

<body style="padding-top: <?php echo TplUtility::getPaddingTop() ?>px;">
<body>

<div id="dokuwiki__site">
<div id="dokuwiki__top" class="site <?php echo tpl_classes(); ?>">
Expand Down Expand Up @@ -107,5 +107,5 @@
</div>
</div>


</body>
</html>
2 changes: 0 additions & 2 deletions lang/en/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
$lang[TplUtility::CONF_GRID_COLUMNS] = '<a href="https://combostrap.com/dynamic/grid">Dynamic Grid</a> - The number of columns in the grid';


$lang[TplUtility::CONF_HEIGHT_FIXED_TOP_MENUBAR] = '<a href="https://combostrap.com/top_menubar">Fixed-top Menubar</a> - The height of the top menu bar in pixel (40N normally)';

$lang['preloadCss'] = '<a href="https://combostrap.com/css#preloadCSS">CSS Optimization</a> - Enable CSS Preloading (!The page rendering will flash - FOUC)';
$lang['privateToolbar'] = '<a href="https://combostrap.com/toolbar">Toolbar</a> - Enable private toolbar';

Expand Down
12 changes: 3 additions & 9 deletions main.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
<head>

<?php // Avoid using character entities in your HTML, provided their encoding matches that of the document (generally UTF-8) ?>
<meta charset="utf-8">
<meta charset="utf-8"/>

<?php // Responsive meta tag ?>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
Expand All @@ -200,12 +200,6 @@
<?php // Favicon ?>
<?php echo TplUtility::renderFaviconMetaLinks() ?>

<?php
/**
* In case of a fix bar
*/
echo TplUtility::getHeadStyleNodeForFixedTopNavbar();
?>

<?php
/**
Expand Down Expand Up @@ -247,7 +241,7 @@
// * dokuwiki__top ID is needed for the "Back to top" utility
// * used also by some plugins
?>
<body class="dokuwiki" style="padding-top: <?php echo TplUtility::getPaddingTop() ?>px;">
<body class="dokuwiki">


<?php
Expand Down Expand Up @@ -385,5 +379,5 @@ class="col-md-<?php echo($sideKickBarScale) ?> order-xs-2 order-md-last d-print-
?>
</div>


</body>
</html>
4 changes: 2 additions & 2 deletions template.info.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
base strap
author ComboStrap
email [email protected]
version 1.17
date 2021-07-14
version 1.18
date 2021-07-22
name Strap
desc The Bootstrap based template of ComboStrap
url https://combostrap.com
Expand Down

0 comments on commit 6cfaf98

Please sign in to comment.