Changeset 347 in t29-www for lib/search.php
- Timestamp:
- Mar 6, 2013, 3:58:15 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/search.php
r290 r347 7 7 8 8 function page_handler() { 9 if(!isset($_GET['action'])) 9 if(!isset($_GET['action'])) { 10 // This is an "ordinary" page call. 11 // do some organisation stuff and return. 12 $this->setup_interlang(); 10 13 return; 14 } 11 15 $action = $_GET['action']; 12 16 if(array_key_exists($action, self::$actions)) { … … 40 44 exit; 41 45 } 46 47 /** 48 * Since the search isn't denoted in the navigation.xml, the interlanguage 49 * system doesn't work. This method fixes that by talking with t29Template. 50 * This must be done after including technikum29.php. 51 **/ 52 function setup_interlang() { 53 $GLOBALS['template_callback'] = function($template) { 54 // Interlanguage Links: Defakto nicht cachebar da das Cachesystem fuer dynamische Seiten 55 // den header/footer cacht und damit auch die Interlang-Eintraege. Links wie 56 // "/de/suche.php"+$_SERVER['QUERY_STRING'] funktionieren daher nicht dynamisch, 57 // da der Head ja gecacht wird. Ist ein nicht so wichtiges FIXME. 58 $template->set_interlang_link("de", "/de/suche.php", "Suche"); 59 $template->set_interlang_link("en", "/en/search.php", "Search"); 60 }; 61 } 62 63 function google_search_snippet() { 64 ?> 65 <script> 66 (function() { 67 var cx = '010117769997860607363:ovbd9zjaaps'; 68 var gcse = document.createElement('script'); 69 gcse.type = 'text/javascript'; 70 gcse.async = true; 71 gcse.src = (document.location.protocol == 'https' ? 'https:' : 'http:') + 72 '//www.google.com/cse/cse.js?cx=' + cx; 73 var s = document.getElementsByTagName('script')[0]; 74 s.parentNode.insertBefore(gcse, s); 75 })(); 76 </script> 77 <gcse:search></gcse:search> 78 <?php 79 } 42 80 }
Note: See TracChangeset
for help on using the changeset viewer.