equal
deleted
inserted
replaced
133 |
133 |
134 function init_vars() |
134 function init_vars() |
135 { |
135 { |
136 global $db, $session, $paths, $template, $plugins; // Common objects |
136 global $db, $session, $paths, $template, $plugins; // Common objects |
137 global $email; |
137 global $email; |
|
138 global $lang; |
138 |
139 |
139 dc_here("template: initializing all variables"); |
140 dc_here("template: initializing all variables"); |
140 |
141 |
141 if(!$this->theme || !$this->style) |
142 if(!$this->theme || !$this->style) |
142 { |
143 { |
630 $p = ( isset($_GET['printable']) ) ? '/printable' : ''; |
631 $p = ( isset($_GET['printable']) ) ? '/printable' : ''; |
631 |
632 |
632 // Add the e-mail address client code to the header |
633 // Add the e-mail address client code to the header |
633 $this->add_header($email->jscode()); |
634 $this->add_header($email->jscode()); |
634 |
635 |
|
636 // Add language file |
|
637 $lang_uri = makeUrlNS('Special', 'LangExportJSON/' . $lang->lang_id, false, true); |
|
638 $this->add_header("<script type=\"text/javascript\" src=\"$lang_uri\"></script>"); |
|
639 |
635 // Generate the code for the Log out and Change theme sidebar buttons |
640 // Generate the code for the Log out and Change theme sidebar buttons |
636 // Once again, the new template parsing system can be used here |
641 // Once again, the new template parsing system can be used here |
637 |
642 |
638 $parser = $this->makeParserText($tplvars['sidebar_button']); |
643 $parser = $this->makeParserText($tplvars['sidebar_button']); |
639 |
644 |
708 // if($t['theme_id'] == $session->theme) $js_dynamic .= ' selected="selected"'; |
713 // if($t['theme_id'] == $session->theme) $js_dynamic .= ' selected="selected"'; |
709 $js_dynamic .= '>'.$t['theme_name'].'</option>'; |
714 $js_dynamic .= '>'.$t['theme_name'].'</option>'; |
710 } |
715 } |
711 } |
716 } |
712 $js_dynamic .= '\'; |
717 $js_dynamic .= '\'; |
713 var ENANO_CURRENT_THEME = \''. $session->theme .'\';'; |
718 var ENANO_CURRENT_THEME = \''. $session->theme .'\'; |
|
719 var ENANO_LANG_ID = ' . $lang->lang_id . ';'; |
714 foreach($paths->nslist as $k => $c) |
720 foreach($paths->nslist as $k => $c) |
715 { |
721 { |
716 $js_dynamic .= "namespace_list['{$k}'] = '$c';"; |
722 $js_dynamic .= "namespace_list['{$k}'] = '$c';"; |
717 } |
723 } |
718 $js_dynamic .= "\n //]]>\n </script>"; |
724 $js_dynamic .= "\n //]]>\n </script>"; |