+ can change page title in settings

This commit is contained in:
Max Pozdeev 2009-11-04 21:45:28 +03:00
parent 3299ee2546
commit f0c4de0852
3 changed files with 13 additions and 2 deletions

View file

@ -66,6 +66,7 @@ class Config
'mysql.db' => array('default'=>'mytinytodo', 'type'=>'s'),
'mysql.user' => array('default'=>'user', 'type'=>'s'),
'mysql.password' => array('default'=>'', 'type'=>'s'),
'title' => array('default'=>'', 'type'=>'s'),
'lang' => array('default'=>'en', 'type'=>'s'),
'password' => array('default'=>'', 'type'=>'s'),
'allowread' => array('default'=>0, 'type'=>'i'),

View file

@ -23,6 +23,10 @@ else $duedateformat = 'yy-mm-dd';
if(!isset($config['firstdayofweek']) || !is_int($config['firstdayofweek']) ||
$config['firstdayofweek']<0 || $config['firstdayofweek']>6) $config['firstdayofweek'] = 1;
if(isset($config['title']) && $config['title'] != '') $title = htmlarray($config['title']);
else $title = $lang->get('My Tiny Todolist');
function __($s)
{
global $lang;
@ -33,7 +37,7 @@ function __($s)
<html>
<HEAD>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title><?php __('My Tiny Todolist');?></title>
<title><?php echo $title; ?></title>
<link rel="stylesheet" type="text/css" href="style.css?v=@VERSION" media="all">
<?php if(isset($_GET['pda'])): ?>
<meta name="viewport" id="viewport" content="width=device-width">
@ -87,7 +91,7 @@ $().ajaxStop( function(r,s) {$("#loading").fadeOut();} );
<div id="container">
<div id="body">
<h2><?php __('My Tiny Todolist');?></h2>
<h2><?php echo $title; ?></h2>
<div id="loading"><img src="images/loading1.gif"></div>

View file

@ -32,6 +32,7 @@ if(isset($_POST['save']))
$config['clock'] = (int)_post('clock');
$config['dateformat'] = _post('dateformat');
$config['dateformatshort'] = _post('dateformatshort');
$config['title'] = trim(_post('title'));
Config::save($config);
$t['saved'] = 1;
echo json_encode($t);
@ -80,6 +81,11 @@ function selectOptions($a, $value, $default=null)
<table class="mtt-settings-table">
<tr>
<th>Title:<br><span class="descr">(specify if you want to change default title)</span></th>
<td> <input name="title" value="<?php echo htmlspecialchars(_c('title'));?>" style="width:350px"> </td>
</tr>
<tr>
<th>Language:</th>
<td> <SELECT name="lang"><?php $langs = getLangs(); echo selectOptions($langs, $config['lang']); ?></SELECT> </td>