+ initial commit
[sfa:tema.git] / page_gi-innspill.php
1 <?php
2 /**
3  * @package sfa
4  * @subpackage sfa-theme
5  */
6 /*
7 Template Name: Gi innspill
8 */
9
10 header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
11 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
12
13 require_once("settings.php");
14
15 get_header();
16
17 ?>
18       <div class="article layoutSidebar emptySidebar">
19         <div class="line">
20           <div class="unit size4of5">
21             <div id="section-main">
22
23
24
25
26               <!-- center column content goes here -->
27
28 <?php
29 // declaration and initialization
30
31 $arr_topic = $SFA_THEME_SETTINGS['webform_gi_innspill_topics'];
32 $arr_topic_mailto = $SFA_THEME_SETTINGS['webform_gi_innspill_receivers'];
33
34 $mail_from = $SFA_THEME_SETTINGS['webform_gi_innspill_email_from'];
35 $mail_subject = $SFA_THEME_SETTINGS['webform_gi_innspill_email_subject'];
36 $mail_subject_admin = $SFA_THEME_SETTINGS['webform_gi_innspill_email_subject_for_admin_receiver'];
37 $mail_general_body = $SFA_THEME_SETTINGS['webform_gi_innspill_email_body'];
38
39 // robot trap
40 $spinner = '';
41 $spinner_timeout = $SFA_THEME_SETTINGS['webform_spinner_timeout'];
42 $spinner_password = $SFA_THEME_SETTINGS['webform_spinner_password'];
43
44 $honeypot = '';
45
46 $mail_to_admin = '';
47
48 $form_subject='';
49 $form_topic='0';
50 $form_name='';
51 $form_alias='';
52 $form_email='';
53 $form_receipt=false;
54 $form_accept=false;
55
56 $form_url='';
57 $form_input='';
58
59 $str_error='';
60 $bool_form_registered = false;
61
62
63
64 // check if data should be validated and processed
65 if ($_SERVER['REQUEST_METHOD'] == 'POST')
66 {
67         // first we need to know which form we are processing
68         $form_type = bvt_get_input($_REQUEST['register-type']);
69
70         // based on form, set values
71         switch($form_type)
72         {
73                 case 'register-content':
74                         $form_subject = bvt_get_input($_REQUEST['register-content-subject']);
75                         $form_name = bvt_get_input($_REQUEST['register-content-name']);
76                         $form_alias = bvt_get_input($_REQUEST['register-content-alias']);
77                         $form_email = bvt_get_input($_REQUEST['register-content-email']);
78                         $form_topic = bvt_get_input($_REQUEST['register-content-topic']);
79                         $form_receipt = false;#bvt_get_input($_REQUEST['register-content-receipt']);
80                         $form_accept = bvt_get_input($_REQUEST['register-content-accept']);
81                         $form_url = bvt_get_input($_REQUEST['register-content-url']);
82                         $honeypot = bvt_get_input($_REQUEST['register-content-address']);
83                         break;
84                 case 'register-input':
85                         $form_subject = bvt_get_input($_REQUEST['register-input-subject']);
86                         $form_name = bvt_get_input($_REQUEST['register-input-name']);
87                         $form_alias = bvt_get_input($_REQUEST['register-input-alias']);
88                         $form_email = bvt_get_input($_REQUEST['register-input-email']);
89                         $form_topic = bvt_get_input($_REQUEST['register-input-topic']);
90                         $form_receipt = false;#bvt_get_input($_REQUEST['register-input-receipt']);
91                         $form_accept = bvt_get_input($_REQUEST['register-input-accept']);
92                         $form_input = bvt_get_input($_REQUEST['register-input-input']);
93                         $honeypot = bvt_get_input($_REQUEST['register-input-address']);
94                         break;
95                 case 'register-example':
96                         $form_subject = bvt_get_input($_REQUEST['register-example-subject']);
97                         $form_name = bvt_get_input($_REQUEST['register-example-name']);
98                         $form_alias = bvt_get_input($_REQUEST['register-example-alias']);
99                         $form_email = bvt_get_input($_REQUEST['register-example-email']);
100                         $form_topic = bvt_get_input($_REQUEST['register-example-topic']);
101                         $form_receipt = false;#bvt_get_input($_REQUEST['register-example-receipt']);
102                         $form_accept = bvt_get_input($_REQUEST['register-example-accept']);
103                         $form_url = bvt_get_input($_REQUEST['register-example-url']);
104                         $form_input = bvt_get_input($_REQUEST['register-example-input']);
105                         $honeypot = bvt_get_input($_REQUEST['register-example-address']);
106                         break;
107         }
108
109         if(get_magic_quotes_gpc())
110         {
111                 $form_subject = stripslashes($form_subject);
112                 $form_name = stripslashes($form_name);
113                 $form_alias = stripslashes($form_alias);
114                 $form_topic = stripslashes($form_topic);
115                 $form_input = stripslashes($form_input);
116                 $form_url = stripslashes($form_url);
117                 $form_email = stripslashes($form_email);
118
119         }
120
121         // process traps
122         $spinner = bvt_get_input($_REQUEST['spinner']);
123         $time = bvt_get_input($_REQUEST['timestamp']);
124
125         $diff = time()-$time;
126
127         if($diff < $spinner_timeout && $diff>0)
128         {
129                 if(!($spinner == sha1($spinner_password.$time)))
130                         $str_error .= "<li>Det ser ut som du har jukset litt, prøv igjen</li>";
131         }
132         else
133                 $str_error .= "<li>Beklager, du har vært inaktiv for lenge. Prøv å registrere på nytt.</li>";
134
135         if($honeypot!='')
136                 $str_error .= "<li>Ikke fyll ut feltet merket \"Ikke fyll ut dette feltet\"</li>";
137
138
139
140         // process shared elements
141         if($form_subject!='')
142         {
143                 $form_subject = htmlspecialchars($form_subject);
144         }
145         else
146                 $str_error .= "<li>Du må fylle ut emne</li>";
147
148         if($form_name!='')
149         {
150                 $form_name = htmlspecialchars($form_name);
151         }
152
153         if($form_alias!='')
154         {
155                 $form_alias = htmlspecialchars($form_alias);
156         }
157         else
158                 $str_error .= "<li>Fyll inn alias</li>";
159
160         if($form_email!='')
161         {
162                 $form_email = htmlspecialchars($form_email);
163
164                 if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $form_email))
165                         $str_error.= "<li>Ugyldig e-post adresse</li>";
166         }
167
168
169         if($form_topic!='')
170         {
171                 if($form_type!='register-content')
172                 {
173                         // no need for validation since we're just comparing values.
174                         foreach($arr_topic as $key=>$value)
175                         {
176                                 if($value==$form_topic)
177                                         $mail_to_admin = $arr_topic_mailto[$key];
178                         }
179                 }
180                 $form_topic=htmlspecialchars($form_topic);
181         }
182         else
183                 $str_error .= "<li>Velg et tema</li>";
184
185         if($form_receipt=="on")
186         {
187                 if($form_email!='')
188                         $form_receipt = true;
189                 else
190                         $str_error.= "<li>For å få kvittering må du fylle inn din e-post adresse</li>";
191         }
192
193         if($form_accept=="on")
194                 $form_accept = true;
195         else
196                 $str_error .= "<li>Du må akseptere betingelsene</li>";
197
198
199
200         // all above is shared, this is spesific to each form
201         if($form_type=='register-content')
202         {
203                 if($form_url!='')
204                 {
205                         $form_url = htmlspecialchars($form_url);
206                         if(!preg_match('/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i', $form_url))
207                                 $str_error.= "<li>Ugyldig url adresse</li>";
208                 }
209                 else
210                         $str_error .= "<li>URL kan ikke være tom</li>";
211         }
212         elseif($form_type=='register-input' || $form_type=='register-example')
213         {
214                 if($form_input!='')
215                 {
216                         $form_input = htmlspecialchars($form_input);
217                 }
218                 else
219                         $str_error .= "<li>Fyll inn input</li>";
220         }
221
222
223         // No errors. Input data is sanitized and can be saved to db, and sent on mail if neccessary.
224         if(empty($str_error))
225         {
226                 // based on which kind of form type we have, we save it to spesific table
227                 $query='';
228                 $mail_body_special='';
229                 $ip= $_SERVER['REMOTE_ADDR'];
230
231                 switch($form_type)
232                 {
233                         case 'register-content':
234                                 $query = "INSERT INTO ".$wpdb->prefix."input_article SET subject='" . $wpdb->escape($form_subject) . "', topic='" . $wpdb->escape(get_cat_name($form_topic)) . "', url='" . $wpdb->escape($form_url) . "', name='" . $wpdb->escape($form_name) . "', alias='" . $wpdb->escape($form_alias) . "', email='" . $wpdb->escape($form_email) . "', receipt='" . $wpdb->escape($form_receipt) . "', ip=INET_ATON('" . $ip . "'), date = now(), category_id = '" . $wpdb->escape($form_topic) . "'";
235                                 $mail_body_special = "<br/><br/>Emne: $form_subject<br/>Tema: " . get_cat_name($form_topic) . "<br/>Alias: $form_alias<br/>Navn: $form_name<br/>Epost: $form_email<br/>Adresse / URL: $form_url<br/>";
236                                 break;
237                         case 'register-input':
238                                 $query = "INSERT INTO ".$wpdb->prefix."input_input SET subject='" . $wpdb->escape($form_subject) . "', topic='" . $wpdb->escape(get_cat_name($form_topic)) . "', input='" . $wpdb->escape($form_input) . "', name='" . $wpdb->escape($form_name) . "', alias='" . $wpdb->escape($form_alias) . "', email='" . $wpdb->escape($form_email) . "', receipt='" . $wpdb->escape($form_receipt) . "', ip=INET_ATON('" . $ip . "'), date = now(), category_id = '" . $wpdb->escape($form_topic) . "'";
239                                 $mail_body_special = "<br/><br/>Emne: $form_subject<br/>Tema: " . get_cat_name($form_topic) . "<br/>Alias: $form_alias<br/>Navn: $form_name<br/>Epost: $form_email<br/>Innspill: $form_input<br/>";
240                                 $mail_subject_admin .= " - si din mening";
241                                 break;
242                         case 'register-example':
243                                 $query = "INSERT INTO ".$wpdb->prefix."input_example SET subject='" . $wpdb->escape($form_subject) . "', topic='" . $wpdb->escape(get_cat_name($form_topic)) . "', input='" . $wpdb->escape($form_input) . "', name='" . $wpdb->escape($form_name) . "', alias='" . $wpdb->escape($form_alias) . "', email='" . $wpdb->escape($form_email) . "', receipt='" . $wpdb->escape($form_receipt) . "', ip=INET_ATON('" . $ip . "'), date = now(), category_id = '" . $wpdb->escape($form_topic) . "'";
244                                 $mail_body_special = "<br/><br/>Emne: $form_subject<br/>Tema: " . get_cat_name($form_topic) . "<br/>Alias: $form_alias<br/>Navn: $form_name<br/>Epost: $form_email<br/>Eksempel: $form_input<br/>";
245                                 $mail_subject_admin .= " - godt eksempel";
246                                 break;
247                 }
248
249                 if($query!='' && $wpdb->query($query))
250                 {
251                         $headers =
252                                 'MIME-Version: 1.0' ."\r\n" .
253                                 'Content-Type: text/html; charset=UTF-8' . "\r\n" .
254                                 'Content-Transfer-Encoding: 7bit' . "\r\n" .
255                                 'X-Mailer: PHP/'. phpversion() . "\r\n" .
256                                 'From: '.$mail_from . "\r\n";
257
258                         if($form_email!='' && $form_receipt )
259                         {
260                                 if(!mail($form_email, $mail_subject, $mail_general_body.$mail_body_special, $headers))
261                                         echo "En feil oppstod under mailutsending. Kontakt oss gjerne om når, hvor og hvordan det skjedde.";
262                         }
263
264                         if($mail_to_admin!='')
265                         {
266                                 foreach(explode(";",$mail_to_admin) as $recipient)
267                                         mail($recipient, $mail_subject_admin, $mail_body_special, $headers);
268                         }
269
270                         $bool_form_registered = true;
271                 }
272         }
273         else
274         {
275                 // since everything has gone throught specialchars, we have to strip the slashes to make it user friendly
276                 $form_subject = stripslashes($form_subject);
277                 $form_name = stripslashes($form_name);
278                 $form_alias = stripslashes($form_alias);
279                 $form_input = stripslashes($form_input);
280                 $form_url = stripslashes($form_url);
281                 $form_email = stripslashes($form_email);
282         }
283 }
284
285 // $spinner is a part of the robot trap. If it's not set then it's a GET request.
286 if($spinner=='')
287 {
288         $time = time();
289         $spinner = sha1($spinner_password.$time);
290 }
291
292
293 if(!$bool_form_registered)
294 {
295         // TODO: front-end, style/move this as you seem fit
296         if($str_error!='')
297                 echo '<div class="text message error"><h1>Det oppstod en eller flere feil</h1><ul>'.$str_error.'</ul></div>';
298 ?>
299
300               <h1>Gi oss innspill</h1>
301               <p class="shortintro">Hensikten med samarbeidforarbeid.no er å legge til rette for debatt om viktige temaer som handler om å mobilisere arbeidskraften og sikre en fortsatt god utvikling i norsk økonomi. Herunder hvordan vi kan redusere sykefraværet, hindre frafall fra videregående opplæring, hvordan man kan legge til rette for etablering av nye arbeidsplasser og hvordan vi kan sikre gode velferdsordninger for kommende generasjoner. Vi ønsker innspill til utviklingen av disse politikkområdene.</p>
302
303               <div class="webforms accordion mod shadow">
304                 <h2 id="registrer-artikkel-eller-blogginnlegg" class="heading">
305                   <span>Registrer blogginnlegg eller artikkel</span>
306                 </h2>
307
308                   <form id="registrer-artikkel-eller-blogginnlegg-form" class="webform" method="post" action="#registrer-artikkel-eller-blogginnlegg">
309                     <!--  ff3 fix -->
310                     <div>
311                       <input class="accessibilityHidden" type="hidden" name="register-type" value="register-content"/>
312                       <input class="accessibilityHidden" type="hidden" name="timestamp"  value="<?php echo $time ?>"/>
313                       <input class="accessibilityHidden" type="hidden" name="spinner"  value="<?php echo $spinner ?>"/>
314                     </div>
315                     <fieldset>
316
317                         <p class="shortintro">Kjenner du til et blogginnlegg? Tips oss da vel!</p>
318                         <hr/>
319                         <div class="line">
320                           <div class="unit size2of5">
321                             <label for="register-content-subject" class="required">Emne</label>
322                           </div>
323                           <div class="unit size3of5 lastUnit">
324                             <input class="required" id="register-content-subject" type="text" name="register-content-subject" value="<?php echo $form_subject ?>" />
325                           </div>
326                         </div>
327                         <div class="line">
328                           <div class="unit size2of5">
329                              <label class="required" for="register-content-url">Adresse / URL</label>
330                           </div>
331                           <div class="unit size3of5 lastUnit">
332                             <input class="required url" id="register-content-url" type="text" name="register-content-url" value="<?php echo $form_url ?>" />
333                           </div>
334                         </div>
335                         <div class="line">
336                           <div class="unit size2of5">
337                             <label for="register-content-topic">Hvilket tema handler blogginnlegget om?</label>
338                           </div>
339                           <div class="unit size3of5 lastUnit">
340                                                         <?php
341                                                                 wp_dropdown_categories(array(
342                                                                   "show_option_none" => 'Velg tema',
343                                                                   "exclude" => 1,  /* 1 is "Uncategorized" */
344                                                                   "hide_empty" => false,
345                                                                   "hierarchical" => 0,
346                                                                   "name" => "register-content-topic",
347                                                                   "child_of" => get_cat_id('Tema'),
348                                                                   "selected" => $form_topic,
349                                                                   "class" => "required"
350                                                                 ));
351                                                         ?>
352                           </div>
353                         </div>
354                         <div class="line">
355                           <div class="unit size2of5">
356                             <label for="register-content-name">Navn (ikke offentlig)</label>
357                           </div>
358                           <div class="unit size3of5 lastUnit">
359                             <input id="register-content-name" type="text" name="register-content-name" value="<?php echo $form_name ?>" />
360                           </div>
361                         </div>
362                         <div class="line">
363                           <div class="unit size2of5">
364                             <label class="required" for="register-content-alias">Alias (offentlig)</label>
365                           </div>
366                           <div class="unit size3of5 lastUnit">
367                              <input class="required" id="register-content-alias" type="text" name="register-content-alias" value="<?php echo $form_alias ?>" />
368                           </div>
369                         </div>
370                         <div class="line">
371                           <div class="unit size2of5">
372                             <label for="register-content-email">E-postadresse (ikke offentlig)</label>
373                           </div>
374                           <div class="unit size3of5 lastUnit">
375                              <input class="email" id="register-content-email" type="text" name="register-content-email" value="<?php echo $form_email?>"/>
376                           </div>
377                         </div>
378                         <div class="line hidden">
379                           <div class="unit size2of5">
380                             <label for="register-content-address">Ikke fyll ut denne</label>
381                           </div>
382                           <div class="unit size3of5 lastUnit">
383                             <input id="register-content-address" type="text" name="register-content-address" />
384                           </div>
385                         </div>
386                         <!--div class="line">
387                           <div class="unit size2of5">
388                              <label for="register-content-receipt">Jeg ønsker å få tilsendt kvittering</label>
389                           </div>
390                           <div class="unit size3of5 lastUnit">
391                               <input class="checkbox" id="register-content-receipt" type="checkbox" name="register-content-receipt" <?php if($form_receipt) { echo "checked=\"checked\""; } ?> />
392                           </div>
393                         </div-->
394                         <div class="line">
395                           <div class="unit size2of5">
396                             <label class="required" for="register-content-accept">
397                               Jeg har lest <a class="external" href="vilkaar">Vilkårene (Åpnes i nytt vindu)</a> og er innforstått med at mitt innspill vil kunne bli publisert på www.samarbeidforarbeid.no eller på annen måte gjort tilgjengelig for de som ber om å få det.
398                             </label>
399                           </div>
400                           <div class="unit size3of5 lastUnit">
401                             <input class="checkbox required" id="register-content-accept" type="checkbox" name="register-content-accept" <?php if($form_accept) { echo "checked=\"checked\""; } ?> />
402                           </div>
403                         </div>
404                         <hr/>
405
406                         <button name="register-article" type="submit" class="btn btn-green goto"><span>Registrer</span></button>
407
408                     </fieldset>
409                   </form>
410
411                 <h2 id="si-din-mening"><span>Si din mening</span></h2>
412
413                   <form id="si-din-mening-form" class="webform" method="post" action="#si-din-mening">
414                     <div>
415                       <input class="accessibilityHidden" type="hidden" name="register-type" value="register-input"/>
416                       <input class="accessibilityHidden" type="hidden" name="timestamp"  value="<?php echo $time ?>"/>
417                       <input class="accessibilityHidden" type="hidden" name="spinner"  value="<?php echo $spinner ?>"/>
418                     </div>
419                     <fieldset>
420
421                         <p class="shortintro">Ønsker du å gi din mening om et av våre temaer?</p>
422                         <hr/>
423                         <div class="line">
424                           <div class="unit size2of5">
425                             <label for="register-input-subject" class="required">Emne</label>
426                           </div>
427                           <div class="unit size3of5 lastUnit">
428                             <input class="required" id="register-input-subject" type="text" name="register-input-subject" value="<?php echo $form_subject ?>" />
429                           </div>
430                         </div>
431                         <div class="line">
432                           <div class="unit size2of5">
433                             <label for="register-input-topic">Hvilket tema handler meningen om?</label>
434                           </div>
435                           <div class="unit size3of5 lastUnit">
436                                                         <?php
437                                                                 wp_dropdown_categories(array(
438                                                                   "show_option_none" => 'Velg tema',
439                                                                   "exclude" => 1,  /* 1 is "Uncategorized" */
440                                                                   "hide_empty" => false,
441                                                                   "hierarchical" => 0,
442                                                                   "name" => "register-input-topic",
443                                                                   "child_of" => get_cat_id('Tema'),
444                                                                   "selected" => $form_topic,
445                                                                   "class" => "required"
446                                                                 ));
447                                                         ?>
448                           </div>
449                         </div>
450                         <div class="line">
451                           <div class="unit size2of5">
452                              <label class="required" for="register-input-input">Innspill</label>
453                           </div>
454                           <div class="unit size3of5 lastUnit">
455                             <textarea class="required" cols="5" rows="10" id="register-input-input" name="register-input-input"><?php echo $form_input ?></textarea>
456                           </div>
457                         </div>
458                         <div class="line">
459                           <div class="unit size2of5">
460                             <label for="register-input-name">Navn (ikke offentlig)</label>
461                           </div>
462                           <div class="unit size3of5 lastUnit">
463                             <input id="register-input-name" type="text" name="register-input-name" value="<?php echo $form_name ?>" />
464                           </div>
465                         </div>
466                         <div class="line">
467                           <div class="unit size2of5">
468                             <label class="required" for="register-input-alias">Alias (offentlig)</label>
469                           </div>
470                           <div class="unit size3of5 lastUnit">
471                              <input class="required" id="register-input-alias" type="text" name="register-input-alias" value="<?php echo $form_alias ?>" />
472                           </div>
473                         </div>
474                         <div class="line">
475                           <div class="unit size2of5">
476                             <label for="register-input-email">E-postadresse (ikke offentlig)</label>
477                           </div>
478                           <div class="unit size3of5 lastUnit">
479                              <input class="email" id="register-input-email" type="text" name="register-input-email" value="<?php echo $form_email ?>"/>
480                           </div>
481                         </div>
482               <div class="line hidden">
483                           <div class="unit size2of5">
484                             <label for="register-input-address">Ikke fyll ut denne</label>
485                           </div>
486                           <div class="unit size3of5 lastUnit">
487                             <input id="register-input-address" type="text" name="register-input-address" value="" />
488                           </div>
489                         </div>
490                         <!--div class="line">
491                           <div class="unit size2of5">
492                              <label for="register-input-receipt">Jeg ønsker å få tilsendt kvittering</label>
493                           </div>
494                           <div class="unit size3of5 lastUnit">
495                               <input class="checkbox" id="register-input-receipt" type="checkbox" name="register-input-receipt" <?php if($form_receipt) { echo "checked=\"checked\""; } ?> />
496                           </div>
497                         </div-->
498                         <div class="line">
499                           <div class="unit size2of5">
500                             <label class="required" for="register-content-accept">
501                               Jeg har lest <a class="external" href="vilkaar">Vilkårene (Åpnes i nytt vindu)</a> og er innforstått med at mitt innspill vil kunne bli publisert på www.samarbeidforarbeid.no eller på annen måte gjort tilgjengelig for de som ber om å få det.
502                             </label>
503                           </div>
504                           <div class="unit size3of5 lastUnit">
505                             <input class="checkbox required" id="register-input-accept" type="checkbox" name="register-input-accept" <?php if($form_accept) { echo "checked=\"checked\""; } ?> />
506                           </div>
507                         </div>
508                         <hr />
509                         <button name="register-opinion" type="submit" class="btn btn-green goto"><span>Registrer</span></button>
510
511                     </fieldset>
512                 </form>
513                 <h2 id="gode-eksempler"><span>Send inn gode eksempler</span></h2>
514                 <form id="gode-eksempler-form" class="webform" method="post" action="#gode-eksempler">
515                   <div>
516                     <input class="accessibilityHidden" type="hidden" name="register-type" value="register-example"/>
517                     <input class="accessibilityHidden" type="hidden" name="timestamp"  value="<?php echo $time ?>"/>
518                     <input class="accessibilityHidden" type="hidden" name="spinner"  value="<?php echo $spinner ?>"/>
519                   </div>
520                   <fieldset>
521                       <p class="shortintro">Har du et godt eksempel? Tips oss da vel!</p>
522                       <hr/>
523                       <div class="line">
524                         <div class="unit size2of5">
525                           <label for="register-example-subject" class="required">Emne</label>
526                         </div>
527                         <div class="unit size3of5 lastUnit">
528                           <input class="required" id="register-example-subject" type="text" name="register-example-subject" value="<?php echo $form_subject ?>" />
529                         </div>
530                       </div>
531                       <div class="line">
532                         <div class="unit size2of5">
533                           <label for="register-example-topic">Hvilket tema handler det gode eksempelet om?</label>
534                         </div>
535                         <div class="unit size3of5 lastUnit">
536                                                   <?php
537                                                                 wp_dropdown_categories(array(
538                                                                   "show_option_none" => 'Velg tema',
539                                                                   "exclude" => 1,  /* 1 is "Uncategorized" */
540                                                                   "hide_empty" => false,
541                                                                   "hierarchical" => 0,
542                                                                   "name" => "register-example-topic",
543                                                                   "child_of" => get_cat_id('Tema'),
544                                                                   "selected" => $form_topic,
545                                                                   "class" => "required"
546                                                                 ));
547                                                         ?>
548                         </div>
549                       </div>
550                       <div class="line">
551                         <div class="unit size2of5">
552                            <label class="required" for="register-example-input">Godt eksempel</label>
553                         </div>
554                         <div class="unit size3of5 lastUnit">
555                           <textarea class="required" cols="5" rows="10" id="register-example-input" name="register-example-input"><?php echo $form_input ?></textarea>
556                         </div>
557                       </div>
558                       <div class="line">
559                         <div class="unit size2of5">
560                           <label for="register-example-name">Navn (ikke offentlig)</label>
561                         </div>
562                         <div class="unit size3of5 lastUnit">
563                           <input id="register-example-name" type="text" name="register-example-name" value="<?php echo $form_name ?>" />
564                         </div>
565                       </div>
566                       <div class="line">
567                         <div class="unit size2of5">
568                           <label class="required" for="register-example-alias">Alias (offentlig)</label>
569                         </div>
570                         <div class="unit size3of5 lastUnit">
571                            <input class="required" id="register-example-alias" type="text" name="register-example-alias" value="<?php echo $form_alias ?>" />
572                         </div>
573                       </div>
574                       <div class="line">
575                         <div class="unit size2of5">
576                           <label for="register-example-email">E-postadresse (ikke offentlig)</label>
577                         </div>
578                         <div class="unit size3of5 lastUnit">
579                            <input class="email" id="register-example-email" type="text" name="register-example-email" value="<?php echo $form_email ?>"/>
580                         </div>
581                       </div>
582                                           <div class="line accessibilityHidden">
583                         <div class="unit size2of5">
584                           <label for="register-example-address">Ikke fyll ut denne</label>
585                         </div>
586                         <div class="unit size3of5 lastUnit">
587                           <input id="register-example-address" type="text" name="register-example-address" value="" />
588                         </div>
589                       </div>
590                       <!--div class="line">
591                         <div class="unit size2of5">
592                            <label for="register-example-receipt">Jeg ønsker å få tilsendt kvittering</label>
593                         </div>
594                         <div class="unit size3of5 lastUnit">
595                             <input class="checkbox" id="register-example-receipt" type="checkbox" name="register-example-receipt" <?php if($form_receipt) { echo "checked=\"checked\""; } ?> />
596                         </div>
597                       </div-->
598                       <div class="line">
599                         <div class="unit size2of5">
600                           <label class="required" for="register-content-accept">
601                             Jeg har lest <a class="external" href="vilkaar">Vilkårene (Åpnes i nytt vindu)</a> og er innforstått med at mitt innspill vil kunne bli publisert på www.samarbeidforarbeid.no eller på annen måte gjort tilgjengelig for de som ber om å få det.
602                           </label>
603                         </div>
604                         <div class="unit size3of5 lastUnit">
605                           <input class="checkbox required" id="register-example-accept" type="checkbox" name="register-example-accept" <?php if($form_receipt) { echo "checked=\"checked\""; } ?> />
606                         </div>
607                       </div>
608                       <hr />
609                       <button name="register-good-example" type="submit" class="btn btn-green goto"><span>Registrer</span></button>
610                   </fieldset>
611                 </form>
612               </div>
613
614 <?php
615 }
616 else {
617 ?>
618
619
620 <h1>Takk for at du tok deg tid.</h1>
621 <div class="resource-container">
622   <a class="external video" href="http://www.fluvi.tv/players/DSS/player.swf?watch=1285&amp;width=540">Se video</a>
623 </div>
624 <div class="text">
625   <p>Takk for ditt innspill og for at du engasjerer deg i Samarbeid for arbeid. Hensikten med www.samarbeidforarbeid.no er å tilrettelegge for debatt og få fram synspunkter, ideer og forslag. Gjennom å sende inn innspill har du bidratt til dette. Du vil ikke motta et spesifikt svar på din henvendelse, men noen innspill vil bli løftet fram på Samarbeid for arbeid.</p>
626   <p>Dersom du ønsker at departementet skal følge opp saken videre på grunnlag av de ting du tar opp eller dersom du ønsker å få et svar på dine spørsmål må du henvende deg til departementet per e-post eller sende et vanlig brev.</p>
627   <p>Dersom du vil gi flere innspill gå tilbake til <a href="<?php echo get_option('siteurl') ?>/gi-innspill/">gi oss et innspill</a>.</p>  
628 </div>
629 <?php
630 }
631 ?>
632             </div>
633           </div>
634         </div>
635       </div>
636
637 <?php get_footer();
638
639
640 function bvt_get_input($variable)
641 {
642         return !empty($variable)||trim($variable)!='' ? trim($variable) : '';
643 }
644
645 ?>
646