예제 #1
0
/**
 * Implements hook_form_FORM_ID_alter().
 *
 * @param $form
 *   The form.
 * @param $form_state
 *   The form state.
 */
function hasta_form_system_theme_settings_alter(&$form, &$form_state)
{
    drupal_add_css(drupal_get_path('theme', 'hasta') . '/css/theme-settings.css');
    $form['options'] = array('#type' => 'vertical_tabs', '#default_tab' => 'main', '#weight' => '-10', '#title' => t('Hasta Theme settings'));
    if (module_exists('nikadevs_cms')) {
        $form['options']['nd_layout_builder'] = nikadevs_cms_layout_builder();
    } else {
        drupal_set_message('Enable NikaDevs CMS module to use layout builder.');
    }
    $form['options']['main'] = array('#type' => 'fieldset', '#title' => t('Main settings'));
    $skins = array('default', 'bridge', 'cyan', 'green', 'lightblue', 'mossgreen', 'orange', 'pink', 'purple', 'red', 'violet', 'yellow');
    $form['options']['main']['skin'] = array('#type' => 'radios', '#title' => t('Skin'), '#options' => array_combine($skins, $skins), '#default_value' => theme_get_setting('skin'), '#attributes' => array('class' => array('color-radios')));
    $layout_widths = array('wrapper-wide' => t('Wide'), 'wrapper-boxed' => t('Boxed'));
    $form['options']['main']['layout_width'] = array('#type' => 'select', '#title' => t('Layout Width'), '#options' => $layout_widths, '#default_value' => theme_get_setting('layout_width'), '#attributes' => array('class' => array('form-control')));
    $skins = array('-', 'bg1', 'bg2', 'bg3', 'bg4', 'bg5', 'bg6', 'bg7', 'bg8', 'bg9', 'bg10', 'bg11', 'bg12');
    $form['options']['main']['bg_image'] = array('#type' => 'radios', '#title' => t('Skin'), '#options' => array_combine($skins, $skins), '#default_value' => theme_get_setting('bg_image'), '#attributes' => array('class' => array('color-radios')));
    $form['options']['main']['retina'] = array('#type' => 'checkbox', '#title' => t('Enable Retina Script'), '#default_value' => theme_get_setting('retina'), '#description' => t("Only for retina displays and for manually added images. The script will check if the same image with suffix @2x exists and will show it."));
    $form['options']['main']['page_404'] = array('#type' => 'select', '#title' => t('Page 404'), '#default_value' => theme_get_setting('page_404'), '#options' => array('page-404-2' => t('Search form on the left and 404 Text on the Right'), 'page-404' => t('Centered Text')), '#description' => t("Type of the 'Page not Found'"), '#attributes' => array('class' => array('form-control')));
    $form['options']['maintenance'] = array('#type' => 'fieldset', '#title' => t('Maintenance'));
    $coming_soon_content = theme_get_setting('coming_soon_content');
    $form['options']['maintenance']['coming_soon_content'] = array('#type' => 'text_format', '#title' => t('Coming Soon Content'), '#format' => isset($coming_soon_content['format']) ? $coming_soon_content['format'] : NULL, '#default_value' => isset($coming_soon_content['value']) ? $coming_soon_content['value'] : '');
    $form['options']['css'] = array('#type' => 'fieldset', '#title' => t('Customizations'));
    $form['options']['css']['custom_css'] = array('#type' => 'textarea', '#title' => t('Custom CSS'), '#default_value' => theme_get_setting('custom_css'), '#attributes' => array('class' => array('form-control')));
    $form['#submit'][] = 'progressive_settings_submit';
}
예제 #2
0
/**
 * Implements hook_form_FORM_ID_alter().
 *
 * @param $form
 *   The form.
 * @param $form_state
 *   The form state.
 */
