2011-11-17 2 views
0

Drupal 설치 프로파일에서 사용 된 색상 프로파일을 어떻게 변경할 수 있습니까? colors-module을 설치했는데 $info 배열을 모든 색상 값으로 사용하는 내 색상 스키마를 구성 할 수 있습니다. 하지만 설치 프로필에이 파일을 어떻게 배치하면 기본적으로 설치 될까요?Drupal 설치 프로파일의 색상 스키마 변경

내 설치 프로필에 작업을 추가하고이 기능에 연결했습니다. 하지만 분명히 누락 된 것이 있습니다 ...

$tasks['_create_color']['display_name'] = 'Set the typical color on each platform'; 
$tasks['_create_color']['display'] = 0; 

function _create_color() { 
    $info = array(
    'schemes' => array(
    'default' => array(
     'title' => t('Blue Lagoon (default)'), 
     'colors' => array(
     'top' => '#97279b', 
     'bottom' => '#97279b', 
     'footer' => '#97279b', 
     'link' => '#97279b', 
    ) 
    ))); 
} 

누구나 조언이 있으십니까?

답변

1

나는 사용 된 색상 프로파일을 변경하는 데 완벽한 기능을 발견했습니다!

function _create_color() { 
    $theme = 'bartik'; 
    $scheme = 'firehouse'; 

    $fform = array(); 
    $fform_state = array(); 

    $fform_state['build_info']['args'][0] = $theme; 
    $fform = system_theme_settings($fform, $fform_state, $theme); 

    color_form_system_theme_settings_alter($fform, $fform_state); 

    $fform_state['values']['theme'] = $theme; 
    $fform_state['values']['info'] = color_get_info($theme); 
    $fform_state['values']['palette'] = $fform_state['values']['info']['schemes'][$scheme]['colors']; 
    $fform_state['values']['scheme'] = $scheme; 

    color_scheme_form_submit($fform, $fform_state); 
} 

설치 프로필의 작업 내에있을 때 트릭을 수행합니다.