From 29028a36034c944da381ebc326d0078cebd2c8c3 Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Sun, 1 Feb 2009 11:56:11 +0100 Subject: [PATCH] [svn r18112] FS#2867 - Forcing the introduction sections module to work in Surveys tool. --- main/inc/introductionSection.inc.php | 38 ++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/main/inc/introductionSection.inc.php b/main/inc/introductionSection.inc.php index 8d8adb70d9..e1b01ced87 100644 --- a/main/inc/introductionSection.inc.php +++ b/main/inc/introductionSection.inc.php @@ -62,7 +62,14 @@ $intro_cmdUpdate = (empty($_POST['intro_cmdUpdate'])?'':$_POST['intro_cmdUpdate' $intro_cmdDel= (empty($_GET['intro_cmdDel'])?'':$_GET['intro_cmdDel']); $intro_cmdAdd= (empty($_GET['intro_cmdAdd'])?'':$_GET['intro_cmdAdd']); -$form = new FormValidator('introduction_text'); +if (!empty ($GLOBALS["_cid"])) +{ + $form = new FormValidator('introduction_text', 'post', api_get_self()."?".api_get_cidreq()); +} +else +{ + $form = new FormValidator('introduction_text'); +} $renderer =& $form->defaultRenderer(); $renderer->setElementTemplate('
{element}
'); @@ -173,16 +180,31 @@ if ($intro_dispCommand) { if( empty($intro_content) ) // displays "Add intro" Commands { - echo "

\n", - "\n",get_lang('AddIntro'),"\n", - "

\n
"; + echo "

\n"; + if (!empty ($GLOBALS["_cid"])) + { + echo "\n".get_lang('AddIntro')."\n"; + } + else + { + echo "\n".get_lang('AddIntro')."\n"; + } + echo "

\n
"; } else // displays "edit intro && delete intro" Commands { - echo "

\n", - "\"",get_lang('Modify'),"\"\n", - "\"",get_lang('Delete'),"\"\n", - "

\n
"; + echo "

\n"; + if (!empty ($GLOBALS["_cid"])) + { + echo "\"".get_lang('Modify')."\"\n"; + echo "\"".get_lang('Delete')."\"\n"; + } + else + { + echo "\"".get_lang('Modify')."\"\n"; + echo "\"".get_lang('Delete')."\"\n"; + } + echo "

\n
"; } } ?>