[Customisation Database Commits] r959 - in /trunk/titania: includes/core/phpbb.php includes/core/titania.php includes/tools/message.php styles/default/template/login_body.html styles/default/template/posting/posting_basic_editor.html
Nathan Guse
exreaction at phpbb.com
Wed Mar 31 21:22:34 BST 2010
Author: exreaction
Date: Wed Mar 31 21:22:33 2010
New Revision: 959
Log:
Now any new template directory should inherit the default/ template files
Modified:
trunk/titania/includes/core/phpbb.php
trunk/titania/includes/core/titania.php
trunk/titania/includes/tools/message.php
trunk/titania/styles/default/template/login_body.html
trunk/titania/styles/default/template/posting/posting_basic_editor.html
Modified: trunk/titania/includes/core/phpbb.php
==============================================================================
*** trunk/titania/includes/core/phpbb.php (original)
--- trunk/titania/includes/core/phpbb.php Wed Mar 31 21:22:33 2010
***************
*** 305,320 ****
$captcha->init(CONFIRM_LOGIN);
// $captcha->reset();
! // HAX
! global $phpbb_root_path;
! $phpbb_root_path = titania::$absolute_board;
!
! self::$template->assign_vars(array(
! 'CAPTCHA_TEMPLATE' => $captcha->get_template(),
));
! // DE-HAX
! $phpbb_root_path = PHPBB_ROOT_PATH;
$err = self::$user->lang[$result['error_msg']];
break;
--- 305,322 ----
$captcha->init(CONFIRM_LOGIN);
// $captcha->reset();
! // Parse the captcha template
! phpbb::$template->set_template();
! phpbb::$template->set_filenames(array(
! 'captcha' => $captcha->get_template(),
));
! // Correct confirm image link
! phpbb::$template->assign_var('CONFIRM_IMAGE_LINK', phpbb::append_sid('ucp', 'mode=confirm&confirm_id=' . $captcha->confirm_id . '&type=' . $captcha->type));
!
! phpbb::$template->assign_display('captcha', 'CAPTCHA', false);
!
! titania::set_custom_template();
$err = self::$user->lang[$result['error_msg']];
break;
Modified: trunk/titania/includes/core/titania.php
==============================================================================
*** trunk/titania/includes/core/titania.php (original)
--- trunk/titania/includes/core/titania.php Wed Mar 31 21:22:33 2010
***************
*** 107,118 ****
self::$theme_path = self::$style_path . 'theme';
// Set the paths for phpBB
! phpbb::$template->set_custom_template(TITANIA_ROOT . 'styles/' . self::$config->style . '/' . 'template', 'titania_' . self::$config->style);
! phpbb::$user->theme['template_storedb'] = false;
!
! // Inherit from the boards prosilver (currently required for the Captcha)
! phpbb::$user->theme['template_inherits_id'] = 1; // Doesn't seem to matter what number I put in here...
! phpbb::$template->inherit_root = PHPBB_ROOT_PATH . 'styles/prosilver/template';
}
// Setup the Access Level
--- 107,113 ----
self::$theme_path = self::$style_path . 'theme';
// Set the paths for phpBB
! self::set_custom_template();
}
// Setup the Access Level
***************
*** 140,145 ****
--- 135,156 ----
}
/**
+ * Set the custom template path for titania
+ */
+ public static function set_custom_template()
+ {
+ phpbb::$template->set_custom_template(TITANIA_ROOT . 'styles/' . self::$config->style . '/' . 'template', 'titania_' . self::$config->style);
+ phpbb::$user->theme['template_storedb'] = false;
+
+ // Inherit from the boards prosilver (currently required for the Captcha)
+ if (self::$config->style !== 'default')
+ {
+ phpbb::$user->theme['template_inherits_id'] = 1; // Doesn't seem to matter what number I put in here...
+ phpbb::$template->inherit_root = TITANIA_ROOT . 'styles/default/template';
+ }
+ }
+
+ /**
* Reads a configuration file with an assoc. config array
*
* @param string $file Path to configuration file
Modified: trunk/titania/includes/tools/message.php
==============================================================================
*** trunk/titania/includes/tools/message.php (original)
--- trunk/titania/includes/tools/message.php Wed Mar 31 21:22:33 2010
***************
*** 205,214 ****
if ($captcha->validate($this->request_data()) !== false)
{
! phpbb::$template->assign_vars(array(
! 'CAPTCHA_TEMPLATE' => $captcha->get_template(),
! 'CONFIRM_IMAGE_LINK' => phpbb::append_sid('ucp', 'mode=confirm&confirm_id=' . $captcha->confirm_id . '&type=' . $captcha->type),// Use proper captcha link
));
}
$this->s_hidden_fields = array_merge($this->s_hidden_fields, $captcha->get_hidden_fields());
--- 205,222 ----
if ($captcha->validate($this->request_data()) !== false)
{
! // Parse the captcha template
! phpbb::$template->set_template();
! phpbb::$template->set_filenames(array(
! 'captcha' => $captcha->get_template(),
));
+
+ // Correct confirm image link
+ phpbb::$template->assign_var('CONFIRM_IMAGE_LINK', phpbb::append_sid('ucp', 'mode=confirm&confirm_id=' . $captcha->confirm_id . '&type=' . $captcha->type));
+
+ phpbb::$template->assign_display('captcha', 'CAPTCHA', false);
+
+ titania::set_custom_template();
}
$this->s_hidden_fields = array_merge($this->s_hidden_fields, $captcha->get_hidden_fields());
Modified: trunk/titania/styles/default/template/login_body.html
==============================================================================
*** trunk/titania/styles/default/template/login_body.html (original)
--- trunk/titania/styles/default/template/login_body.html Wed Mar 31 21:22:33 2010
***************
*** 21,29 ****
<!-- IF U_RESEND_ACTIVATION --><dd><a href="{U_RESEND_ACTIVATION}">{L_RESEND_ACTIVATION}</a></dd><!-- ENDIF -->
<!-- ENDIF -->
</dl>
! <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
! <!-- DEFINE $CAPTCHA_TAB_INDEX = 3 -->
! <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_FULL_LOGIN -->
<dl>
--- 21,28 ----
<!-- IF U_RESEND_ACTIVATION --><dd><a href="{U_RESEND_ACTIVATION}">{L_RESEND_ACTIVATION}</a></dd><!-- ENDIF -->
<!-- ENDIF -->
</dl>
! <!-- IF CAPTCHA -->
! {CAPTCHA}
<!-- ENDIF -->
<!-- IF S_DISPLAY_FULL_LOGIN -->
<dl>
Modified: trunk/titania/styles/default/template/posting/posting_basic_editor.html
==============================================================================
*** trunk/titania/styles/default/template/posting/posting_basic_editor.html (original)
--- trunk/titania/styles/default/template/posting/posting_basic_editor.html Wed Mar 31 21:22:33 2010
***************
*** 8,15 ****
</dl>
<!-- ENDIF -->
! <!-- IF S_CONFIRM_CODE -->
! <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
<!-- ENDIF -->
<!-- INCLUDE posting/posting_buttons.html -->
--- 8,15 ----
</dl>
<!-- ENDIF -->
! <!-- IF CAPTCHA -->
! {CAPTCHA}
<!-- ENDIF -->
<!-- INCLUDE posting/posting_buttons.html -->
More information about the customisationdb-commits
mailing list