Pārlūkot izejas kodu

[svn r20077] Logic change - Fixed style button and title when occurs and error require field - FS#3925

Cristian Fasanando 16 gadi atpakaļ
vecāks
revīzija
0587111c77
1 mainītis faili ar 9 papildinājumiem un 10 dzēšanām
  1. 9 10
      main/admin/system_announcements.php

+ 9 - 10
main/admin/system_announcements.php

@@ -1,4 +1,4 @@
-<?php // $Id: system_announcements.php 19895 2009-04-20 16:52:17Z cvargas1 $
+<?php // $Id: system_announcements.php 20077 2009-04-24 15:48:09Z cfasanando $
 /*
 /*
 ==============================================================================
 ==============================================================================
 	Dokeos - elearning and course management software
 	Dokeos - elearning and course management software
@@ -163,12 +163,9 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit')
 
 
 if ($action_todo)
 if ($action_todo)
 {
 {
-	if ($_GET['action'] == 'add')
-	{
+	if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'add') {
 		$form_title = get_lang('AddSystemAnnouncement');
 		$form_title = get_lang('AddSystemAnnouncement');
-	}
-	elseif ($_GET['action'] == 'edit')
-	{
+	} elseif (isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit') {
 		$form_title = get_lang('EditSystemAnnouncement');
 		$form_title = get_lang('EditSystemAnnouncement');
 	}
 	}
 	
 	
@@ -195,17 +192,19 @@ if ($action_todo)
 	$form->add_timewindow('start','end',get_lang('StartTimeWindow'),get_lang('EndTimeWindow'));
 	$form->add_timewindow('start','end',get_lang('StartTimeWindow'),get_lang('EndTimeWindow'));
 	$form->addElement('checkbox', 'visible_teacher', get_lang('Visible'), get_lang('Teacher'));
 	$form->addElement('checkbox', 'visible_teacher', get_lang('Visible'), get_lang('Teacher'));
 	$form->addElement('checkbox', 'visible_student', null, get_lang('Student'));
 	$form->addElement('checkbox', 'visible_student', null, get_lang('Student'));
-	$form->addElement('checkbox', 'visible_guest', null, get_lang('Guest'));
-	$form->addElement('hidden', 'action');
+	$form->addElement('checkbox', 'visible_guest', null, get_lang('Guest'));	
 	$form->addElement('hidden', 'id');
 	$form->addElement('hidden', 'id');
 	$form->addElement('checkbox', 'send_mail', get_lang('SendMail'));
 	$form->addElement('checkbox', 'send_mail', get_lang('SendMail'));
-	if ($_GET['action']=='add'){
+	
+	if (isset($_REQUEST['action']) && $_REQUEST['action']=='add') {
 		$text=get_lang('AddSystemAnnouncement');
 		$text=get_lang('AddSystemAnnouncement');
 		$class='add';
 		$class='add';
+		$form->addElement('hidden', 'action','add');
 		
 		
-	} elseif ($_GET['action']=='edit'){
+	} elseif (isset($_REQUEST['action']) && $_REQUEST['action']=='edit') {
 		$text=get_lang('EditSystemAnnouncement');
 		$text=get_lang('EditSystemAnnouncement');
 		$class='save';
 		$class='save';
+		$form->addElement('hidden', 'action','edit');
 	}
 	}
 	
 	
 	$form->addElement('style_submit_button', 'submit', $text,'class="'.$class.'"');
 	$form->addElement('style_submit_button', 'submit', $text,'class="'.$class.'"');