use @VERSION for dev no-caching

This commit is contained in:
Max Pozdeev 2020-08-19 21:24:25 +03:00
parent 700b87aa99
commit e446d16f26
2 changed files with 16 additions and 8 deletions

View file

@ -5,6 +5,8 @@
Licensed under the GNU GPL v2 license. See file COPYRIGHT for details.
*/
define('MTT_VERSION', '@VERSION');
##### MyTinyTodo requires php 5.4.0 and above! #####
if (version_compare(PHP_VERSION, '5.4.0') < 0) {
die("PHP 5.4+ is required");
@ -171,6 +173,12 @@ function get_mttinfo($v)
case 'title':
$_mttinfo['title'] = (Config::get('title') != '') ? htmlarray(Config::get('title')) : __('My Tiny Todolist');
return $_mttinfo['title'];
case 'version':
if (MTT_VERSION != '@VERSION') {
$_mttinfo['version'] = MTT_VERSION;
return $_mttinfo['version'];
}
return date('Ymd-His'); //force no-cache for dev needs
}
}

View file

@ -4,15 +4,15 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php mttinfo('title'); ?></title>
<link rel="stylesheet" type="text/css" href="<?php mttinfo('template_url'); ?>style.css?v=@VERSION" media="all" />
<link rel="stylesheet" type="text/css" href="<?php mttinfo('template_url'); ?>style.css?v=<?php mttinfo('version'); ?>" media="all" />
<?php if(Config::get('rtl')): ?>
<link rel="stylesheet" type="text/css" href="<?php mttinfo('template_url'); ?>style_rtl.css?v=@VERSION" media="all" />
<link rel="stylesheet" type="text/css" href="<?php mttinfo('template_url'); ?>style_rtl.css?v=<?php mttinfo('version'); ?>" media="all" />
<?php endif; ?>
<?php if(Config::get('mobile')): ?>
<meta name="viewport" id="viewport" content="width=device-width" />
<link rel="stylesheet" type="text/css" href="<?php mttinfo('template_url'); ?>pda.css?v=@VERSION" media="all" />
<link rel="stylesheet" type="text/css" href="<?php mttinfo('template_url'); ?>pda.css?v=<?php mttinfo('version'); ?>" media="all" />
<?php else: ?>
<link rel="stylesheet" type="text/css" href="<?php mttinfo('template_url'); ?>print.css?v=@VERSION" media="print" />
<link rel="stylesheet" type="text/css" href="<?php mttinfo('template_url'); ?>print.css?v=<?php mttinfo('version'); ?>" media="print" />
<?php endif; ?>
</head>
@ -21,9 +21,9 @@
<script type="text/javascript" src="<?php mttinfo('mtt_url'); ?>jquery/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="<?php mttinfo('mtt_url'); ?>jquery/jquery-ui-1.12.1.min.js"></script>
<script type="text/javascript" src="<?php mttinfo('mtt_url'); ?>jquery/jquery.autocomplete-1.1.js"></script>
<script type="text/javascript" src="<?php mttinfo('mtt_url'); ?>mytinytodo.js?v=@VERSION"></script>
<script type="text/javascript" src="<?php mttinfo('mtt_url'); ?>mytinytodo_lang.php?v=@VERSION"></script>
<script type="text/javascript" src="<?php mttinfo('mtt_url'); ?>mytinytodo_ajax_storage.js?v=@VERSION"></script>
<script type="text/javascript" src="<?php mttinfo('mtt_url'); ?>mytinytodo.js?v=<?php mttinfo('version'); ?>"></script>
<script type="text/javascript" src="<?php mttinfo('mtt_url'); ?>mytinytodo_lang.php?v=<?php mttinfo('version'); ?>"></script>
<script type="text/javascript" src="<?php mttinfo('mtt_url'); ?>mytinytodo_ajax_storage.js?v=<?php mttinfo('version'); ?>"></script>
<script type="text/javascript">
$().ready(function(){
@ -284,7 +284,7 @@ $().ready(function(){
<div id="footer">
<div id="footer_content">
<span id="mobileordesktop" ><a href="<?php mttinfo('url'); ?>">Desktop</a> | <a href="<?php mttinfo('mobile_url'); ?>">Mobile</a></span>
<span>Powered by <strong><a href="http://www.mytinytodo.net/">myTinyTodo</a></strong> @VERSION</span>
<span>Powered by <strong><a href="http://www.mytinytodo.net/">myTinyTodo</a></strong> <?php mttinfo('version'); ?></span>
</div>
</div>