Changeset 10060
- Timestamp:
- 12/01/08 07:54:03 (1 month ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/0.8/jaws/html/gadgets/Contact/HTML.php
r10022 r10060 93 93 { 94 94 $GLOBALS['app']->Session->PushSimpleResponse(_t('GLOBAL_ERROR_INCOMPLETE_FIELDS'), 'Contact'); 95 $GLOBALS['app']->Session->PushSimpleResponse($post, 'Contact_Data'); 95 96 Jaws_Header::Referrer(); 96 97 } … … 104 105 if (!$captcha->Check()) { 105 106 $GLOBALS['app']->Session->PushSimpleResponse(_t('GLOBAL_CAPTCHA_ERROR_DOES_NOT_MATCH'), 'Contact'); 107 $GLOBALS['app']->Session->PushSimpleResponse($post, 'Contact_Data'); 106 108 Jaws_Header::Referrer(); 107 109 } … … 113 115 if (Validate::email($post['contact_email'], true) === false) { 114 116 $GLOBALS['app']->Session->PushSimpleResponse(_t('CONTACT_RESULT_BAD_EMAIL_ADDRESS'), 'Contact'); 117 $GLOBALS['app']->Session->PushSimpleResponse($post, 'Contact_Data'); 115 118 Jaws_Header::Referrer(); 116 119 } branches/0.8/jaws/html/gadgets/Contact/LayoutHTML.php
r9759 r10060 49 49 $tpl->SetVariable('btn_send', $btnSend->Get()); 50 50 51 $xss = $GLOBALS['app']->loadClass('XSS', 'Jaws_XSS'); 52 $last_message = $GLOBALS['app']->Session->PopSimpleResponse('Contact_Data'); 51 53 if ($response = $GLOBALS['app']->Session->PopSimpleResponse('Contact')) { 52 54 $tpl->SetBlock('contact/response'); … … 55 57 } 56 58 57 $xss = $GLOBALS['app']->loadClass('XSS', 'Jaws_XSS');58 59 59 //name 60 60 if (in_array('name', $items_array)) { 61 61 $tpl->SetBlock('contact/name'); 62 62 $tpl->SetVariable('lbl_name', _t('GLOBAL_NAME')); 63 $name = Jaws_Session_Web::GetCookie('visitor_name'); 63 $name = isset($last_message['contact_name'])? 64 $last_message['contact_name'] : Jaws_Session_Web::GetCookie('visitor_name'); 64 65 $tpl->SetVariable('name', isset($name)? $xss->filter($name) : ''); 65 66 $tpl->ParseBlock('contact/name'); … … 70 71 $tpl->SetBlock('contact/email'); 71 72 $tpl->SetVariable('lbl_email', _t('GLOBAL_EMAIL')); 72 $email = Jaws_Session_Web::GetCookie('visitor_email'); 73 $email = isset($last_message['contact_email'])? 74 $last_message['contact_email'] : Jaws_Session_Web::GetCookie('visitor_email'); 73 75 $tpl->SetVariable('email', isset($email)? $xss->filter($email) : ''); 74 76 $tpl->ParseBlock('contact/email'); … … 79 81 $tpl->SetBlock('contact/company'); 80 82 $tpl->SetVariable('lbl_company', _t('CONTACT_COMPANY')); 83 $company = isset($last_message['contact_company'])? $last_message['contact_company'] : ''; 84 $tpl->SetVariable('company', $xss->filter($company)); 81 85 $tpl->ParseBlock('contact/company'); 82 86 } … … 86 90 $tpl->SetBlock('contact/url'); 87 91 $tpl->SetVariable('lbl_url', _t('GLOBAL_URL')); 88 $url = Jaws_Session_Web::GetCookie('visitor_url'); 92 $url = isset($last_message['contact_url'])? 93 $last_message['contact_url'] : Jaws_Session_Web::GetCookie('visitor_url'); 89 94 $tpl->SetVariable('url', isset($url)? $xss->filter($url) : 'http://'); 90 95 $tpl->ParseBlock('contact/url'); … … 95 100 $tpl->SetBlock('contact/tel'); 96 101 $tpl->SetVariable('lbl_tel', _t('CONTACT_TEL')); 102 $tel = isset($last_message['contact_tel'])? $last_message['contact_tel'] : ''; 103 $tpl->SetVariable('tel', $xss->filter($tel)); 97 104 $tpl->ParseBlock('contact/tel'); 98 105 } … … 102 109 $tpl->SetBlock('contact/fax'); 103 110 $tpl->SetVariable('lbl_fax', _t('CONTACT_FAX')); 111 $fax = isset($last_message['contact_fax'])? $last_message['contact_fax'] : ''; 112 $tpl->SetVariable('fax', $xss->filter($fax)); 104 113 $tpl->ParseBlock('contact/fax'); 105 114 } … … 109 118 $tpl->SetBlock('contact/mobile'); 110 119 $tpl->SetVariable('lbl_mobile', _t('CONTACT_MOBILE')); 120 $mobile = isset($last_message['contact_mobile'])? $last_message['contact_mobile'] : ''; 121 $tpl->SetVariable('mobile', $xss->filter($mobile)); 111 122 $tpl->ParseBlock('contact/mobile'); 112 123 } … … 116 127 $tpl->SetBlock('contact/address'); 117 128 $tpl->SetVariable('lbl_address', _t('CONTACT_ADDRESS')); 129 $address = isset($last_message['contact_address'])? $last_message['contact_address'] : ''; 130 $tpl->SetVariable('address', $xss->filter($address)); 118 131 $tpl->ParseBlock('contact/address'); 119 132 } … … 148 161 'name' => $GLOBALS['app']->Registry->Get('/config/owner_name')); 149 162 } 163 164 $rcpt = isset($last_message['contact_recipient'])? $last_message['contact_recipient'] : ''; 150 165 foreach ($recipients as $recipient) { 151 166 $tpl->SetBlock('contact/recipient/item'); 152 167 $tpl->SetVariable('recipient_id', $recipient['id']); 153 168 $tpl->SetVariable('recipient_name', $recipient['name']); 169 $tpl->SetVariable('selected', ($rcpt== $recipient['id'])? 'selected="selected"': ''); 154 170 $tpl->ParseBlock('contact/recipient/item'); 155 171 } … … 161 177 $tpl->SetBlock('contact/subject'); 162 178 $tpl->SetVariable('lbl_subject', _t('CONTACT_SUBJECT')); 179 $subject = isset($last_message['contact_subject'])? $last_message['contact_subject'] : ''; 180 $tpl->SetVariable('subject', $xss->filter($subject)); 163 181 $tpl->ParseBlock('contact/subject'); 164 182 } … … 168 186 $tpl->SetBlock('contact/message'); 169 187 $tpl->SetVariable('lbl_message', _t('CONTACT_MESSAGE')); 188 $message = isset($last_message['contact_message'])? $last_message['contact_message'] : ''; 189 $tpl->SetVariable('message', $xss->filter($message)); 170 190 $tpl->ParseBlock('contact/message'); 171 191 } branches/0.8/jaws/html/gadgets/Contact/templates/Contact.html
r9259 r10060 52 52 <p><label>{lbl_recipient}:</label> 53 53 <select name="contact_recipient"> 54 <!-- BEGIN item --><option value="{recipient_id}" >{recipient_name}</option><!-- END item -->54 <!-- BEGIN item --><option value="{recipient_id}" {selected}>{recipient_name}</option><!-- END item --> 55 55 </select> 56 56 </p> … … 62 62 <!-- BEGIN message --> 63 63 <p><label>{lbl_message}:</label> 64 <textarea name="contact_message" cols="25" rows="6"> </textarea>64 <textarea name="contact_message" cols="25" rows="6">{message}</textarea> 65 65 </p> 66 66 <!-- END message -->
