Ejemplo n.º 1
0
function business_settings_layout_tab(&$form)
{
    global $theme_key;
    $skins = business_get_predefined_param('skins', array('' => t("Default skin")));
    $backgrounds = business_get_predefined_param('backgrounds', array('bg-default' => t("Default")));
    $layout = business_get_predefined_param('layout', array('layout-default' => t("Default Layout")));
    $form['business']['settings'] = array('#type' => 'fieldset', '#collapsible' => TRUE, '#collapsed' => FALSE, '#title' => t('Settings'), '#weight' => 0);
    if (count($skins) > 1) {
        $form['business']['settings']['configs'] = array('#type' => 'fieldset', '#collapsible' => TRUE, '#collapsed' => FALSE, '#title' => t('Configs'), '#weight' => 0);
        $form['business']['settings']['configs']['skin'] = array('#type' => 'select', '#title' => t('Skin'), '#default_value' => theme_get_setting('skin'), '#options' => $skins);
    }
    $form['business']['settings']['configs']['background'] = array('#type' => 'select', '#title' => t('Background'), '#default_value' => theme_get_setting('background'), '#options' => $backgrounds, '#weight' => 1);
    $form['business']['settings']['configs']['layout'] = array('#type' => 'select', '#title' => t('Layout'), '#default_value' => theme_get_setting('layout'), '#options' => $layout, '#weight' => -2);
    $default_layout_width = theme_get_setting('layout_width') == '' ? '1400' : theme_get_setting('layout_width');
    $form['business']['settings']['configs']['layout_width'] = array('#type' => 'textfield', '#title' => t('Layout Width(px)'), '#default_value' => $default_layout_width, '#size' => 15, '#require' => TRUE, '#weight' => -1, '#states' => array('visible' => array('select[name="layout"]' => array('value' => 'layout-boxed'))));
    $form['theme_settings']['toggle_logo']['#default_value'] = theme_get_setting('toggle_logo');
    $form['theme_settings']['toggle_name']['#default_value'] = theme_get_setting('toggle_name');
    $form['theme_settings']['toggle_slogan']['#default_value'] = theme_get_setting('toggle_slogan');
    $form['theme_settings']['toggle_node_user_picture']['#default_value'] = theme_get_setting('toggle_node_user_picture');
    $form['theme_settings']['toggle_comment_user_picture']['#default_value'] = theme_get_setting('toggle_comment_user_picture');
    $form['theme_settings']['toggle_comment_user_verification']['#default_value'] = theme_get_setting('toggle_comment_user_verification');
    $form['theme_settings']['toggle_favicon']['#default_value'] = theme_get_setting('toggle_favicon');
    $form['theme_settings']['toggle_secondary_menu']['#default_value'] = theme_get_setting('toggle_secondary_menu');
    $form['theme_settings']['show_skins_menu'] = array('#type' => 'checkbox', '#title' => t('Show Skins Menu'), '#default_value' => theme_get_setting('show_skins_menu'));
    $form['logo']['default_logo']['#default_value'] = theme_get_setting('default_logo');
    $form['logo']['settings']['logo_path']['#default_value'] = theme_get_setting('logo_path');
    $form['favicon']['default_favicon']['#default_value'] = theme_get_setting('default_favicon');
    $form['favicon']['settings']['favicon_path']['#default_value'] = theme_get_setting('favicon_path');
    $form['theme_settings']['#collapsible'] = TRUE;
    $form['theme_settings']['#collapsed'] = FALSE;
    $form['logo']['#collapsible'] = TRUE;
    $form['logo']['#collapsed'] = FALSE;
    $form['favicon']['#collapsible'] = TRUE;
    $form['favicon']['#collapsed'] = FALSE;
    $form['business']['settings']['theme_settings'] = $form['theme_settings'];
    $form['business']['settings']['logo'] = $form['logo'];
    $form['business']['settings']['favicon'] = $form['favicon'];
    unset($form['theme_settings']);
    unset($form['logo']);
    unset($form['favicon']);
    $form['business']['business_use_default_settings'] = array('#type' => 'hidden', '#default_value' => 0);
    $form['actions']['business_use_default_settings_wrapper'] = array('#markup' => '<input type="submit" value="' . t('Reset theme settings') . '" class="form-submit form-reset" onclick="return Drupal.Light.onClickResetDefaultSettings();" style="float: right;">');
}
Ejemplo n.º 2
0
<?php

$skins = business_get_predefined_param('skins', array("default" => t("Default Style")));
$current_skin = theme_get_setting('skin');
if (isset($_COOKIE['weebpal_skin'])) {
    $current_skin = $_COOKIE['weebpal_skin'];
}
$backgrounds = business_get_predefined_param('backgrounds', array("bg-default" => t("Default")));
$current_background = theme_get_setting('background');
if (isset($_COOKIE['weebpal_background'])) {
    $current_background = $_COOKIE['weebpal_background'];
}
$layouts = business_get_predefined_param('layout', array("layout-default" => t("Default Layout")));
$languages = language_list('enabled');
$languages = $languages[1];
$direction = array('rtl' => array('name' => '', 'class' => ''), 'ltr' => array('name' => '', 'class' => ''));
global $language;
foreach ($languages as $name => $info) {
    if ($info->direction && $direction['rtl']['name'] == '') {
        $direction['rtl']['name'] = $name;
    } else {
        if (!$info->direction && $direction['ltr']['name'] == '') {
            $direction['ltr']['name'] = $name;
        }
    }
    $direction[$language->dir]['class'] = 'active';
    if ($direction['rtl']['name'] != '' && $direction['ltr']['name'] != '') {
        break;
    }
}
$str = array();