function progressive_form_system_theme_settings_alter(&$form, &$form_state)
{
    drupal_add_css(drupal_get_path('theme', 'progressive') . '/css/theme-settings.css');
    $form['options'] = array('#type' => 'vertical_tabs', '#default_tab' => 'main', '#weight' => '-10', '#title' => t('Progressive Theme settings'));
    if (module_exists('nikadevs_cms')) {
        $form['options']['nd_layout_builder'] = nikadevs_cms_layout_builder();
    } else {
        drupal_set_message('Enable NikaDevs CMS module to use layout builder.');
    }
    $form['options']['main'] = array('#type' => 'fieldset', '#title' => t('Main settings'));
    $skins = array('elements', 'home', 'pages', 'shop-5', 'shop-6', 'shop-8', 'shop');
    $form['options']['main']['skin'] = array('#type' => 'radios', '#title' => t('Skin'), '#options' => array_combine($skins, $skins), '#default_value' => theme_get_setting('skin'), '#attributes' => array('class' => array('color-radios')));
    $form['options']['main']['retina'] = array('#type' => 'checkbox', '#title' => t('Enable Retina Script'), '#default_value' => theme_get_setting('retina'), '#description' => t("Only for retina displays and for manually added images. The script will check if the same image with suffix @2x exists and will show it."));
    $form['options']['main']['boxed'] = array('#type' => 'checkbox', '#title' => t('Boxed view'), '#default_value' => theme_get_setting('boxed'));
    $form['options']['main']['mobile_menu_toggle'] = array('#type' => 'checkbox', '#title' => t('Easy mobile main menu dropdown toggle'), '#description' => t('If not checked then dropdown menu will be showed only if the user clicked on the + sign.'), '#default_value' => theme_get_setting('mobile_menu_toggle'));
    $form['options']['main']['header_top_menu'] = array('#type' => 'checkbox', '#title' => t('Header Top Menu'), '#default_value' => theme_get_setting('header_top_menu'));
    $form['options']['main']['header_top_menu_wrap'] = array('#type' => 'container', '#states' => array('visible' => array(':input[name="header_top_menu"]' => array('checked' => TRUE))));
    $form['options']['main']['header_top_menu_wrap']['account_login'] = array('#type' => 'checkbox', '#title' => t('My Account & Login'), '#default_value' => theme_get_setting('account_login'), '#prefix' => '<div class = "row"><div class = "col-sm-3">');
    $form['options']['main']['header_top_menu_wrap']['wishlist'] = array('#type' => 'checkbox', '#title' => t('Wishlist'), '#default_value' => theme_get_setting('wishlist'), '#prefix' => '</div><div class = "col-sm-3">');
    $form['options']['main']['header_top_menu_wrap']['comparelist'] = array('#type' => 'checkbox', '#title' => t('Compare list'), '#default_value' => theme_get_setting('comparelist'), '#prefix' => '</div><div class = "col-sm-3">');
    $form['options']['main']['header_top_menu_wrap']['cart_checkout'] = array('#type' => 'checkbox', '#title' => t('Cart & Checkout'), '#default_value' => theme_get_setting('cart_checkout'), '#prefix' => '</div><div class = "col-sm-3">', '#suffix' => '</div></div>');
    $form['options']['main']['shop_link'] = array('#type' => 'textfield', '#title' => t('Shop Link'), '#default_value' => theme_get_setting('shop_link'));
    $form['options']['main']['shop_link_list'] = array('#type' => 'textfield', '#title' => t('Shop Link, style List'), '#default_value' => theme_get_setting('shop_link_list'));
    $form['options']['main']['phones'] = array('#type' => 'textfield', '#title' => t('Main phone'), '#default_value' => theme_get_setting('phones'));
    $form['options']['settings_404'] = array('#type' => 'fieldset', '#title' => t('Page not Found'));
    $form['options']['settings_404']['page_404'] = array('#type' => 'select', '#title' => t('Page 404'), '#default_value' => theme_get_setting('page_404'), '#options' => array(1 => t('404 in Circle'), 2 => t('404 in Circle with text'), 3 => t('Background page')), '#description' => t("Type of the 'Page not Found'"));
    $page_404_content = theme_get_setting('page_404_content');
    $form['options']['settings_404']['container'] = array('#type' => 'container', '#states' => array('visible' => array(':input[name="page_404"]' => array('value' => 2))));
    $form['options']['settings_404']['container']['page_404_content'] = array('#type' => 'text_format', '#title' => t('Page 404 Content'), '#format' => isset($page_404_content['format']) ? $page_404_content['format'] : NULL, '#default_value' => isset($page_404_content['value']) ? $page_404_content['value'] : '');
    $form['options']['maintenance'] = array('#type' => 'fieldset', '#title' => t('Maintenance Page'));
    $form['options']['maintenance']['maintenance_type'] = array('#type' => 'select', '#title' => t('Maintenance page type'), '#default_value' => theme_get_setting('maintenance_type'), '#options' => array(t('Comming Soon') => t('Comming Soon'), t('Under Construction') => t('Under Construction')));
    $form['options']['maintenance']['container_construction'] = array('#type' => 'container', '#states' => array('visible' => array(':input[name="maintenance_type"]' => array('value' => t('Under Construction')))));
    $under_construction_content = theme_get_setting('under_construction_content');
    $form['options']['maintenance']['container_construction']['under_construction_content'] = array('#type' => 'text_format', '#title' => t('Under Construction Content'), '#format' => isset($under_construction_content['format']) ? $under_construction_content['format'] : $under_construction_content, '#default_value' => isset($under_construction_content['value']) ? $under_construction_content['value'] : 'html');
    $under_construction_left = theme_get_setting('under_construction_left');
    $form['options']['maintenance']['container_construction']['under_construction_left'] = array('#type' => 'text_format', '#title' => t('Under Construction Left Content'), '#format' => isset($under_construction_left['format']) ? $under_construction_left['format'] : NULL, '#default_value' => isset($under_construction_left['value']) ? $under_construction_left['value'] : '');
    $form['options']['maintenance']['container_construction']['under_construction_phones'] = array('#type' => 'textarea', '#rows' => 2, '#title' => t('Under Construction Phones'), '#default_value' => theme_get_setting('under_construction_phones'));
    $form['options']['maintenance']['container_construction']['under_construction_address'] = array('#type' => 'textarea', '#title' => t('Under Construction Address'), '#rows' => 2, '#default_value' => theme_get_setting('under_construction_address'));
    $under_construction_bottom = theme_get_setting('under_construction_bottom');
    $form['options']['maintenance']['container_construction']['under_construction_bottom'] = array('#type' => 'text_format', '#title' => t('Under Construction Bottom'), '#format' => isset($under_construction_bottom['format']) ? $under_construction_bottom['format'] : NULL, '#default_value' => isset($under_construction_bottom['value']) ? $under_construction_bottom['value'] : '');
    // Coming Soon with Timer
    $form['options']['maintenance']['container_coming_soon'] = array('#type' => 'container', '#states' => array('visible' => array(':input[name="maintenance_type"]' => array('value' => t('Comming Soon')))));
    $form['options']['maintenance']['container_coming_soon']['coming_soon_timer'] = array('#type' => 'textfield', '#title' => t('Countdown time'), '#description' => t('Any time format, for example: 2014/12/29 10:00:00'), '#default_value' => theme_get_setting('coming_soon_timer'), '#states' => array('visible' => array(':input[name="maintenance_type"]' => array('value' => t('Comming Soon')))));
    $coming_soon_content = theme_get_setting('coming_soon_content');
    $form['options']['maintenance']['container_coming_soon']['coming_soon_content'] = array('#type' => 'text_format', '#title' => t('Coming Soon Content'), '#format' => isset($coming_soon_content['format']) ? $coming_soon_content['format'] : NULL, '#default_value' => isset($coming_soon_content['value']) ? $coming_soon_content['value'] : '');
    $coming_soon_bottom = theme_get_setting('coming_soon_bottom');
    $form['options']['maintenance']['container_coming_soon']['coming_soon_bottom'] = array('#type' => 'text_format', '#title' => t('Coming Soon Bottom'), '#format' => isset($coming_soon_bottom['format']) ? $coming_soon_bottom['format'] : NULL, '#default_value' => isset($coming_soon_bottom['value']) ? $coming_soon_bottom['value'] : '');
    $form['#submit'][] = 'progressive_settings_submit';
}
예제 #3
0
/**
 * Implements hook_form_FORM_ID_alter().
 *
 * @param $form
 *   The form.
 * @param $form_state
 *   The form state.
 */
