fixed the right scroll-arrow and register_globals off

This commit is contained in:
Ralf Becker 2003-09-22 15:01:26 +00:00
parent b7434519e0
commit 856490c918
2 changed files with 31 additions and 28 deletions

View File

@ -48,14 +48,10 @@
{
$this->so = CreateObject('calendar.soholiday');
if(isset($GLOBALS['start'])) { $this->start = intval($GLOBALS['start']); } else { $this->start = 0; }
if(isset($GLOBALS['query'])) { $this->query = $GLOBALS['query']; }
if(isset($GLOBALS['sort'])) { $this->sort = $GLOBALS['sort']; }
if(isset($GLOBALS['order'])) { $this->order = $GLOBALS['order']; }
$this->start = intval(get_var('start',array('POST','GET')));
$this->query = get_var('query',array('POST','GET'));
$this->sort = get_var('sort',array('POST','GET'));
$this->order = get_var('order',array('POST','GET'));
$this->id = get_var('id',array('POST','GET'));
$this->year = get_var('year',array('POST','GET'),date('Y'));
$this->locale = get_var('locale',array('POST','GET'));
@ -137,7 +133,7 @@
function accept_holiday()
{
$send_back_to = str_replace('submitlocale','holiday_admin',$GLOBALS['HTTP_REFERER']);
$send_back_to = str_replace('submitlocale','holiday_admin',$_SERVER['HTTP_REFERER']);
if(!@$this->locales[0])
{
Header('Location: '.$send_back_to);
@ -145,13 +141,13 @@
$send_back_to = str_replace('&locale='.$this->locales[0],'',$send_back_to);
$file = './holidays.'.$this->locales[0];
if(!file_exists($file) && count($GLOBALS['HTTP_POST_VARS']['name']))
if(!file_exists($file) && count($_POST['name']))
{
$c_holidays = count($GLOBALS['HTTP_POST_VARS']['name']);
$c_holidays = count($_POST['name']);
$fp = fopen($file,'w');
for($i=0;$i<$c_holidays;$i++)
{
fwrite($fp,$this->locales[0]."\t".$GLOBALS['HTTP_POST_VARS']['name'][$i]."\t".$GLOBALS['HTTP_POST_VARS']['day'][$i]."\t".$GLOBALS['HTTP_POST_VARS']['month'][$i]."\t".$GLOBALS['HTTP_POST_VARS']['occurence'][$i]."\t".$GLOBALS['HTTP_POST_VARS']['dow'][$i]."\t".$GLOBALS['HTTP_POST_VARS']['observance'][$i]."\n");
fwrite($fp,$this->locales[0]."\t".$_POST['name'][$i]."\t".$_POST['day'][$i]."\t".$_POST['month'][$i]."\t".$_POST['occurence'][$i]."\t".$_POST['dow'][$i]."\t".$_POST['observance'][$i]."\n");
}
fclose($fp);
}
@ -233,7 +229,7 @@
@set_time_limit(0);
/* get the file that contains the calendar events for your locale */
/* "http://www.phpgroupware.org/cal/holidays.US"; */
/* "http://www.egroupware.org/cal/holidays.US"; */
$network = CreateObject('phpgwapi.network');
if(isset($GLOBALS['phpgw_info']['server']['holidays_url_path']) && $GLOBALS['phpgw_info']['server']['holidays_url_path'] != 'localhost')
{
@ -295,9 +291,9 @@
function add()
{
if(@$GLOBALS['HTTP_POST_VARS']['submit'])
if(@$_POST['submit'])
{
$holiday = $GLOBALS['HTTP_POST_VARS']['holiday'];
$holiday = $_POST['holiday'];
if(empty($holiday['mday']))
{

View File

@ -145,17 +145,22 @@
$p->set_block('locale','row_empty','row_empty');
$p->set_block('locale','back_button_form','back_button_form');
$html = CreateObject('calendar.html');
if (!is_object($GLOBALS['phpgw']->html))
{
$GLOBALS['phpgw']->html = CreateObject('phpgwapi.html');
}
$html = &$GLOBALS['phpgw']->html;
$year_form = str_replace('<option value=""></option>','',$html->form($html->sbox_submit($this->sb->getYears('year',$this->bo->year),true),array(),
$this->base_url,Array('menuaction'=>'calendar.uiholiday.edit_locale','locale'=>$this->bo->locales[0])));
unset($html);
$holidays = $this->bo->get_holiday_list();
$total = count($holidays);
$var = Array(
'th_bg' => $GLOBALS['phpgw_info']['theme']['th_bg'],
'left_next_matchs' => $GLOBALS['phpgw']->nextmatchs->left('/index.php',$this->bo->start,$this->bo->total,'&menuaction=calendar.uiholiday.edit_locale&locale='.$this->bo->locales[0].'&year='.$this->bo->year),
'right_next_matchs' => $GLOBALS['phpgw']->nextmatchs->right('/index.php',$this->bo->start,$this->bo->total,'&menuaction=calendar.uiholiday.edit_locale&locale='.$this->bo->locales[0].'&year='.$this->bo->year),
'left_next_matchs' => $GLOBALS['phpgw']->nextmatchs->left('/index.php',$this->bo->start,$total,'&menuaction=calendar.uiholiday.edit_locale&locale='.$this->bo->locales[0].'&year='.$this->bo->year),
'right_next_matchs' => $GLOBALS['phpgw']->nextmatchs->right('/index.php',$this->bo->start,$total,'&menuaction=calendar.uiholiday.edit_locale&locale='.$this->bo->locales[0].'&year='.$this->bo->year),
'center' => '<td align="right">'.lang('Holidays').' ('.$this->bo->locales[0].')</td><td align="left">'.$year_form.'</td>',
'sort_name' => $GLOBALS['phpgw']->nextmatchs->show_sort_order($this->bo->sort,'name',$this->bo->order,'/index.php',lang('Holiday'),'&menuaction=calendar.uiholiday.edit_locale&locale='.$this->bo->locales[0].'&year='.$this->bo->year),
'header_edit' => lang('Edit'),
@ -175,7 +180,9 @@
else
{
$maxmatchs = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
for($i=$this->bo->start; $i < count($holidays) && $i < $this->bo->start+$maxmatchs; $i++)
$end = min($total,$this->bo->start+$maxmatchs);
$p->set_var('rows',lang('showing %1 - %2 of %3',1+$this->bo->start,$end,$total));
for($i=$this->bo->start; $i < $end; $i++)
{
$tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
if (!$holidays[$i]['name'])