array( 'arguments' => array( 'form' => NULL ) ) ); } /** * If social media links have been set by an admin user for this theme, this function takes care of displaying them. * If adding or removing anything work with this and the theme-settings.php file as well. **/ function osu_standard_social_media() { //these values in $social_media need to match those in theme-settings when for the form creation $social_media = array('osu_standard_facebook', 'osu_standard_youtube', 'osu_standard_flickr', 'osu_standard_linkedin', 'osu_standard_twitter', 'osu_standard_google'); // Handles irregular names - like YouTube instead of Youtube for example. $name_exceptions = array( 'linkedin'=>'LinkedIn', 'youtube' => 'YouTube', 'google' => 'Google+', ); $html = ''; foreach ($social_media as $value) { $name = substr($value, 13); if (!isset($name_exceptions[$name])) { $full_name = ucfirst($name); } else { $full_name = $name_exceptions[$name]; } // Gets the value in the database - currently users are asked to input a link to their social media page $link = theme_get_setting($value); if (!empty($link)) { $html .= ''.$full_name.' logo' .$full_name.''; } } return $html; } /** * Reads the theme settings and generates the HTML * to include stylesheets based on the settings */ function get_variant_classes() { // Stylesheets for color schemes $classes = ''; $variant = theme_get_setting('variant'); if( $variant != 'standard') { $color_scheme = theme_get_setting($variant . '_class'); $classes = ' ' . $variant . ' ' . $color_scheme; } if (theme_get_setting('vso_option')) { $classes .= ' vso'; } if (theme_get_setting('homepage_nav')) { $classes .= ' top-tier'; } return $classes; } /** * Display the homepage style header menus */ function homepage_nav() { return theme_get_setting('homepage_nav'); } /** * Get the Google Analytices Tracking code */ function google_tracking_code() { return theme_get_setting('custom_ga_code') ? theme_get_setting('custom_ga_code') : 'UA-4834799-1'; } /** * Insert some CSS to implement our theme options * Probably should combine these in the future */ function hide_utility_links() { // CSS to hide the utility links $output = ''; if (theme_get_setting('hide_utility')) { $output = "\n"; } return $output; } function hide_book_nav() { // CSS to hide the book navigation $output = ''; if (theme_get_setting('hide_book_nav')){ $output = "\n"; } return $output; } function hide_terms() { // Hide the taxonomy tems $oustput = ''; if (theme_get_setting('hide_terms')) { $output = "\n"; } return $output; } /** * Override theme settings form * */ function osu_standard_system_settings_form($form) { // Uncomment to collapse fieldsets $form_elements = element_children($form); foreach ($form_elements as $element) { if ($form[$element]['#type'] == 'fieldset') { //Identify fieldsets and collapse them $form[$element]['#collapsible'] = TRUE; // $form[$element]['#collapsed'] = TRUE; } } $form['theme_specific']['#collapsed'] = FALSE; // Hide the theme settings from OSU Base that we don't use unset($form['theme_specific']['osu_start_fieldset_0']); unset($form['theme_specific']['osu_rotating_header_custom_location']); unset($form['theme_specific']['osu_rotating_header_directory']); unset($form['theme_specific']['osu_end_fieldset_0']); unset($form['theme_specific']['osu_start_fieldset_1']); unset($form['theme_specific']['osu_rotating_header_type']); unset($form['theme_specific']['osu_rotating_header_interval']); unset($form['theme_specific']['osu_rotating_header_single_image']); unset($form['theme_specific']['osu_rotating_header_image_preview']); unset($form['theme_specific']['osu_end_fieldset_1']); unset($form['theme_specific']['osu_start_fieldset_2']); unset($form['theme_specific']['osu_second_header_type']); unset($form['theme_specific']['osu_second_rotating_header_type']); unset($form['theme_specific']['osu_second_rotating_header_interval']); unset($form['theme_specific']['osu_second_rotating_header_single_image']); unset($form['theme_specific']['osu_second_rotating_header_image_preview']); unset($form['theme_specific']['osu_end_fieldset_2']); unset($form['theme_specific']['themedev']); // Comment out for theme development return drupal_render($form); }