Fix not working notification in addressbook contactform

This commit is contained in:
Hadi Nategh 2016-12-08 12:33:32 +01:00
parent 4d1cdc2344
commit 05b526c665

View File

@ -60,11 +60,6 @@ class addressbook_contactform
*/ */
function display_var(array &$content=null,$addressbook=null,$fields=null,$msg=null,$email=null,$tpl_name=null,$subject=null,$copytoreceiver=false,$sel_options=array()) function display_var(array &$content=null,$addressbook=null,$fields=null,$msg=null,$email=null,$tpl_name=null,$subject=null,$copytoreceiver=false,$sel_options=array())
{ {
// allow to preset variables via get parameters
if ($_SERVER['REQUEST_METHOD'] == 'GET')
{
$content = array_merge($_GET, (array)$content);
}
#error_log( "<p>addressbook_contactform::display(".print_r($content,true).",$addressbook,".print_r($fields,true).",$msg,$tpl_name)</p>\n"); #error_log( "<p>addressbook_contactform::display(".print_r($content,true).",$addressbook,".print_r($fields,true).",$msg,$tpl_name)</p>\n");
if (empty($tpl_name) && !empty($content['tpl_form_name'])) $tpl_name =$content['tpl_form_name']; if (empty($tpl_name) && !empty($content['tpl_form_name'])) $tpl_name =$content['tpl_form_name'];
$tpl = new etemplate($tpl_name ? $tpl_name : 'addressbook.contactform'); $tpl = new etemplate($tpl_name ? $tpl_name : 'addressbook.contactform');
@ -220,6 +215,13 @@ class addressbook_contactform
$content['captcha_task'] = sprintf('%d - %d =',$num1,$num2); $content['captcha_task'] = sprintf('%d - %d =',$num1,$num2);
$preserv['captcha_result'] = $num1-$num2; $preserv['captcha_result'] = $num1-$num2;
} }
// allow to preset variables via get parameters
if ($_SERVER['REQUEST_METHOD'] == 'GET')
{
$content = array_merge($_GET, (array)$content);
}
return $tpl->exec($this->callback,$content,$sel_options,array(),$preserv); return $tpl->exec($this->callback,$content,$sel_options,array(),$preserv);
} }
} }