Fix for maybe a problem with accents on drupal 6 for theme-settings.php

  1. /**
  2. * template.php
  3. */
  4. <?php
  5. /*
  6. * Initialize theme settings
  7. */
  8. if (is_null(theme_get_setting('quem_somos_title'))) {
  9.   global $theme_key;
  10.   /*
  11.    * The default values for the theme variables. Make sure $defaults exactly
  12.    * matches the $defaults in the theme-settings.php file.
  13.    */
  14.   $defaults = array(             // <-- change this array
  15.     'who_we_are_title' => 'QUEM SOMOS',
  16.     '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',
  17.     'made_by' => 1,
  18.   );
  19.  
  20.   // Save theme settings with the defaults
  21.   variable_set(
  22.     str_replace('/', '_', 'theme_'. $theme_key .'_settings'),
  23.     array_merge($defaults, theme_get_settings($theme_key))
  24.   );
  25.   // Force refresh of Drupal internals
  26.   theme_get_setting('', TRUE);
  27. }
  28. function phptemplate_preprocess_page(&$vars) {
  29.   $vars['who_we_are_title'] =  theme_get_setting('who_we_are_title');
  30.   $vars['who_we_are_text'] =  theme_get_setting('who_we_are_text');
  31.   $madeby = 'Desenvolvido por <a href="avante.com">avante.com</a>.';
  32.   $vars['made_by'] = (theme_get_setting('made_by'))? $madeby: '';
  33. }
  34.  
  35. /**
  36. * theme-settings.php
  37. */
  38. <?php
  39. function phptemplate_settings($saved_settings) {
  40.   /*
  41.    * The default values for the theme variables. Make sure $defaults exactly
  42.    * matches the $defaults in the template.php file.
  43.    */
  44.   $defaults = array(
  45.     'who_we_are_title' => 'LOL',
  46.     'who_we_are_text' => 'LOL2',
  47.     'made_by' => 1,
  48.   );
  49.  
  50.   // Merge the saved variables and their default values
  51.   $settings = array_merge($defaults, $saved_settings);
  52.  
  53.   $form['who_we_are_title'] = array(
  54.     '#type' => 'textfield',
  55.     '#title' => t('Title "QUEM SOMOS"'),
  56.     '#default_value' => 'QUEM SOMOS',
  57.     '#size' => 30,
  58.     '#maxlength' => 64,
  59.     '#description' => t('If is needed, you can change the title "QUEM SOMOS" localized on the front page.'),
  60.   );
  61.   $form['who_we_are_text'] = array(
  62.     '#type' => 'textarea',
  63.     '#title' => t('Text of the title "QUEM SOMOS"'),
  64.     //'#default_value' => 'Prestamos o <strong>melhor serviço</strong> na área de seguros com os melhores produtos das <strong>principais seguradoras</strong> do mercado.',
  65.     '#default_value' => t('Prestamos o <strong>melhor servico</strong> na area de seguros com os melhores produtos das <strong>principais seguradoras</strong> do mercado.'),
  66.     '#size' => 100,
  67.     '#maxlength' => 255,
  68.     '#description' => t('If is needed, you can change the text of the title "QUEM SOMOS" localized on the front page.'),
  69.   );
  70.   $form['made_by'] = array(
  71.     '#type' => 'checkbox',
  72.     '#title' => t('Enable link to developer.'),
  73.     '#default_value' => $settings['made_by'],
  74.     '#description' => t('If enabled, the link to developer will appear close of message footer.'),
  75.   );
  76.   return $form;
  77. }
  78. ?>

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.