From ed5d46592d4380653e1f43e08ffa0090edbaf9ca Mon Sep 17 00:00:00 2001 From: Max Pozdeev Date: Fri, 15 Jan 2010 18:01:46 +0300 Subject: [PATCH] * some logics moved to default theme --- src/index.php | 22 ++++++++---------- src/themes/default/index.php | 44 +++++++++++++++++++++++------------- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/src/index.php b/src/index.php index 55248af..eeaf965 100644 --- a/src/index.php +++ b/src/index.php @@ -14,16 +14,8 @@ $lang = new Lang(); if($lang->rtl()) Config::set('rtl', 1); -if(Config::get('duedateformat') == 2) $duedateformat = 'm/d/yy'; -elseif(Config::get('duedateformat') == 3) $duedateformat = 'dd.mm.yy'; -elseif(Config::get('duedateformat') == 4) $duedateformat = 'dd/mm/yy'; -else $duedateformat = 'yy-mm-dd'; - if(!is_int(Config::get('firstdayofweek')) || Config::get('firstdayofweek')<0 || Config::get('firstdayofweek')>6) Config::set('firstdayofweek', 1); -if(Config::get('title') != '') $title = htmlarray(Config::get('title')); -else $title = $lang->get('My Tiny Todolist'); - $_mttinfo = array(); define('TEMPLATEPATH', './themes/'.Config::get('template').'/'); @@ -49,16 +41,22 @@ function mttinfo($v) function get_mttinfo($v) { - global $_mttinfo; + global $_mttinfo, $lang; if(isset($_mttinfo[$v])) return $_mttinfo[$v]; switch($v) { - case 'siteurl': - $_mttinfo['siteurl'] = 'http://'.$_SERVER['HTTP_HOST'] .($_SERVER['SERVER_PORT'] != 80 ? ':'.$_SERVER['SERVER_PORT'] : ''). parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); - return $_mttinfo['siteurl']; + case 'template_uri': + $_mttinfo['template_uri'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH). 'themes/'. Config::get('template') . '/'; + return $_mttinfo['template_uri']; case 'template_url': $_mttinfo['template_url'] = get_mttinfo('siteurl'). 'themes/'. Config::get('template') . '/'; return $_mttinfo['template_url']; + case 'siteurl': + $_mttinfo['siteurl'] = 'http://'.$_SERVER['HTTP_HOST'] .($_SERVER['SERVER_PORT'] != 80 ? ':'.$_SERVER['SERVER_PORT'] : ''). parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); + return $_mttinfo['siteurl']; + case 'title': + $_mttinfo['title'] = (Config::get('title') != '') ? htmlarray(Config::get('title')) : $lang->get('My Tiny Todolist'); + return $_mttinfo['title']; } } diff --git a/src/themes/default/index.php b/src/themes/default/index.php index 2284606..7cc0f8b 100644 --- a/src/themes/default/index.php +++ b/src/themes/default/index.php @@ -1,17 +1,29 @@ + -<?php echo $title; ?> - +<?php mttinfo('title'); ?> + - + - + - + @@ -37,8 +49,8 @@ $().ready(function(){ } echo "\tloadLists(1, 1);\n"; ?> - $("#duedate").datepicker({dateFormat: '', firstDay: , - showOn: 'button', buttonImage: 'images/calendar.png', buttonImageOnly: true, changeMonth:true, + $("#duedate").datepicker({dateFormat: '', firstDay: , + showOn: 'button', buttonImage: 'images/calendar.png', buttonImageOnly: true, changeMonth:true, changeYear:true, constrainInput: false, duration:'', nextText:'>', prevText:'<', dayNamesMin:lang.daysMin, dayNames:lang.daysLong, monthNamesShort:lang.monthsLong }); @@ -57,9 +69,9 @@ $().ajaxStop( function(r,s) {$("#loading").fadeOut();} );
-

+

-
+
@@ -70,7 +82,7 @@ $().ajaxStop( function(r,s) {$("#loading").fadeOut();} ); - +
@@ -83,10 +95,10 @@ $().ajaxStop( function(r,s) {$("#loading").fadeOut();} );
    - +
    - +   |

    - - (0)   - + + (0)   + /

    @@ -176,7 +188,7 @@ $().ajaxStop( function(r,s) {$("#loading").fadeOut();} );