Increase visual

This commit is contained in:
bgigon 2004-09-28 12:26:05 +00:00
parent 2812db3ad5
commit 7e1a268980
3 changed files with 26 additions and 9 deletions

View File

@ -193,14 +193,24 @@
if ($data['color'])
{
$this->template->set_var('tr_color',$data['color']);
$this->template->set_var('td_color',$data['color']);
$gray = (hexdec(substr($data['color'],1,2))+hexdec(substr($data['color'],3,2))+hexdec(substr($data['color'],5,2)))/3;
}
else
{
$this->nextmatchs->template_alternate_row_color($this->template);
$this->template->set_var('td_color','');
//$this->nextmatchs->template_alternate_row_color($this->template);
$gray = 255;
}
//else
//{
$this->nextmatchs->template_alternate_row_color($this->template);
$gray = 255;
// }
$this->template->set_var('color',$gray < 128 ? 'style="color: white;"' : '');
$id = $cat['id'];
@ -285,7 +295,11 @@
$data = unserialize($cat['data']);
$icon = $data['icon'];
$dir_img = $GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'phpgwapi' . SEP . 'images' . SEP;
$this->template->set_var('icon', "<img src='". $dir_img . $icon ."'>");
if (strlen($icon) > 0)
$this->template->set_var('icon', "<img src='". $dir_img . $icon ."'>");
else
$this->template->set_var('icon', "&nbsp;");
$this->template->fp('list','cat_list',True);
}
@ -408,7 +422,8 @@
}
$this->template->set_var('color',$GLOBALS['phpgw']->html->inputColor('cat_data[color]',$cat['data']['color'],lang('Click to select a color')));
$options = '<option value=""'.(!$cat['data']['icon'] ? ' selected="1"':'').'>'.lang('none')."</options>\n";
//$options = '<option value=""'.(!$cat['data']['icon'] ? ' selected="1"':'').'>'.lang('none')."</options>\n";
$options = '';
foreach ($this->icons as $icon)
{
$options .= '<option value="'.$icon.'"'.($icon == $cat['data']['icon'] ? ' selected="1"':'').'>'.

View File

@ -1,7 +1,7 @@
<!-- $Id$ -->
<center>
<table border="0" cellspacing="2" cellpadding="2">
<table border="0" cellspacing="2" cellpadding="2" width="100%">
<tr>
<td colspan="5" align="left">
<table border="0" width="100%">
@ -23,8 +23,9 @@
<tr class="th">
<td width="20%">{sort_name}</td>
<td width="32%">{sort_description}</td>
<td>{lang_icon}</td>
<td width="8%" align="center">{lang_sub}</td>
<td width="8%">{lang_color}</td>
<td width="6%">{lang_icon}</td>
<td width="14%" align="center">{lang_sub}</td>
<td width="8%" align="center">{lang_edit}</td>
<td width="8%" align="center">{lang_delete}</td>
</tr>
@ -34,6 +35,7 @@
<tr bgcolor="{tr_color}" {color}>
<td>{name}</td>
<td>{descr}</td>
<td bgcolor="{td_color}"></td>
<td>{icon}</td>
<td align="center">{add_sub}</a></td>
<td align="center">{edit}</a></td>

View File

@ -53,9 +53,9 @@ class html
function inputColor($name,$value='',$title='')
{
$id = str_replace(array('[',']'),array('_',''),$name).'_colorpicker';
$onclick = "if (this != '') { window.open(this+'&color='+encodeURIComponent(document.getElementById('$id').value),this.target,'width=240,height=187,scrollbars=no,resizable=no'); return false; } else { return true; }";
$onclick = "javascript:window.open('".$this->phpgwapi_js_url.'/colorpicker/select_color.html?id='.urlencode($id)."&color='+document.getElementById('$id').value,'colorPicker','width=240,height=187,scrollbars=no,resizable=no,toolbar=no');";
return '<input type="text" name="'.$name.'" id="'.$id.'" value="'.$this->htmlspecialchars($value).'" /> '.
'<a href="'.$this->phpgwapi_js_url.'/colorpicker/select_color.html?id='.urlencode($id).'" target="_blank" onclick="'.$onclick.'">'.
'<a href="#" onclick="'.$onclick.'">'.
'<img src="'.$this->phpgwapi_js_url.'/colorpicker/ed_color_bg.gif'.'"'.($title ? ' title="'.$this->htmlspecialchars($title).'"' : '')." /></a>";
}