Skip to content

Commit

Permalink
Using TPL_METAHEADER_OUTPUT event to add and manage the template asse…
Browse files Browse the repository at this point in the history
…ts and fixes (Bootstrap, FontAwesome, etc)
  • Loading branch information
giterlizzi committed Feb 29, 2016
1 parent 3997085 commit 8530c7b
Show file tree
Hide file tree
Showing 8 changed files with 263 additions and 189 deletions.
98 changes: 47 additions & 51 deletions detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1" />
<?php echo tpl_favicon(array('favicon', 'mobile')) ?>
<?php tpl_includeFile('meta.html') ?>
<?php foreach ($bootstrap_styles as $bootstrap_style): ?>
<link type="text/css" rel="stylesheet" href="<?php echo $bootstrap_style; ?>" />
<?php endforeach; ?>
<link type="text/css" rel="stylesheet" href="<?php echo DOKU_TPL ?>assets/font-awesome/css/font-awesome.min.css" />
<?php tpl_metaheaders()?>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script type="text/javascript" src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script type="text/javascript" src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
Expand All @@ -45,72 +39,74 @@

<?php html_msgarea() ?>

<?php if($ERROR): print $ERROR; ?>
<?php if ($ERROR): print $ERROR; ?>
<?php else: ?>

<h1 class="page-header">
<i class="fa fa-picture-o text-muted"></i> <?php echo hsc(tpl_img_getTag('IPTC.Headline', $IMG))?>
</h1>
<h1 class="page-header">
<i class="fa fa-picture-o text-muted"></i> <?php echo hsc(tpl_img_getTag('IPTC.Headline', $IMG))?>
</h1>

<div class="row">
<main class="row">

<div class="col-md-8">
<?php tpl_img(900, 700); /* the image; parameters: maximum width, maximum height (and more) */ ?>
</div>
<div class="col-md-8">
<?php tpl_img(900, 700); /* the image; parameters: maximum width, maximum height (and more) */ ?>
</div>

<div class="col-md-4">
<div class="col-md-4">

<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<i class="fa fa-picture-o"></i> <?php print nl2br(hsc(tpl_img_getTag('simple.title'))); ?>
</h4>
</div>
<div class="panel-body">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<i class="fa fa-picture-o"></i> <?php print nl2br(hsc(tpl_img_getTag('simple.title'))); ?>
</h4>
</div>
<div class="panel-body">

<?php
tpl_img_meta();
//Comment in for Debug
// dbg(tpl_img_getTag('Simple.Raw'));
?>
<?php
tpl_img_meta();
//Comment in for Debug
dbg(tpl_img_getTag('Simple.Raw'));
?>

<hr/>

<dl class="dl-horizontal">
<?php
echo '<dt>'.$lang['reference'].':</dt>';
$media_usage = ft_mediause($IMG,true);
if(count($media_usage) > 0){
foreach($media_usage as $path){
echo '<dd>'.html_wikilink($path).'</dd>';
}
}else{
echo '<dd>'.$lang['nothingfound'].'</dd>';
}
?>
</dl>
<hr/>

<dl class="dl-horizontal">
<?php
// This message is available from release 2015-08-10 "Detritus"
if(isset($lang['media_acl_warning'])): ?>
<div class="alert alert-warning">
<i class="fa fa-warning"></i> <?php echo $lang['media_acl_warning']; ?>
</div>
<?php endif; ?>
echo '<dt>'.$lang['reference'].':</dt>';
$media_usage = ft_mediause($IMG,true);
if (count($media_usage) > 0){
foreach($media_usage as $path){
echo '<dd>'.html_wikilink($path).'</dd>';
}
} else {
echo '<dd>'.$lang['nothingfound'].'</dd>';
}
?>
</dl>

<?php if (isset($lang['media_acl_warning'])): // This message is available from release 2015-08-10 "Detritus" ?>
<div class="alert alert-warning">
<i class="fa fa-warning"></i> <?php echo $lang['media_acl_warning']; ?>
</div>
</div>
<?php endif; ?>

</div>
</div>

</div>
</main>

<hr/>