function stability_form_system_theme_settings_alter(&$form, &$form_state)
{
    drupal_add_css(drupal_get_path('theme', 'stability') . '/css/theme-settings.css');
    $form['options'] = array('#type' => 'vertical_tabs', '#default_tab' => 'main', '#weight' => '-10', '#title' => t('EnjoyIt Theme settings'));
    if (module_exists('nikadevs_cms')) {
        $form['options']['nd_layout_builder'] = nikadevs_cms_layout_builder();
    } else {
        drupal_set_message('Enable NikaDevs CMS module to use layout builder.');
    }
    $form['options']['main'] = array('#type' => 'fieldset', '#title' => t('Main settings'));
    $form['options']['main']['home_title'] = array('#type' => 'textfield', '#title' => t('Homepage Title'), '#default_value' => theme_get_setting('home_title') ? theme_get_setting('home_title') : t('Welcome to @sitename', array('@sitename' => variable_get('site_name', ''))));
    $form['options']['main']['login_account_links'] = array('#type' => 'checkbox', '#title' => t('Enable Login & Account Links'), '#default_value' => theme_get_setting('login_account_links'), '#description' => t("Login or Account links placed on the top right header."));
    $form['options']['main']['support'] = array('#type' => 'checkbox', '#title' => t('Enable Support button'), '#default_value' => theme_get_setting('support'), '#description' => t("Support button allow you send message to our support email. For user roles with checked permission 'Use NikaDevs CMS'."));
    $form['options']['main']['retina'] = array('#type' => 'checkbox', '#title' => t('Enable Retina Script'), '#default_value' => theme_get_setting('retina'), '#description' => t("Only for retina displays and for manually added images. The script will check if the same image with suffix @2x exists and will show it."));
    $form['options']['main']['slider_overlay'] = array('#type' => 'checkbox', '#title' => t('Slider Overlay'), '#default_value' => theme_get_setting('slider_overlay'), '#description' => t("Show grey overlay background on the MegaSlider"));
    $form['options']['main']['sticky_header'] = array('#type' => 'checkbox', '#title' => t('Sticky Header'), '#default_value' => theme_get_setting('sticky_header'));
    $form['options']['main']['header'] = array('#type' => 'select', '#title' => t('Header Version'), '#options' => array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6), '#default_value' => theme_get_setting('header'));
    $form['options']['main']['header_2_link'] = array('#type' => 'textfield', '#title' => t('Banner Link'), '#default_value' => theme_get_setting('header_2_link'), '#states' => array('visible' => array(':input[name="header"]' => array('value' => 2))));
    $form['options']['main']['sub_header'] = array('#type' => 'select', '#title' => t('Page Header Version'), '#options' => array(1 => t('Default'), 2 => t('Search'), 3 => t('Image'), 4 => t('Parallax'), 5 => t('Slideshow')), '#default_value' => theme_get_setting('sub_header'));
    $images = variable_get(variable_get('theme_default', 'none') . '_sub_headers', array());
    $form['options']['main']['images_wrap'] = array('#type' => 'container', '#states' => array('visible' => array(':input[name="sub_header"], .a' => array('!value' => 1), ':input[name="sub_header"], .ab' => array('!value' => 2))));
    if ($images) {
        $form['options']['main']['images_wrap']['sub_header_images'] = array('#type' => 'vertical_tabs', '#title' => t('Sub Header images'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#tree' => TRUE);
        $i = 0;
        foreach ($images as $image_data) {
            $form['options']['main']['images_wrap']['sub_header_images'][] = array('#type' => 'fieldset', '#title' => t('Sub Header Image !number', array('!number' => ++$i)), '#collapsible' => TRUE, '#collapsed' => FALSE, '#tree' => TRUE, 'image' => _stability_banner_form($image_data));
        }
    }
    $form['options']['main']['images_wrap']['image_upload'] = array('#type' => 'file', '#title' => t('Upload a new header image'));
    $form['#submit'][] = 'stability_settings_submit';
    $form['options']['main']['pager'] = array('#type' => 'select', '#title' => t('Pagination Version'), '#options' => array(1 => t('Default'), 2 => t('Big'), 3 => t('Medium'), 4 => t('Small')), '#default_value' => theme_get_setting('pager'));
    $form['options']['main']['maintenance_end'] = array('#type' => 'textfield', '#title' => t('Maintenance Countdown end'), '#description' => t('Format: 19 June 2014 16:24:00'), '#default_value' => theme_get_setting('maintenance_end'));
    $form['options']['main']['maintenance_message'] = array('#type' => 'textfield', '#title' => t('Maintenance Submit message'), '#default_value' => theme_get_setting('maintenance_message'));
    $form['options']['main']['flickr_id'] = array('#type' => 'textfield', '#title' => t('Flickr Id'), '#default_value' => theme_get_setting('flickr_id'));
    $form['options']['main']['copyright'] = array('#type' => 'textfield', '#title' => t('Override footer Copyright text'), '#default_value' => theme_get_setting('copyright'));
    $form['options']['main']['connect_us'] = array('#type' => 'textfield', '#title' => t('Footer Connect with us text'), '#default_value' => theme_get_setting('connect_us'));
    $form['options']['contact'] = array('#type' => 'fieldset', '#title' => t('Contacts'));
    $form['options']['contact']['address'] = array('#type' => 'textarea', '#rows' => 3, '#title' => t('Address'), '#default_value' => theme_get_setting('address'));
    $form['options']['contact']['phones'] = array('#type' => 'textarea', '#rows' => 3, '#title' => t('Phones numbers'), '#default_value' => theme_get_setting('phones'));
    $form['options']['contact']['email'] = array('#type' => 'textarea', '#rows' => 3, '#title' => t('Email'), '#default_value' => theme_get_setting('email'));
    $form['options']['contact']['skype'] = array('#type' => 'textarea', '#rows' => 3, '#title' => t('Skype names'), '#default_value' => theme_get_setting('skype'));
    $form['options']['contact']['working_time'] = array('#type' => 'textarea', '#rows' => 3, '#title' => t('Working Time'), '#default_value' => theme_get_setting('working_time'));
    $form['options']['gmap'] = array('#type' => 'fieldset', '#title' => t('Google Map Settings'));
    $form['options']['gmap']['gmap_lat'] = array('#type' => 'textfield', '#title' => t('Google Map Latitude'), '#default_value' => theme_get_setting('gmap_lat'), '#size' => 12);
    $form['options']['gmap']['gmap_lng'] = array('#type' => 'textfield', '#title' => t('Google Map Longitude'), '#default_value' => theme_get_setting('gmap_lng'), '#size' => 12);
    $form['options']['gmap']['gmap_zoom'] = array('#type' => 'textfield', '#title' => t('Google Map Zoom'), '#default_value' => theme_get_setting('gmap_zoom'), '#size' => 6);
    $form['options']['color'] = array('#type' => 'fieldset', '#title' => t('Color & Layout'));
    $form['options']['color']['skin'] = array('#type' => 'radios', '#title' => t('Skin'), '#default_value' => theme_get_setting('skin'), '#options' => array('asbestos' => 'asbestos', 'blue' => 'blue', 'green' => 'green', 'orange' => 'orange', 'red' => 'red', 'silver' => 'silver', 'violet' => 'violet', 'yellow' => 'yellow'));
    $form['options']['color']['layout'] = array('#type' => 'radios', '#title' => t('Layout'), '#default_value' => theme_get_setting('layout'), '#options' => array('wide' => 'Wide', 'boxed' => 'Boxed'));
    $form['options']['color']['pattern'] = array('#type' => 'radios', '#title' => t('Pattern'), '#default_value' => theme_get_setting('pattern'), '#options' => array('brickwall' => 'brickwall', 'cream_pixels' => 'cream_pixels', 'grey_wash_wall' => 'grey_wash_wall', 'greyzz' => 'greyzz', 'mooning' => 'mooning', 'p5' => 'p5', 'retina_wood' => 'retina_wood', 'shattered' => 'shattered', 'sos' => 'sos', 'squared_metal' => 'squared_metal', 'subtle_grunge' => 'subtle_grunge', 'binding_dark' => 'binding_dark'), '#description' => t('Background for "Boxed" layout.'));
    $form['options']['social_links'] = array('#type' => 'fieldset', '#title' => t('Social Links'));
    $form['options']['social_links']['social_links_facebook_enabled'] = array('#type' => 'checkbox', '#title' => t('Show Facebook link'), '#default_value' => theme_get_setting('social_links_facebook_enabled'));
    $form['options']['social_links']['social_links_facebook_link'] = array('#type' => 'textfield', '#title' => t('Facebook link'), '#default_value' => theme_get_setting('social_links_facebook_link'), '#states' => array('visible' => array(':input[name="social_links_facebook_enabled"]' => array('checked' => TRUE))));
    $form['options']['social_links']['social_links_twitter_enabled'] = array('#type' => 'checkbox', '#title' => t('Show Twitter link'), '#default_value' => theme_get_setting('social_links_twitter_enabled'));
    $form['options']['social_links']['social_links_twitter_link'] = array('#type' => 'textfield', '#title' => t('Twitter link'), '#default_value' => theme_get_setting('social_links_twitter_link'), '#states' => array('visible' => array(':input[name="social_links_twitter_enabled"]' => array('checked' => TRUE))));
    $form['options']['social_links']['social_links_instagram_enabled'] = array('#type' => 'checkbox', '#title' => t('Show Instagram link'), '#default_value' => theme_get_setting('social_links_instagram_enabled'));
    $form['options']['social_links']['social_links_instagram_link'] = array('#type' => 'textfield', '#title' => t('Instagram link'), '#default_value' => theme_get_setting('social_links_instagram_link'), '#states' => array('visible' => array(':input[name="social_links_instagram_enabled"]' => array('checked' => TRUE))));
    $form['options']['social_links']['social_links_linkedin_enabled'] = array('#type' => 'checkbox', '#title' => t('Show Linked Ins link'), '#default_value' => theme_get_setting('social_links_linkedin_enabled'));
    $form['options']['social_links']['social_links_linkedin_link'] = array('#type' => 'textfield', '#title' => t('Linked In link'), '#default_value' => theme_get_setting('social_links_linkedin_link'), '#states' => array('visible' => array(':input[name="social_links_linkedin_enabled"]' => array('checked' => TRUE))));
    $form['options']['social_links']['social_links_xing_enabled'] = array('#type' => 'checkbox', '#title' => t('Show Xing link'), '#default_value' => theme_get_setting('social_links_xing_enabled'));
    $form['options']['social_links']['social_links_xing_link'] = array('#type' => 'textfield', '#title' => t('Xing link'), '#default_value' => theme_get_setting('social_links_xing_link'), '#states' => array('visible' => array(':input[name="social_links_xing_enabled"]' => array('checked' => TRUE))));
    $form['options']['social_links']['social_links_rss_enabled'] = array('#type' => 'checkbox', '#title' => t('Show Rss link'), '#default_value' => theme_get_setting('social_links_rss_enabled'));
    $form['options']['social_links']['social_links_rss_link'] = array('#type' => 'textfield', '#title' => t('Rss link'), '#default_value' => theme_get_setting('social_links_rss_link'), '#states' => array('visible' => array(':input[name="social_links_rss_enabled"]' => array('checked' => TRUE))));
    if (isset($form['logo'])) {
        $form['logo']['logo_sticky'] = array('#type' => 'textfield', '#title' => t('Sticky Logo Height'), '#weight' => 1, '#default_value' => theme_get_setting('logo_sticky'), '#description' => t('Height value in pixels.'), '#size' => '10');
    }
}