Errori nel tema personalizzato ZEN
Ho personalizzato il tema ZEN, ma quando vado in /admin/build/themes/settings/faro mi da dei messaggi di warning:
warning: array_merge() [function.array-merge]: Argument #1 is not an array in /membri/faroinmusica/sites/all/themes/faro/theme-settings.php on line 22.
warning: array_merge() [function.array-merge]: Argument #2 is not an array in /membri/faroinmusica/themes/zen/theme-settings.php on line 30.
warning: array_merge() [function.array-merge]: Argument #1 is not an array in /membri/faroinmusica/themes/zen/theme-settings.php on line 33.Questo è il mio file theme-settings.php
<?php
// $Id: theme-settings.php,v 1.7 2008/09/11 09:36:50 johnalbin Exp $
// Include the definition of zen_settings() and zen_theme_get_default_settings().
include_once './' . drupal_get_path('theme', 'zen') . '/theme-settings.php';
/**
* Implementation of THEMEHOOK_settings() function.
*
* @param $saved_settings
* An array of saved settings for this theme.
* @return
* A form array.
*/
function faro_settings($saved_settings) {
// Get the default values from the .info file.
$defaults = ('faro');
// Merge the saved variables and their default values.
$settings = array_merge($defaults, $saved_settings);
/*
* Create the form using Forms API:
" title="http://api.drupal.org/api/6
">http://api.drupal.org/api/6
*/
$form = array();
/* -- Delete this line if you want to use this setting
$form['faro'] = array(
'#type' => 'checkbox',
'#title' => t('Use this sample setting'),
'#default_value' => $settings['faro'],
'#description' => t("This option doesn't do anything; it's just an example."),
);
// */
// Add the base theme's settings.
$form += zen_settings($saved_settings, $defaults);
// Remove some of the base theme's settings.
unset($form['themedev']['zen_layout']); // We don't need to select the base stylesheet.
// Return the form
return $form;
}
Risposte
Ciao, l'errore dipende dalla
Ciao, l'errore dipende dalla linea "$defaults = ('faro');". In questo modo assegni una stringa a $default, non un array, che è richiesto dalle successive funzioni: in più la notazione è strana, sembra che manchi il nome della funzione che prende come argomento 'faro'.
Ciao, ti ringrazio per la
Ciao, ti ringrazio per la risposta, ho modificato come mi hai suggerito così
$defaults = array('faro');adesso quei messaggi di warning sono del tutto spariti, sembra che non ci siano più problemi, ti ringrazio per l'aiuto.