DrupalBin
Submit Code
About
Recent Posts
Drupal 5 menu
43 min 48 sec
ago
Views 2 get all field names
1 hour 26 min
ago
Code
2 hours 4 min
ago
How do i make this work in D6 (I have to clear the cache everytime to see the tabs)
4 hours 55 min
ago
more
Tags
CCK
drupal
fapi
jquery
menu
module
Panels
php
simpletest
test
theme
views
more tags
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Create new account
Request new password
Log in using OpenID
Cancel OpenID login
Home
Fix for maybe a problem with accents on drupal 6 for theme-settings.php
View
Download
Fix
This fix will not be saved to the database until you submit.
Summary:
Tags:
Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Source code:
*
/** * template.php */ <?php /* * Initialize theme settings */ if (is_null(theme_get_setting('who_we_are_title'))) { global $theme_key; /* * The default values for the theme variables. Make sure $defaults exactly * matches the $defaults in the theme-settings.php file. */ $defaults = array( // <-- change this array 'who_we_are_title' => 'QUEM SOMOS', 'who_we_are_text' => 'Prestamos o <strong>melhor serviço</strong> na área de seguros com os melhores produtos das <strong>principais seguradoras</strong> do mercado', 'made_by' => 1, ); // Save theme settings with the defaults variable_set( str_replace('/', '_', 'theme_'. $theme_key .'_settings'), array_merge($defaults, theme_get_settings($theme_key)) ); // Force refresh of Drupal internals theme_get_setting('', TRUE); } function phptemplate_preprocess_page(&$vars) { $vars['who_we_are_title'] = theme_get_setting('who_we_are_title'); $vars['who_we_are_text'] = theme_get_setting('who_we_are_text'); $madeby = 'Desenvolvido por <a href="avante.com">avante.com</a>.'; $vars['made_by'] = (theme_get_setting('made_by'))? $madeby: ''; } /** * theme-settings.php */ <?php function phptemplate_settings($saved_settings) { /* * The default values for the theme variables. Make sure $defaults exactly * matches the $defaults in the template.php file. */ $defaults = array( 'who_we_are_title' => 'LOL', 'who_we_are_text' => 'LOL2', 'made_by' => 1, ); // Merge the saved variables and their default values $settings = array_merge($defaults, $saved_settings); $form['who_we_are_title'] = array( '#type' => 'textfield', '#title' => t('Title "QUEM SOMOS"'), '#default_value' => $settings['who_we_are_title'], '#size' => 30, '#maxlength' => 64, '#description' => t('If is needed, you can change the title "QUEM SOMOS" localized on the front page.'), ); $form['who_we_are_text'] = array( '#type' => 'textarea', '#title' => t('Text of the title "QUEM SOMOS"'), '#default_value' => $settings['who_we_are_text'], '#size' => 100, '#maxlength' => 255, '#description' => t('If is needed, you can change the text of the title "QUEM SOMOS" localized on the front page.'), ); $form['made_by'] = array( '#type' => 'checkbox', '#title' => t('Enable link to developer.'), '#default_value' => $settings['made_by'], '#description' => t('If enabled, the link to developer will appear close of message footer.'), ); return $form; } ?>
Syntax highlighting mode:
ActionScript
ColdFusion
Diff
Drupal
Drupal 5
Drupal 6
HTML
Javascript
MySQL
PHP
Python
robots.txt
SQL
Text
Select the syntax highlighting mode to use.