<hr/>
<footer>

<div class="btn-group">
<div class="btn-group-xs">
<?php tpl_action('img_backto', 1) ?>
<?php tpl_action('mediaManager', 1) ?>
</div>

</footer>

<?php endif; ?>
</div>
<!--[if IE 8 ]></div><![endif]-->
Expand Down
28 changes: 2 additions & 26 deletions main.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,36 +30,12 @@
<meta name="viewport" content="width=device-width,initial-scale=1" />
<?php echo tpl_favicon(array('favicon', 'mobile')) ?>
<?php tpl_includeFile('meta.html') ?>
<?php foreach ($bootstrap_styles as $bootstrap_style): ?>
<link type="text/css" rel="stylesheet" href="<?php echo $bootstrap_style; ?>" />
<?php endforeach; ?>
<link type="text/css" rel="stylesheet" href="<?php echo DOKU_TPL ?>assets/font-awesome/css/font-awesome.min.css" />
<?php tpl_metaheaders() ?>
<?php bootstrap3_google_analytics() ?>
<style type="text/css">
body { padding-top: <?php echo $navbar_padding ?>px; }
<?php if (bootstrap3_conf('tocCollapseSubSections')): ?>
#dokuwiki__toc .nav .nav .nav { display: none; }
<?php endif; ?>
.dw-toc-affix { top: <?php echo ($navbar_padding -10) ?>px; }
</style>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script type="text/javascript" src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script type="text/javascript" src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<?php if ($fixedTopNavbar): ?>
<script type="text/javascript">/*<![CDATA[*/
jQuery(document).ready(function() {
if (location.hash) {
setTimeout(function() {
scrollBy(0, -<?php echo $navbar_padding ?>);
}, 1);
}
});
/*!]]>*/</script>
<?php endif; ?>
</head>
<?php tpl_flush() ?>
<body class="<?php echo trim(implode(' ', $body_classes)) ?>" data-spy="scroll" data-target="#dokuwiki__toc" data-offset="<?php echo $navbar_padding ?>">
Expand Down Expand Up @@ -91,8 +67,8 @@
<!-- ********** CONTENT ********** -->
<article id="dokuwiki__content" class="<?php echo bootstrap3_container_grid() ?>" <?php echo ((bootstrap3_conf('semantic')) ? sprintf('itemscope itemtype="http://schema.org/%s" itemref="dw__license"', bootstrap3_conf('schemaOrgType')) : '') ?>>

<div class="<?php echo ($pageOnPanel ? 'panel panel-default' : 'no-panel') ?>" <?php echo ((bootstrap3_conf('semantic')) ? 'itemprop="articleBody"' : '') ?>>
<div class="page <?php echo ($pageOnPanel ? 'panel-body' : '') ?>">
<div class="<?php echo ($page_on_panel ? 'panel panel-default' : 'no-panel') ?>" <?php echo ((bootstrap3_conf('semantic')) ? 'itemprop="articleBody"' : '') ?>>
<div class="page <?php echo ($page_on_panel ? 'panel-body' : '') ?>">

<?php

Expand Down
6 changes: 0 additions & 6 deletions mediamanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1" />
<?php echo tpl_favicon(array('favicon', 'mobile')) ?>
<?php tpl_includeFile('meta.html') ?>
<?php foreach ($bootstrap_styles as $bootstrap_style): ?>
<link type="text/css" rel="stylesheet" href="<?php echo $bootstrap_style; ?>" />
<?php endforeach; ?>
<link type="text/css" rel="stylesheet" href="<?php echo DOKU_TPL ?>assets/font-awesome/css/font-awesome.min.css" />
<?php tpl_metaheaders() ?>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
Expand Down
3 changes: 0 additions & 3 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* DOKUWIKI:include_once assets/bootstrap/js/bootstrap.min.js */
/* DOKUWIKI:include_once assets/anchorjs/anchor.min.js */

/*!
* DokuWiki Bootstrap3 Template: Hacks!
*
Expand Down

1 comment on commit 8530c7b

@giterlizzi
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this commit have added @media screen to solve the issue #157.

Please sign in to comment.