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('who_we_are_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.     str_replace('/', '_', 'theme_'. $theme_key .'_settings'),
  22.     array_merge($defaults, theme_get_settings($theme_key))
  23.   );
  24.   // Force refresh of Drupal internals
  25.   theme_get_setting('', TRUE);
  26. }
  27. function phptemplate_preprocess_page(&$vars) {
  28.   $vars['who_we_are_title'] =  theme_get_setting('who_we_are_title');
  29.   $vars['who_we_are_text'] =  theme_get_setting('who_we_are_text');
  30.   $madeby = 'Desenvolvido por <a href="avante.com">avante.com</a>.';
  31.   $vars['made_by'] = (theme_get_setting('made_by'))? $madeby: '';
  32. }
  33.  
  34. /**
  35. * theme-settings.php
  36. */
  37. <?php
  38. function phptemplate_settings($saved_settings) {
  39.   /*
  40.    * The default values for the theme variables. Make sure $defaults exactly
  41.    * matches the $defaults in the template.php file.
  42.    */
  43.   $defaults = array(
  44.     'who_we_are_title' => 'QUEM SOMOS',
  45.     '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.',
  46.     'made_by' => 1,
  47.   );
  48.  
  49.   // Merge the saved variables and their default values
  50.   $settings = array_merge($defaults, $saved_settings);
  51.  
  52.   $form['who_we_are_title'] = array(
  53.     '#type' => 'textfield',
  54.     '#title' => t('Title "QUEM SOMOS"'),
  55.     '#default_value' => $settings['who_we_are_title'],
  56.     '#size' => 30,
  57.     '#maxlength' => 64,
  58.     '#description' => t('If is needed, you can change the title "QUEM SOMOS" localized on the front page.'),
  59.   );
  60.   $form['who_we_are_text'] = array(
  61.     '#type' => 'textarea',
  62.     '#title' => t('Text of the title "QUEM SOMOS"'),
  63.     '#default_value' => $settings['who_we_are_text'],
  64.     '#size' => 100,
  65.     '#maxlength' => 255,
  66.     '#description' => t('If is needed, you can change the text of the title "QUEM SOMOS" localized on the front page.'),
  67.   );
  68.   $form['made_by'] = array(
  69.     '#type' => 'checkbox',
  70.     '#title' => t('Enable link to developer.'),
  71.     '#default_value' => $settings['made_by'],
  72.     '#description' => t('If enabled, the link to developer will appear close of message footer.'),
  73.   );
  74.   return $form;
  75. }
  76. ?>