Procházet zdrojové kódy

BoardIndex re-organization to make it more easy to extend - inspired by dragomano with #181

Signed-off-by: emanuele <[email protected]>
emanuele před 12 roky
rodič
revize
c35408a0ad

+ 1 - 0
Sources/BoardIndex.php

@@ -36,6 +36,7 @@ function BoardIndex()
 
 	// Set a canonical URL for this page.
 	$context['canonical_url'] = $scripturl;
+	$context['template_layers'][] = 'boardindex_outer';
 
 	// Do not let search engines index anything if there is a random thing in $_GET.
 	if (!empty($_GET))

+ 7 - 4
Themes/default/BoardIndex.template.php

@@ -10,7 +10,7 @@
  * @version 2.1 Alpha 1
  */
 
-function template_main()
+function template_boardindex_outer_above()
 {
 	global $context, $settings, $options, $txt, $scripturl, $modSettings;
 
@@ -81,6 +81,11 @@ function template_main()
 			// ]]></script>
 		';
 	}
+}
+
+function template_main()
+{
+	global $context, $settings, $options, $txt, $scripturl, $modSettings;
 
 	echo '
 	<div id="boardindex_table" class="boardindex_table">
@@ -239,11 +244,9 @@ function template_main()
 	if ($settings['show_mark_read'] && !empty($context['categories']))
 	echo '
 		<div class="mark_read">', template_button_strip($context['mark_read_button'], 'right'), '</div>';
-
-	template_info_center();
 }
 
-function template_info_center()
+function template_boardindex_outer_below()
 {
 	global $context, $settings, $options, $txt, $scripturl, $modSettings;