Exemplo n.º 1
0
/**
 * Implementation of hook_settings() for themes.
 */
function ginkgo_settings($settings)
{
    // Add js & css
    drupal_add_css('misc/farbtastic/farbtastic.css', 'module', 'all', FALSE);
    drupal_add_js('misc/farbtastic/farbtastic.js');
    drupal_add_css(drupal_get_path('theme', 'ginkgo') . '/settings.css');
    drupal_add_js(drupal_get_path('theme', 'ginkgo') . '/js/settings.js');
    $form = array();
    $form['settings'] = array('#type' => 'fieldset', '#tree' => FALSE, '#title' => t('Settings'));
    $form['settings']['emblem'] = array('#title' => t('Show site emblem'), '#type' => 'checkbox', '#default_value' => isset($settings['emblem']) ? $settings['emblem'] : 1);
    // Build color defaults
    $themes = list_themes();
    $theme_info = !empty($themes['ginkgo']->info) ? $themes['ginkgo']->info : array();
    $defaults = array();
    foreach (array('site', 'og', 'user') as $type) {
        // Retrieve default colors from info file
        if (isset($theme_info["spaces_design_{$type}"])) {
            $defaults[$type] = $theme_info["spaces_design_{$type}"];
        } else {
            $defaults[$type] = '#3399aa';
        }
    }
    $form['color'] = array('#type' => 'fieldset', '#tree' => FALSE, '#title' => t('Color'), '#value' => "<div class='description'>" . t('These color settings can be overridden by color customizations per space.') . "</div>");
    $form['color']['color_site'] = array('#title' => t('Default site color'), '#type' => 'textfield', '#size' => '7', '#maxlength' => '7', '#default_value' => !empty($settings['color_site']) ? $settings['color_site'] : $defaults['site'], '#suffix' => '<div class="colorpicker" id="edit-color-site-colorpicker"></div>', '#attributes' => array('class' => 'colorpicker'));
    $form['color']['color_og'] = array('#title' => t('Default group color'), '#type' => 'textfield', '#size' => '7', '#maxlength' => '7', '#default_value' => !empty($settings['color_og']) ? $settings['color_og'] : $defaults['og'], '#suffix' => '<div class="colorpicker" id="edit-color-og-colorpicker"></div>', '#attributes' => array('class' => 'colorpicker'));
    $form['color']['color_user'] = array('#title' => t('Default profile color'), '#type' => 'textfield', '#size' => '7', '#maxlength' => '7', '#default_value' => !empty($settings['color_user']) ? $settings['color_user'] : $defaults['user'], '#suffix' => '<div class="colorpicker" id="edit-color-user-colorpicker"></div>', '#attributes' => array('class' => 'colorpicker'));
    return $form;
}
Exemplo n.º 2
0
/**
 * Implementation of THEMEHOOK_settings() function.
 *
 * @param $saved_settings
 *   array An array of saved settings for this theme.
 * @return
 *   array A form array.
 */
function rootcandy_settings($saved_settings, $subtheme_defaults = array())
{
    // Get the default values from the .info file.
    $themes = list_themes();
    $defaults = $themes['rootcandy']->info['settings'];
    // Allow a subtheme to override the default values.
    $defaults = array_merge($defaults, $subtheme_defaults);
    // Merge the saved variables and their default values.
    $settings = array_merge($defaults, $saved_settings);
    // Create the form widgets using Forms API
    $form['header'] = array('#type' => 'fieldset', '#title' => t('Header'), '#weight' => 1, '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['header']['rootcandy_header_display'] = array('#type' => 'checkbox', '#title' => t('Disable header'), '#default_value' => $settings['rootcandy_header_display']);
    $form['dashboard'] = array('#type' => 'fieldset', '#title' => t('Dashboard'), '#weight' => 1, '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['dashboard']['rootcandy_dashboard_display'] = array('#type' => 'checkbox', '#title' => t('Disable dashboard'), '#default_value' => $settings['rootcandy_dashboard_display']);
    $form['dashboard']['rootcandy_dashboard_help'] = array('#type' => 'select', '#options' => array('left' => t('Left'), 'right' => t('Right'), 'content' => t('Content')), '#title' => t('Help box position'), '#default_value' => $settings['rootcandy_dashboard_help']);
    $form['dashboard']['rootcandy_dashboard_messages'] = array('#type' => 'select', '#options' => array('left' => t('Left'), 'right' => t('Right'), 'content' => t('Content')), '#title' => t('Messages box position'), '#default_value' => $settings['rootcandy_dashboard_messages']);
    $form['dashboard']['rootcandy_dashboard_content_display'] = array('#type' => 'checkbox', '#title' => t('Disable content on a dashboard'), '#default_value' => $settings['rootcandy_dashboard_content_display']);
    $form['navigation'] = array('#type' => 'fieldset', '#title' => t('Navigation'), '#weight' => 1, '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Create the form widgets using Forms API
    $form['navigation']['rootcandy_navigation_icons'] = array('#type' => 'checkbox', '#title' => t('Disable icons for main navigation'), '#default_value' => $settings['rootcandy_navigation_icons']);
    $form['navigation']['rootcandy_navigation_icons_size'] = array('#type' => 'select', '#options' => array(16 => 16, 24 => 24, 32 => 32), '#title' => t('Set icons size for main navigation'), '#default_value' => $settings['rootcandy_navigation_icons_size']);
    $form['navigation']['nav-by-role'] = array('#type' => 'fieldset', '#title' => t('Menu source by role'), '#weight' => 1, '#collapsible' => TRUE, '#collapsed' => TRUE);
    $primary_options = array(NULL => t('None'), '_rootcandy_default_navigation' => t('default navigation'));
    $primary_options = array_merge($primary_options, menu_get_menus());
    $roles = user_roles(FALSE);
    foreach ($roles as $rid => $role) {
        $form['navigation']['nav-by-role']['rootcandy_navigation_source_' . $rid] = array('#type' => 'select', '#title' => t('@role navigation', array('@role' => $role)), '#default_value' => $settings['rootcandy_navigation_source_' . $rid], '#options' => $primary_options, '#tree' => FALSE, '#description' => t('Select what should be displayed as the navigation menu for role @role.', array('@role' => $role)));
    }
    $form['navigation']['custom-icons'] = array('#type' => 'fieldset', '#title' => t('Custom icons'), '#weight' => 1, '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['navigation']['custom-icons']['rootcandy_navigation_custom_icons'] = array('#type' => 'textarea', '#title' => t('Custom icons'), '#default_value' => $settings['rootcandy_navigation_custom_icons'], '#description' => t('Format: menu href|icon path (relative to drupal root) - one item per row. eg. admin/build|files/myicons/admin-build.png'), '#required' => FALSE);
    // Return the additional form widgets
    return $form;
}
Exemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function form(array $form, array &$form_state)
 {
     $entity = $this->entity;
     // Store theme settings in $form_state for use below.
     if (!($theme = $entity->get('theme'))) {
         $theme = $this->config('system.theme')->get('default');
     }
     $form_state['block_theme'] = $theme;
     $form['#tree'] = TRUE;
     $form['settings'] = $entity->getPlugin()->buildConfigurationForm(array(), $form_state);
     // If creating a new block, calculate a safe default machine name.
     $form['id'] = array('#type' => 'machine_name', '#maxlength' => 64, '#description' => $this->t('A unique name for this block instance. Must be alpha-numeric and underscore separated.'), '#default_value' => !$entity->isNew() ? $entity->id() : $this->getUniqueMachineName($entity), '#machine_name' => array('exists' => '\\Drupal\\block\\Entity\\Block::load', 'replace_pattern' => '[^a-z0-9_.]+', 'source' => array('settings', 'label')), '#required' => TRUE, '#disabled' => !$entity->isNew());
     // Theme settings.
     if ($entity->get('theme')) {
         $form['theme'] = array('#type' => 'value', '#value' => $theme);
     } else {
         $theme_options = array();
         foreach (list_themes() as $theme_name => $theme_info) {
             if (!empty($theme_info->status)) {
                 $theme_options[$theme_name] = $theme_info->info['name'];
             }
         }
         $form['theme'] = array('#type' => 'select', '#options' => $theme_options, '#title' => t('Theme'), '#default_value' => $theme, '#ajax' => array('callback' => array($this, 'themeSwitch'), 'wrapper' => 'edit-block-region-wrapper'));
     }
     // Region settings.
     $form['region'] = array('#type' => 'select', '#title' => $this->t('Region'), '#description' => $this->t('Select the region where this block should be displayed.'), '#default_value' => $entity->get('region'), '#empty_value' => BlockInterface::BLOCK_REGION_NONE, '#options' => system_region_list($theme, REGIONS_VISIBLE), '#prefix' => '<div id="edit-block-region-wrapper">', '#suffix' => '</div>');
     $form['#attached']['css'] = array(drupal_get_path('module', 'block') . '/css/block.admin.css');
     return $form;
 }
Exemplo n.º 4
0
/**
 * Return the path to the sub-theme directory or FALSE if there is no sub-theme.
 *
 * This function also fixes sub-themes that are mistakenly seen by PHPTemplate
 * as separate from their base theme.
 */
function path_to_subtheme()
{
    $base_theme = 'zen';
    global $theme, $theme_key;
    static $theme_path;
    if (!isset($theme_path)) {
        if ($theme_key == $base_theme) {
            // This is not a sub-theme.
            $theme_path = FALSE;
        } else {
            // Extract current files from database.
            $themes = list_themes();
            // Sub-themes with their own page.tpl.php files are seen by PHPTemplate as
            // their own theme (seperate from Zen). So we need to re-connect those
            // sub-themes with the base Zen theme.
            if ($theme == $theme_key) {
                // Update database
                $parent_path = $themes[$base_theme]->filename;
                $subtheme_path = str_replace('page.tpl.php', 'style.css', $themes[$theme]->filename);
                db_query("UPDATE {system} SET description='%s', filename='%s' WHERE name='%s' AND type='theme'", $parent_path, $subtheme_path, $theme);
                // Refresh Drupal internals.
                $theme = $base_theme;
                $themes = list_themes(TRUE);
            }
            $theme_path = dirname($themes[$theme_key]->filename);
        }
    }
    return $theme_path;
}
/**
 * Implementation of THEMEHOOK_settings() function.
 *
 * @param $saved_settings
 *   An array of saved settings for this theme.
 * @return
 *   A form array.
 */
function STARTERKIT_settings($saved_settings)
{
    // Get the default values from the .info file.
    $themes = list_themes();
    $defaults = $themes['STARTERKIT']->info['settings'];
    // Merge the saved variables and their default values.
    $settings = array_merge($defaults, $saved_settings);
    /*
     * Create the form using Forms API: http://api.drupal.org/api/6
     */
    $form = array();
    /* -- Delete this line if you want to use this setting
      $form['subtheme_example'] = array(
        '#type'          => 'checkbox',
        '#title'         => t('Use this sample setting'),
        '#default_value' => $settings['subtheme_example'],
        '#description'   => t("This option doesn't do anything; it's just an example."),
      );
      // */
    // Add the base theme's settings.
    include_once './' . drupal_get_path('theme', 'zen') . '/theme-settings.php';
    $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;
}
Exemplo n.º 6
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(array $form, FormStateInterface $form_state)
 {
     $form = parent::buildForm($form, $form_state);
     $config = $this->config('views.settings');
     $options = array();
     foreach (list_themes() as $name => $theme) {
         if ($theme->status) {
             $options[$name] = $theme->info['name'];
         }
     }
     // This is not currently a fieldset but we may want it to be later,
     // so this will make it easier to change if we do.
     $form['basic'] = array();
     $form['basic']['ui_show_master_display'] = array('#type' => 'checkbox', '#title' => $this->t('Always show the master (default) display'), '#default_value' => $config->get('ui.show.master_display'));
     $form['basic']['ui_show_advanced_column'] = array('#type' => 'checkbox', '#title' => $this->t('Always show advanced display settings'), '#default_value' => $config->get('ui.show.advanced_column'));
     $form['basic']['ui_show_display_embed'] = array('#type' => 'checkbox', '#title' => t('Allow embedded displays'), '#description' => t('Embedded displays can be used in code via views_embed_view().'), '#default_value' => $config->get('ui.show.display_embed'));
     $form['basic']['ui_exposed_filter_any_label'] = array('#type' => 'select', '#title' => $this->t('Label for "Any" value on non-required single-select exposed filters'), '#options' => array('old_any' => '<Any>', 'new_any' => $this->t('- Any -')), '#default_value' => $config->get('ui.exposed_filter_any_label'));
     $form['live_preview'] = array('#type' => 'details', '#title' => $this->t('Live preview settings'), '#open' => TRUE);
     $form['live_preview']['ui_always_live_preview'] = array('#type' => 'checkbox', '#title' => $this->t('Automatically update preview on changes'), '#default_value' => $config->get('ui.always_live_preview'));
     $form['live_preview']['ui_show_preview_information'] = array('#type' => 'checkbox', '#title' => $this->t('Show information and statistics about the view during live preview'), '#default_value' => $config->get('ui.show.preview_information'));
     $form['live_preview']['options'] = array('#type' => 'container', '#states' => array('visible' => array(':input[name="ui_show_preview_information"]' => array('checked' => TRUE))));
     $form['live_preview']['options']['ui_show_sql_query_where'] = array('#type' => 'radios', '#title' => t('Show SQL query'), '#options' => array('above' => $this->t('Above the preview'), 'below' => $this->t('Below the preview')), '#default_value' => $config->get('ui.show.sql_query.where'));
     $form['live_preview']['options']['ui_show_sql_query_enabled'] = array('#type' => 'checkbox', '#title' => $this->t('Show the SQL query'), '#default_value' => $config->get('ui.show.sql_query.enabled'));
     $form['live_preview']['options']['ui_show_performance_statistics'] = array('#type' => 'checkbox', '#title' => $this->t('Show performance statistics'), '#default_value' => $config->get('ui.show.performance_statistics'));
     $form['live_preview']['options']['ui_show_additional_queries'] = array('#type' => 'checkbox', '#title' => $this->t('Show other queries run during render during live preview'), '#description' => $this->t("Drupal has the potential to run many queries while a view is being rendered. Checking this box will display every query run during view render as part of the live preview."), '#default_value' => $config->get('ui.show.additional_queries'));
     return $form;
 }
Exemplo n.º 7
0
function gavias_laikafood_get_predefined_param($param, $pre_array = array(), $suf_array = array())
{
    global $theme_key;
    $theme_data = list_themes();
    $result = isset($theme_data[$theme_key]->info[$param]) ? $theme_data[$theme_key]->info[$param] : array();
    return $pre_array + $result + $suf_array;
}
/**
 * Implementation of THEMEHOOK_settings() function.
 *
 * @param $saved_settings
 *   An array of saved settings for this theme.
 * @param $subtheme_defaults
 *   Allow a subtheme to override the default values.
 * @return
 *   A form array.
 */
function zen_settings($saved_settings, $subtheme_defaults = array())
{
    // Add the form's CSS
    drupal_add_css(drupal_get_path('theme', 'zen') . '/theme-settings.css', 'theme');
    // Add javascript to show/hide optional settings
    drupal_add_js(drupal_get_path('theme', 'zen') . '/theme-settings.js', 'theme');
    // Get the default values from the .info file.
    $themes = list_themes();
    $defaults = $themes['zen']->info['settings'];
    // Allow a subtheme to override the default values.
    $defaults = array_merge($defaults, $subtheme_defaults);
    // Merge the saved variables and their default values.
    $settings = array_merge($defaults, $saved_settings);
    /*
     * Create the form using Forms API
     */
    $form['zen-div-opening'] = array('#value' => '<div id="zen-settings">');
    $form['zen_block_editing'] = array('#type' => 'checkbox', '#title' => t('Show block editing on hover'), '#description' => t('When hovering over a block, privileged users will see block editing links.'), '#default_value' => $settings['zen_block_editing']);
    $form['breadcrumb'] = array('#type' => 'fieldset', '#title' => t('Breadcrumb settings'), '#attributes' => array('id' => 'zen-breadcrumb'));
    $form['breadcrumb']['zen_breadcrumb'] = array('#type' => 'select', '#title' => t('Display breadcrumb'), '#default_value' => $settings['zen_breadcrumb'], '#options' => array('yes' => t('Yes'), 'admin' => t('Only in admin section'), 'no' => t('No')));
    $form['breadcrumb']['zen_breadcrumb_separator'] = array('#type' => 'textfield', '#title' => t('Breadcrumb separator'), '#description' => t('Text only. Don’t forget to include spaces.'), '#default_value' => $settings['zen_breadcrumb_separator'], '#size' => 5, '#maxlength' => 10, '#prefix' => '<div id="div-zen-breadcrumb-collapse">');
    $form['breadcrumb']['zen_breadcrumb_home'] = array('#type' => 'checkbox', '#title' => t('Show home page link in breadcrumb'), '#default_value' => $settings['zen_breadcrumb_home']);
    $form['breadcrumb']['zen_breadcrumb_trailing'] = array('#type' => 'checkbox', '#title' => t('Append a separator to the end of the breadcrumb'), '#default_value' => $settings['zen_breadcrumb_trailing'], '#description' => t('Useful when the breadcrumb is placed just before the title.'));
    $form['breadcrumb']['zen_breadcrumb_title'] = array('#type' => 'checkbox', '#title' => t('Append the content title to the end of the breadcrumb'), '#default_value' => $settings['zen_breadcrumb_title'], '#description' => t('Useful when the breadcrumb is not placed just before the title.'), '#suffix' => '</div>');
    $form['themedev'] = array('#type' => 'fieldset', '#title' => t('Theme development settings'), '#attributes' => array('id' => 'zen-themedev'));
    // drupal_rebuild_theme_registry()
    $form['themedev']['zen_layout'] = array('#type' => 'radios', '#title' => t('Layout method'), '#options' => array('border-politics-liquid' => t('Liquid layout') . ' <small>(layout-liquid.css)</small>', 'border-politics-fixed' => t('Fixed layout') . ' <small>(layout-fixed.css)</small>'), '#default_value' => $settings['zen_layout']);
    $form['themedev']['zen_wireframes'] = array('#type' => 'checkbox', '#title' => t('Display borders around main layout elements'), '#default_value' => $settings['zen_wireframes'], '#description' => l(t('Wireframes'), 'http://www.boxesandarrows.com/view/html_wireframes_and_prototypes_all_gain_and_no_pain') . t(' are useful when prototyping a website.'), '#prefix' => '<div id="div-zen-wireframes"><strong>' . t('Wireframes:') . '</strong>', '#suffix' => '</div>');
    $form['zen-div-closing'] = array('#value' => '</div>');
    // Return the form
    return $form;
}
Exemplo n.º 9
0
 /**
  * Test creating custom block, moving it to a specific region and then
  * deleting it.
  */
 function testCustomBlock()
 {
     // Confirm that the add block link appears on block overview pages.
     $this->drupalGet('admin/structure/block');
     $this->assertRaw(l(t('Add block'), 'admin/structure/block/add'), t('Add block link is present on block overview page for default theme.'));
     $this->drupalGet('admin/structure/block/list/seven');
     $this->assertRaw(l(t('Add block'), 'admin/structure/block/list/seven/add'), t('Add block link is present on block overview page for non-default theme.'));
     // Confirm that hidden regions are not shown as options for block placement
     // when adding a new block.
     theme_enable(array('stark'));
     $themes = list_themes();
     $this->drupalGet('admin/structure/block/add');
     foreach ($themes as $key => $theme) {
         if ($theme->status) {
             foreach ($theme->info['regions_hidden'] as $hidden_region) {
                 $elements = $this->xpath('//select[@id=:id]//option[@value=:value]', array(':id' => 'edit-regions-' . $key, ':value' => $hidden_region));
                 $this->assertFalse(isset($elements[0]), t('The hidden region @region is not available for @theme.', array('@region' => $hidden_region, '@theme' => $key)));
             }
         }
     }
     // Add a new custom block by filling out the input form on the
     // admin/structure/block/add page.
     $custom_block = array();
     $custom_block['info'] = $this->randomName(8);
     $custom_block['title'] = $this->randomName(8);
     $custom_block['body[value]'] = $this->randomName(32);
     $this->drupalPost('admin/structure/block/add', $custom_block, t('Save block'));
     // Confirm that the custom block has been created, and then query the
     // created bid.
     $this->assertText(t('The block has been created.'), t('Custom block successfully created.'));
     $bid = db_query("SELECT bid FROM {block_custom} WHERE info = :info", array(':info' => $custom_block['info']))->fetchField();
     // Check to see if the custom block was created by checking that it's in
     // the database..
     $this->assertNotNull($bid, t('Custom block found in database'));
     // Check if the block can be moved to all available regions.
     $custom_block['module'] = 'block';
     $custom_block['delta'] = $bid;
     foreach ($this->regions as $region) {
         $this->moveBlockToRegion($custom_block, $region);
     }
     // Verify presence of configure and delete links for custom block.
     $this->drupalGet('admin/structure/block');
     $this->assertRaw(l(t('configure'), 'admin/structure/block/manage/block/' . $bid . '/configure'), t('Custom block configure link found.'));
     $this->assertRaw(l(t('delete'), 'admin/structure/block/manage/block/' . $bid . '/delete'), t('Custom block delete link found.'));
     // Set visibility only for authenticated users, to verify delete
     // functionality.
     $edit = array();
     $edit['roles[2]'] = TRUE;
     $this->drupalPost('admin/structure/block/manage/block/' . $bid . '/configure', $edit, t('Save block'));
     // Delete the created custom block & verify that it's been deleted and no
     // longer appearing on the page.
     $this->clickLink(t('delete'));
     $this->drupalPost('admin/structure/block/manage/block/' . $bid . '/delete', array(), t('Delete'));
     $this->assertRaw(t('The block %title has been removed.', array('%title' => $custom_block['info'])), t('Custom block successfully deleted.'));
     $this->assertNoText(t($custom_block['title']), t('Custom block no longer appears on page.'));
     $count = db_query("SELECT 1 FROM {block_role} WHERE module = :module AND delta = :delta", array(':module' => $custom_block['module'], ':delta' => $custom_block['delta']))->fetchField();
     $this->assertFalse($count, t('Table block_role being cleaned.'));
 }
Exemplo n.º 10
0
function az_branded_form_system_theme_settings_alter(&$form, &$form_state)
{
    unset($form['#submit']);
    $form['#submit'][] = 'az_branded_settings_form_submit';
    $themes = list_themes();
    $active_theme = $GLOBALS['theme_key'];
    $form_state['build_info']['files'][] = str_replace("/{$active_theme}.info", '', $themes[$active_theme]->filename) . '/theme-settings.php';
    return $form;
}
Exemplo n.º 11
0
 /**
  * Set admin theme given its machine name.
  *
  * @param string $name
  *    Theme machine name.
  *
  * @return bool
  *    TRUE if theme is found and enabled, FALSE otherwise.
  */
 public function setAdminTheme($name)
 {
     $themes = list_themes(TRUE);
     if (isset($themes[$name])) {
         theme_enable(array($name));
         variable_set('admin_theme', $name);
         return TRUE;
     } else {
         return FALSE;
     }
 }
 /**
  * Presents the custom block creation form.
  *
  * @param \Drupal\block_content\BlockContentTypeInterface $block_content_type
  *   The custom block type to add.
  * @param \Symfony\Component\HttpFoundation\Request $request
  *   The current request object.
  *
  * @return array
  *   A form array as expected by drupal_render().
  */
 public function addForm(BlockContentTypeInterface $block_content_type, Request $request)
 {
     $block = $this->blockContentStorage->create(array('type' => $block_content_type->id()));
     if (($theme = $request->query->get('theme')) && in_array($theme, array_keys(list_themes()))) {
         // We have navigated to this page from the block library and will keep track
         // of the theme for redirecting the user to the configuration page for the
         // newly created block in the given theme.
         $block->setTheme($theme);
     }
     return $this->entityFormBuilder()->getForm($block);
 }
Exemplo n.º 13
0
function kurr_form_system_theme_settings_alter(&$form, &$form_state)
{
    // Cocoon Options
    $form['cocoon_options'] = array('#type' => 'vertical_tabs', '#title' => t('Cocoon Theme Options'), '#weight' => 0, '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Cocoon Theme Skin Panel
    $form['cocoon_options']['cocoon_skin'] = array('#type' => 'fieldset', '#title' => t('Cocoon Theme Skin'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Cocoon Theme Skin Panel: Select Skin
    $form['cocoon_options']['cocoon_skin']['skin'] = array('#type' => 'select', '#title' => t('Select Skin'), '#description' => t('Choose a default skin color for the theme.'), '#options' => array('brown' => t('Brown'), 'green' => t('Green'), 'orange' => t('Orange'), 'red' => t('Red'), 'turquoise' => t('Turquoise'), 'violet' => t('Violet')), '#default_value' => theme_get_setting('skin'));
    // Cocoon Theme Skin Panel: Color
    $form['cocoon_options']['cocoon_skin']['color'] = array('#type' => 'select', '#title' => t('Base Color'), '#description' => t('Choose a base color for the theme.'), '#options' => array('light' => t('Light'), 'dark' => t('Dark')), '#default_value' => theme_get_setting('color'));
    // Cocoon Theme Skin Panel: Menu Position
    $form['cocoon_options']['cocoon_skin']['menu_position'] = array('#type' => 'select', '#title' => t('Menu Position'), '#description' => t('Choose a position for the menu.'), '#options' => array('left' => t('Left'), 'right' => t('Right')), '#default_value' => theme_get_setting('menu_position'));
    // Cocoon Theme Skin Panel: Custom CSS
    $form['cocoon_options']['cocoon_skin']['custom_css'] = array('#type' => 'textarea', '#title' => t('Custom CSS'), '#description' => t('Specify custom CSS tags and styling to apply to the theme. You can also override default styles here.'), '#rows' => '5', '#default_value' => theme_get_setting('custom_css'));
    // Cocoon Theme Features Panel
    $form['cocoon_options']['cocoon_features'] = array('#type' => 'fieldset', '#title' => t('Cocoon Theme Features'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Cocoon Theme Features Panel: Header title
    $form['cocoon_options']['cocoon_features']['header_title'] = array('#type' => 'textfield', '#title' => t('Header Title'), '#default_value' => theme_get_setting('header_title'), '#description' => t("Title in the header."));
    // Cocoon Theme Features Panel: Header subtitle
    $form['cocoon_options']['cocoon_features']['header_subtitle'] = array('#type' => 'textfield', '#title' => t('Header Subtitle'), '#default_value' => theme_get_setting('header_subtitle'), '#description' => t("Subtitle in the header."));
    // Cocoon Theme Features Panel: Copyright
    $form['cocoon_options']['cocoon_features']['copyright'] = array('#type' => 'textfield', '#title' => t('Footer Copyright Message'), '#default_value' => theme_get_setting('copyright'), '#description' => t("The copyright/disclaimer text in the footer."));
    // Cocoon Theme Features Panel: Menu info line 1
    $form['cocoon_options']['cocoon_features']['menu_line_1'] = array('#type' => 'textfield', '#title' => t('Menu Info Line 1'), '#default_value' => theme_get_setting('menu_line_1'), '#description' => t("First line of menu info. You may include HTML."));
    // Cocoon Theme Features Panel: Menu info line 2
    $form['cocoon_options']['cocoon_features']['menu_line_2'] = array('#type' => 'textfield', '#title' => t('Menu Info Line 2'), '#default_value' => theme_get_setting('menu_line_2'), '#description' => t("Second line of menu info. You may include HTML."));
    // Cocoon Theme Features Panel: Menu info line 3
    $form['cocoon_options']['cocoon_features']['menu_line_3'] = array('#type' => 'textfield', '#title' => t('Menu Info Line 3'), '#default_value' => theme_get_setting('menu_line_3'), '#description' => t("Third line of menu info. You may include HTML."));
    // Cocoon Theme Features Panel: Preloader
    $form['cocoon_options']['cocoon_features']['preloader'] = array('#type' => 'select', '#title' => t('Homepage Preloader'), '#description' => t('Display loading screen while page loads?'), '#options' => array(0 => t('No'), 1 => t('Yes')), '#default_value' => theme_get_setting('preloader'));
    // Cocoon Theme Features Panel: Testimonials BG
    $form['cocoon_options']['cocoon_features']['testimonials_bg'] = array('#type' => 'managed_file', '#title' => t('Testimonials Background Image'), '#description' => t('Upload a background image for the testimonials section.'), '#required' => FALSE, '#upload_location' => 'public://kurr/backgrounds', '#default_value' => theme_get_setting('testimonials_bg'), '#upload_validators' => array('file_validate_extensions' => array('gif png jpg jpeg')));
    // Cocoon Theme Features Panel: Quote BG
    $form['cocoon_options']['cocoon_features']['quote_bg'] = array('#type' => 'managed_file', '#title' => t('Quote Background Image'), '#description' => t('Upload a background image for the quote section.'), '#required' => FALSE, '#upload_location' => 'public://kurr/backgrounds', '#default_value' => theme_get_setting('quote_bg'), '#upload_validators' => array('file_validate_extensions' => array('gif png jpg jpeg')));
    // Cocoon Theme Features Panel: Social BG
    $form['cocoon_options']['cocoon_features']['social_bg'] = array('#type' => 'managed_file', '#title' => t('Social Links Background Image'), '#description' => t('Upload a background image for the social links section.'), '#required' => FALSE, '#upload_location' => 'public://kurr/backgrounds', '#default_value' => theme_get_setting('social_bg'), '#upload_validators' => array('file_validate_extensions' => array('gif png jpg jpeg')));
    $form['cocoon_branding'] = array('#prefix' => '<div class="cocoon-branding">', '#markup' => '<span>Created by Cocoon</span>', '#suffix' => '</div>', '#weight' => -100);
    $path_to_theme = drupal_get_path('theme', 'kurr');
    $form['#attached'] = array('css' => array($path_to_theme . '/css/cocoon-theme-settings.css'));
    $form['cocoon_options']['drupal_settings'] = array('#type' => 'fieldset', '#title' => t('Drupal Core Settings'));
    $form['cocoon_options']['drupal_settings']['theme_settings'] = $form['theme_settings'];
    $form['cocoon_options']['drupal_settings']['logo_settings']['logo'] = $form['logo'];
    $form['cocoon_options']['drupal_settings']['favicon'] = $form['favicon'];
    unset($form['theme_settings']);
    unset($form['logo']);
    unset($form['favicon']);
    $form['#submit'][] = 'kurr_settings_form_submit';
    // Get all themes.
    $themes = list_themes();
    // Get the current theme
    $active_theme = $GLOBALS['theme_key'];
    $form_state['build_info']['files'][] = str_replace("/{$active_theme}.info", '', $themes[$active_theme]->filename) . '/theme-settings.php';
}
Exemplo n.º 14
0
 public function getList()
 {
     $themes = $this->getThemes();
     $themes_list = list_themes();
     $results = array();
     if (!empty($themes) and !empty($themes_list)) {
         foreach ($themes_list as $theme) {
             $db_theme = (isset($themes[$theme['basename']]) and !empty($themes[$theme['basename']])) ? $themes[$theme['basename']] : array();
             $extension_id = !empty($db_theme['extension_id']) ? $db_theme['extension_id'] : 0;
             $theme_name = !empty($db_theme['name']) ? $db_theme['name'] : $theme['basename'];
             $results[$theme['basename']] = array('extension_id' => $extension_id, 'name' => $theme_name, 'title' => isset($theme['config']['title']) ? $theme['config']['title'] : $theme_name, 'version' => isset($theme['config']['version']) ? $theme['config']['version'] : '', 'description' => isset($theme['config']['description']) ? $theme['config']['description'] : '', 'location' => $theme['location'], 'screenshot' => root_url($theme['path'] . '/screenshot.png'), 'path' => $theme['path'], 'is_writable' => is_writable($theme['path']), 'config' => $theme['config'], 'data' => !empty($db_theme['data']) ? $db_theme['data'] : array(), 'customize' => (isset($theme['config']['customize']) and !empty($theme['config']['customize'])) ? TRUE : FALSE);
         }
     }
     return $results;
 }
 /**
  * {@inheritdoc}
  */
 public function parse($name)
 {
     if ($name instanceof TemplateReferenceInterface) {
         return $name;
     } else {
         if (isset($this->cache[$name])) {
             return $this->cache[$name];
         }
     }
     // normalize name
     $name = str_replace(':/', ':', preg_replace('#/{2,}#', '/', str_replace('\\', '/', $name)));
     $matches = [];
     // Little bit of explaination for this nice regex, first of, we cannot
     // check for "starting by" (^ operator) because Drupal theme() function
     // will prepend our identifiers by the file path, we must just drop it
     // silently if it's there. Then, we must absolutely ensure the template
     // name ends up with '.html.twig'. Finally, type:name:path are all
     // mandatory items else we cannot find the template real path.
     if (!preg_match('@([^/]+)\\:([\\w_\\-]+)\\:([^\\:]+)\\.([^\\.]+)\\.([^\\.]+)$@', $name, $matches)) {
         return $this->fallback($name);
     }
     $realname = $matches[0];
     try {
         // Problem is that our convention matches the same as symfony,
         // so we do need to ensure module or theme exists, if not then
         // fallback
         if ('module' === $matches[1]) {
             if (!module_exists($matches[2])) {
                 throw new \InvalidArgumentException();
             }
         } else {
             if ('theme' === $matches[1]) {
                 $themes = list_themes();
                 if (!isset($themes[$matches[2]])) {
                     throw new \InvalidArgumentException();
                 }
             } else {
                 throw new \InvalidArgumentException();
             }
         }
         $template = new DrupalTemplateReference($matches[1], $matches[2], $matches[3], $matches[4], $matches[5]);
         return $this->cache[$realname] = $template;
     } catch (\Exception $e) {
         return $this->fallback($name);
     }
 }
Exemplo n.º 16
0
/**
 * Return the theme settings' default values from the .info and save them into the database.
 * Credit: Zen http://drupal.org/project/zen
 *
 * @param $theme
 *   The name of theme.
 */
function sky_theme_get_default_settings($theme)
{
    $themes = list_themes();
    // Get the default values from the .info file.
    $defaults = !empty($themes[$theme]->info['settings']) ? $themes[$theme]->info['settings'] : array();
    if (!empty($defaults)) {
        // Merge the defaults with the theme settings saved in the database.
        $settings = array_merge($defaults, variable_get('theme_' . $theme . '_settings', array()));
        // Save the settings back to the database.
        variable_set('theme_' . $theme . '_settings', $settings);
        // If the active theme has been loaded, force refresh of Drupal internals.
        if (!empty($GLOBALS['theme_key'])) {
            theme_get_setting('', TRUE);
        }
    }
    // Return the default settings.
    return $defaults;
}
Exemplo n.º 17
0
/**
 * @file
 * Allow themes to alter the theme-specific settings form.
 *
 * With this hook, themes can alter the theme-specific settings form in any way
 * allowable by Drupal's Forms API, such as adding form elements, changing
 * default values and removing form elements. See the Forms API documentation on
 * api.drupal.org for detailed information.
 *
 * Note that the base theme's form alterations will be run before any sub-theme
 * alterations.
 *
 * @param $form
 *   Nested array of form elements that comprise the form.
 * @param $form_state
 *   A keyed array containing the current state of the form.
 */
function quatro_form_system_theme_settings_alter(&$form, $form_state)
{
    global $base_url;
    // Get theme name from url (admin/.../theme_name)
    $theme_name = arg(count(arg()) - 1);
    // Get default theme settings from .info file
    $theme_data = list_themes();
    // get data for all themes
    $defaults = $theme_name && isset($theme_data[$theme_name]->info['settings']) ? $theme_data[$theme_name]->info['settings'] : array();
    // Create theme settings form widgets using Forms API
    // ST Fieldset
    $form['st_container'] = array('#type' => 'fieldset', '#title' => t('ST Quatro theme settings'), '#description' => t('Use these settings to enhance the appearance of your SymphonyTheme theme.'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // General Settings
    $form['st_container']['general_settings'] = array('#type' => 'fieldset', '#title' => t('General settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Theme Color
    $form['st_container']['general_settings']['them_color_config'] = array('#type' => 'fieldset', '#title' => t('Color setting'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['st_container']['general_settings']['them_color_config']['theme_color'] = array('#type' => 'select', '#title' => t('Color'), '#default_value' => theme_get_setting('theme_color'), '#options' => array('blue' => t('Blue'), 'green' => t('Green'), 'red' => t('Red'), 'yellow' => t('Yellow'), 'orange' => t('Orange'), 'pink' => t('Pink'), 'purple' => t('Purple'), 'schachbundesliga' => t('Schachbundesliga')));
    // Return theme settings form
    return $form;
}
Exemplo n.º 18
0
function designmd_form_system_theme_settings_alter(&$form, $form_state)
{
    global $base_url;
    // Get theme name from url (admin/.../theme_name)
    $theme_name = arg(count(arg()) - 1);
    // Get default theme settings from .info file
    $theme_data = list_themes();
    // get data for all themes
    $defaults = $theme_name && isset($theme_data[$theme_name]->info['settings']) ? $theme_data[$theme_name]->info['settings'] : array();
    // Create theme settings form widgets using Forms API
    // ST Fieldset
    $form['st_container'] = array('#type' => 'fieldset', '#title' => t('Designmd theme settings'), '#description' => t('Use these settings to enhance the appearance of your Designmd theme.'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // General Settings
    $form['st_container']['general_settings'] = array('#type' => 'fieldset', '#title' => t('General settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Theme Color
    $form['st_container']['general_settings']['them_color_config'] = array('#type' => 'fieldset', '#title' => t('Style Settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['st_container']['general_settings']['them_color_config']['theme_color'] = array('#type' => 'select', '#title' => t('Select'), '#default_value' => theme_get_setting('theme_color'), '#options' => array('light' => t('Light'), 'dark' => t('Dark')));
    // Return theme settings form
    return $form;
}
/**
 * Implementation of THEMEHOOK_settings() function.
 *
 * @param $saved_settings
 *   An array of saved settings for this theme.
 * @return
 *   A form array.
 */
function zen_classic_settings($saved_settings)
{
    // Get the default values from the .info file.
    $themes = list_themes();
    $defaults = $themes['zen_classic']->info['settings'];
    // Merge the saved variables and their default values.
    $settings = array_merge($defaults, $saved_settings);
    /*
     * Create the form using Forms API: http://api.drupal.org/api/6
     */
    $form = array();
    $form['zen_classic_fixed'] = array('#type' => 'checkbox', '#title' => t('Use fixed width for theme'), '#default_value' => $settings['zen_classic_fixed'], '#description' => t('The theme should be centered and fixed at 960 pixels wide.'));
    // Add the base theme's settings.
    include_once './' . drupal_get_path('theme', 'zen') . '/theme-settings.php';
    $form += zen_settings($saved_settings, $defaults);
    // Remove some of the base theme's settings.
    unset($form['themedev']);
    //unset($form['themedev']['zen_layout']); // We don't need to select the base stylesheet.
    // Return the form
    return $form;
}
Exemplo n.º 20
0
/**
 * Implementation of THEMEHOOK_settings() function.
 *
 * @param $saved_settings
 *   array An array of saved settings for this theme.
 * @return
 *   array A form array.
 */
function kalmanhosszu_settings($saved_settings, $subtheme_defaults = array())
{
    $form = array();
    // Get the default values from the .info file.
    $themes = list_themes();
    $defaults = $themes['kalmanhosszu']->info['settings'];
    // Allow a subtheme to override the default values.
    $defaults = array_merge($defaults, $subtheme_defaults);
    // Merge the saved variables and their default values.
    $settings = array_merge($defaults, $saved_settings);
    // Create the form
    $form['community'] = array('#type' => 'fieldset', '#collapsible' => TRUE, '#collapsed' => TRUE, '#title' => t('Community buttons'), '#description' => t('Header left side community buttons.'));
    $form['community']['kalmanhosszu_rss_feed_url'] = array('#type' => 'textfield', '#title' => t('RSS URL'), '#default_value' => $settings['kalmanhosszu_rss_feed_url']);
    $form['community']['kalmanhosszu_linked_in_url'] = array('#type' => 'textfield', '#title' => t('LinkedIn URL'), '#default_value' => $settings['kalmanhosszu_linked_in_url']);
    $form['community']['kalmanhosszu_twitter_url'] = array('#type' => 'textfield', '#title' => t('Twitter URL'), '#default_value' => $settings['kalmanhosszu_twitter_url']);
    $form['share'] = array('#type' => 'fieldset', '#collapsible' => TRUE, '#collapsed' => TRUE, '#title' => t('Share buttons'));
    $form['share']['kalmanhosszu_show_facebook_share'] = array('#type' => 'checkbox', '#title' => t('Show facebook share button'), '#default_value' => $settings['kalmanhosszu_show_facebook_share']);
    $form['share']['kalmanhosszu_show_iwiw_share'] = array('#type' => 'checkbox', '#title' => t('Show iwiw share button'), '#default_value' => $settings['kalmanhosszu_show_iwiw_share'], '#description' => t('IWIW is a Hungarian social media site like facebook.'));
    $form['share']['kalmanhosszu_show_twitter_share'] = array('#type' => 'checkbox', '#title' => t('Show twitter share button'), '#default_value' => $settings['kalmanhosszu_show_twitter_share']);
    $form['share']['kalmanhosszu_twitter_acc'] = array('#type' => 'textfield', '#title' => t('Twitter account'), '#default_value' => $settings['kalmanhosszu_twitter_acc'], '#description' => t('If You add yout twitter account name, it will shows in shared tweets.'));
    return $form;
}
/**
 * @file
 * Allow themes to alter the theme-specific settings form.
 *
 * With this hook, themes can alter the theme-specific settings form in any way
 * allowable by Drupal's Forms API, such as adding form elements, changing
 * default values and removing form elements. See the Forms API documentation on
 * api.drupal.org for detailed information.
 *
 * Note that the base theme's form alterations will be run before any sub-theme
 * alterations.
 *
 * @param $form
 *   Nested array of form elements that comprise the form.
 * @param $form_state
 *   A keyed array containing the current state of the form.
 */
function velocity_form_system_theme_settings_alter(&$form, $form_state)
{
    global $base_url;
    // Get theme name from url (admin/.../theme_name)
    $theme_name = arg(count(arg()) - 1);
    // Get default theme settings from .info file
    $theme_data = list_themes();
    // get data for all themes
    $defaults = $theme_name && isset($theme_data[$theme_name]->info['settings']) ? $theme_data[$theme_name]->info['settings'] : array();
    // Create theme settings form widgets using Forms API
    // ST Fieldset
    $form['st_container'] = array('#type' => 'fieldset', '#title' => t('ST Velocity theme settings'), '#description' => t('Use these settings to enhance the appearance of your SymphonyTheme theme.'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // General Settings
    $form['st_container']['general_settings'] = array('#type' => 'fieldset', '#title' => t('General settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Theme Color
    $form['st_container']['general_settings']['them_color_config'] = array('#type' => 'fieldset', '#title' => t('Color setting'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['st_container']['general_settings']['them_color_config']['theme_color'] = array('#type' => 'select', '#title' => t('Color'), '#default_value' => theme_get_setting('theme_color'), '#options' => array('orange' => t('Orange - Default'), 'red' => t('Red'), 'blue' => t('Blue'), 'green' => t('Green'), 'brown' => t('Brown'), 'cyan' => t('Cyan'), 'light-orange' => t('Light Orange'), 'dark-blue' => t('Dark Blue'), 'vine' => t('Vine'), 'navy' => t('Navy')));
    // Theme layout
    $form['st_container']['general_settings']['them_layout_config'] = array('#type' => 'fieldset', '#title' => t('Layout setting'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['st_container']['general_settings']['them_layout_config']['theme_layout'] = array('#type' => 'select', '#title' => t('Layout'), '#default_value' => theme_get_setting('theme_layout'), '#options' => array('layout-wide' => t('Wide - Default'), 'layout-boxed' => t('Boxed')));
    // Return theme settings form
    return $form;
}
Exemplo n.º 22
0
function az_gov_form_system_theme_settings_alter(&$form, &$form_state)
{
    //if the user is not an administrator, moves two bootstrap settings and adds a css file to hide certain settings.
    global $user;
    if (!in_array('administrator', $user->roles)) {
        $form['javascript']['#group'] = '';
        $form['advanced']['#group'] = '';
        drupal_add_css(drupal_get_path('theme', 'az_gov') . '/css/non-admin-theme.css');
    }
    drupal_add_css('#edit-color .form-item {height:auto !important;}', 'inline');
    //Custom Background Image
    $form['background'] = array('#type' => 'fieldset', '#group' => 'global', '#title' => t('Custom Background'), '#description' => t('Uplaod the file you would like to use as your background file instead of the default background.'));
    $form['background']['main_background'] = array('#type' => 'managed_file', '#title' => t('Custom background'), '#default_value' => theme_get_setting('main_background'), '#upload_location' => 'public://theme-settings', '#upload_validators' => array('file_validate_extensions' => array('gif png jpg jpeg')));
    //Footer Contact Information
    $form['footer_settings'] = array('#type' => 'fieldset', '#title' => 'Footer Settings', '#group' => 'global');
    //Toggle display of the branding block in the footer
    $form['footer_settings']['display_footer_branding'] = array('#type' => 'checkbox', '#title' => t('Display the branding block in the footer'), '#default_value' => theme_get_setting('display_footer_branding'), '#tree' => FALSE, '#description' => t('Check here if you want to display the branding  block in the footer.'));
    //Capture the information for the Contact Us section in the footer
    $form['footer_settings']['display_footer_contact'] = array('#type' => 'checkbox', '#title' => t('Display the Contact Us block in the footer'), '#default_value' => theme_get_setting('display_footer_contact'), '#tree' => FALSE, '#description' => t('Check here if you want to display the Contact Us block in the footer.'));
    $form['footer_settings']['postcard'] = array('#type' => 'container', '#states' => array('invisible' => array('input[name="display_footer_contact"]' => array('checked' => FALSE))));
    $form['footer_settings']['postcard']['footer_title'] = array('#type' => 'textfield', '#size' => 25, '#title' => t('Title'), '#description' => t('Title for the Contact Us block.'), '#default_value' => theme_get_setting('footer_title'));
    $form['footer_settings']['postcard']['footer_title_link'] = array('#type' => 'textfield', '#size' => 25, '#title' => t('Title Link'), '#description' => t('Link for the title in the Contact Us block. (Recommend linking to the contact form.)'), '#default_value' => theme_get_setting('footer_title_link'));
    $form['footer_settings']['postcard']['footer_agency_title'] = array('#type' => 'textfield', '#size' => 25, '#title' => t('Agency Title'), '#description' => t('Agency title for the Contact Us block.'), '#default_value' => theme_get_setting('footer_agency_title'));
    $form['footer_settings']['postcard']['footer_address_1'] = array('#type' => 'textfield', '#size' => 25, '#title' => t('Address Line 1'), '#description' => t('Address line 1 for the Contact Us block.'), '#default_value' => theme_get_setting('footer_address_1'));
    $form['footer_settings']['postcard']['footer_address_2'] = array('#type' => 'textfield', '#size' => 25, '#title' => t('Address Line 2'), '#description' => t('Address line 2 for the Contact Us block.'), '#default_value' => theme_get_setting('footer_address_2'));
    $form['footer_settings']['postcard']['footer_phone'] = array('#type' => 'textfield', '#size' => 25, '#title' => t('Phone Number'), '#description' => t('Phone number for the Contact Us block.'), '#default_value' => theme_get_setting('footer_phone'));
    $form['footer_settings']['postcard']['footer_fax'] = array('#type' => 'textfield', '#size' => 25, '#title' => t('Fax Number'), '#description' => t('Fax number for the Contact Us block.'), '#default_value' => theme_get_setting('footer_fax'));
    $form['footer_settings']['postcard']['footer_map_link'] = array('#type' => 'textfield', '#size' => 25, '#title' => t('Map Link'), '#description' => t('Link for the map in the Contact Us block.'), '#default_value' => theme_get_setting('footer_map_link'));
    $form['footer_settings']['postcard']['footer_map_image'] = array('#type' => 'managed_file', '#title' => t('Upload map image'), '#description' => t("Use this field to upload your map image. (The image will be resized to 150 x 150)"), '#default_value' => theme_get_setting('footer_map_image'), '#upload_location' => 'public://theme-settings', '#upload_validators' => array('file_validate_extensions' => array('gif png jpg jpeg'), 'file_validate_image_resolution' => array('150x150')));
    //End Contact Us
    unset($form['#submit']);
    $form['#submit'][] = 'az_gov_settings_form_submit';
    $themes = list_themes();
    $active_theme = $GLOBALS['theme_key'];
    $form_state['build_info']['files'][] = str_replace("/{$active_theme}.info", '', $themes[$active_theme]->filename) . '/theme-settings.php';
    return $form;
}
Exemplo n.º 23
0
/**
 * Return the theme settings' default values from the .info and save them into the database.
 *
 * @param $theme
 *   The name of theme.
 */
function layoutstudio_theme_get_default_settings($theme)
{
    $themes = list_themes();
    // Get the default values from the .info file.
    $defaults = !empty($themes[$theme]->info['settings']) ? $themes[$theme]->info['settings'] : array();
    if (!empty($defaults)) {
        // Get the theme settings saved in the database.
        $settings = theme_get_settings($theme);
        // Don't save the toggle_node_info_ variables.
        if (module_exists('node')) {
            foreach (node_get_types() as $type => $name) {
                unset($settings['toggle_node_info_' . $type]);
            }
        }
        // Save default theme settings.
        variable_set(str_replace('/', '_', 'theme_' . $theme . '_settings'), array_merge($defaults, $settings));
        // If the active theme has been loaded, force refresh of Drupal internals.
        if (!empty($GLOBALS['theme_key'])) {
            theme_get_setting('', TRUE);
        }
    }
    // Return the default settings.
    return $defaults;
}
Exemplo n.º 24
0
/**
 * Theme paths function
 * Retrieves current theme path and its parent
 * theme paths, in parent-to-child order.
 */
function fusion_core_theme_paths($theme)
{
    $all_parents = array();
    $themes = list_themes();
    $all_parents[$theme] = drupal_get_path('theme', $theme);
    $base_theme = $themes[$theme]->info['base theme'];
    while ($base_theme) {
        $all_parents[$base_theme] = drupal_get_path('theme', $base_theme);
        $base_theme = isset($themes[$base_theme]->info['base theme']) ? $themes[$base_theme]->info['base theme'] : '';
    }
    return array_reverse($all_parents);
}
Exemplo n.º 25
0
/**
 * Implementation of THEMEHOOK_settings() function.
 *
 * @param $saved_settings
 *   array An array of saved settings for this theme.
 * @return
 *   array A form array.
 */
function rootcandy_fixed_settings($saved_settings, $subtheme_defaults = array())
{
    // Get the default values from the .info file.
    $themes = list_themes();
    $defaults = $themes['rootcandy_fixed']->info['settings'];
    // Allow a subtheme to override the default values.
    $defaults = array_merge($defaults, $subtheme_defaults);
    // Merge the saved variables and their default values.
    $settings = array_merge($defaults, $saved_settings);
    // Create the form widgets using Forms API
    $form['header'] = array('#type' => 'fieldset', '#title' => t('Header'), '#weight' => 1, '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['header']['rootcandy_header_display'] = array('#type' => 'checkbox', '#title' => t('Disable header'), '#default_value' => $settings['rootcandy_header_display']);
    $form['header']['rootcandy_hide_panel'] = array('#type' => 'checkbox', '#title' => t('Disable sliding panel'), '#default_value' => $settings['rootcandy_hide_panel']);
    $form['dashboard'] = array('#type' => 'fieldset', '#title' => t('Dashboard'), '#weight' => 1, '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['dashboard']['rootcandy_dashboard_display'] = array('#type' => 'checkbox', '#title' => t('Disable dashboard regions'), '#default_value' => $settings['rootcandy_dashboard_display']);
    $form['dashboard']['rootcandy_dashboard_help'] = array('#type' => 'select', '#options' => array('left' => t('Left'), 'right' => t('Right'), 'content' => t('Content')), '#title' => t('Help box position'), '#default_value' => $settings['rootcandy_dashboard_help']);
    $form['dashboard']['rootcandy_dashboard_messages'] = array('#type' => 'select', '#options' => array('left' => t('Left'), 'right' => t('Right'), 'content' => t('Content')), '#title' => t('Messages box position'), '#default_value' => $settings['rootcandy_dashboard_messages']);
    $form['dashboard']['rootcandy_dashboard_content_display'] = array('#type' => 'checkbox', '#title' => t('Disable content on a dashboard'), '#default_value' => $settings['rootcandy_dashboard_content_display']);
    $form['navigation'] = array('#type' => 'fieldset', '#title' => t('Navigation'), '#weight' => 1, '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Create the form widgets using Forms API
    $form['navigation']['rootcandy_navigation_icons'] = array('#type' => 'checkbox', '#title' => t('Disable icons for main navigation'), '#default_value' => $settings['rootcandy_navigation_icons']);
    $form['navigation']['rootcandy_navigation_icons_size'] = array('#type' => 'select', '#options' => array(16 => 16, 24 => 24, 32 => 32), '#title' => t('Set icons size for main navigation'), '#default_value' => $settings['rootcandy_navigation_icons_size']);
    $menu_options = array_merge(array('_rootcandy_default_navigation' => t('default navigation')), menu_get_menus());
    if (!isset($settings['rootcandy_navigation_source_admin'])) {
        $settings['rootcandy_navigation_source_admin'] = '_rootcandy_default_navigation';
    }
    $form['navigation']['rootcandy_superuser_menu'] = array('#type' => 'fieldset', '#title' => t('Super user (uid 1) menu'), '#weight' => 1, '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['navigation']['rootcandy_superuser_menu']['rootcandy_navigation_source_admin'] = array('#type' => 'select', '#default_value' => $settings['rootcandy_navigation_source_admin'], '#options' => $menu_options, '#tree' => FALSE);
    $primary_options = array(NULL => t('None'));
    $primary_options = array_merge($primary_options, $menu_options);
    $form['navigation']['role-weights'] = array('#type' => 'fieldset', '#title' => t('Menu by role and weights'), '#weight' => 1, '#collapsible' => TRUE, '#collapsed' => TRUE);
    $roles = user_roles(FALSE);
    $max_weight = 0;
    foreach ($roles as $rid => $role) {
        if (empty($settings['rootcandy_navigation_source_' . $rid])) {
            $settings['rootcandy_navigation_source_' . $rid] = '';
        }
        $form['navigation']['nav-by-role']['rootcandy_navigation_source_' . $rid] = array('#type' => 'select', '#default_value' => $settings['rootcandy_navigation_source_' . $rid], '#options' => $primary_options, '#tree' => FALSE);
        // check the highest weight for later use
        if (isset($settings['role-weight-' . $rid])) {
            if ($max_weight < $settings['role-weight-' . $rid]) {
                $max_weight = $settings['role-weight-' . $rid];
            }
        }
    }
    $form['navigation']['custom-icons'] = array('#type' => 'fieldset', '#title' => t('Custom icons'), '#weight' => 1, '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['navigation']['custom-icons']['rootcandy_navigation_custom_icons'] = array('#type' => 'textarea', '#title' => t('Custom icons'), '#default_value' => $settings['rootcandy_navigation_custom_icons'], '#description' => t('Format: menu href|icon path (relative to drupal root) - one item per row. eg. admin/build|files/myicons/admin-build.png'), '#required' => FALSE);
    // Create the form widgets using Forms API
    $form['Misc'] = array('#type' => 'fieldset', '#title' => t('Misc'), '#weight' => 1, '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['Misc']['rootcandy_help_display'] = array('#type' => 'checkbox', '#title' => t('Disable help'), '#default_value' => $settings['rootcandy_help_display']);
    $form['Misc']['rootcandy_hide_author'] = array('#type' => 'checkbox', '#title' => t('Hide author footer message'), '#default_value' => $settings['rootcandy_hide_author']);
    $max_weight = isset($max_weight) ? $max_weight : 100;
    foreach ($roles as $rid => $role) {
        if (empty($settings['role-weight-' . $rid])) {
            $settings['role-weight-' . $rid] = '';
        }
        if (!($weight = $settings['role-weight-' . $rid])) {
            $weight = ++$max_weight;
        }
        $data = array($role);
        $form['rows'][$rid]['data'] = array('#type' => 'value', '#value' => $data);
        $form['rows'][$rid]['role-weight-' . $rid] = array('#type' => 'textfield', '#size' => 5, '#default_value' => $weight, '#attributes' => array('class' => 'weight'));
    }
    // Return the additional form widgets
    return $form;
}
Exemplo n.º 26
0
function rootcandy_system_settings_form($form)
{
    $themes = list_themes();
    $enabled_theme = arg(4);
    if ($form['#id'] == 'system-theme-settings' and $enabled_theme == 'rootcandy' || $themes[$enabled_theme]->base_theme == 'rootcandy') {
        foreach ($form['theme_specific']['rows'] as $rid => $row) {
            //we are only interested in numeric keys
            if (intval($rid)) {
                $this_row = $row['data']['#value'];
                //Add the weight field to the row
                $weight = $form['theme_specific']['rows'][$rid]['role-weight-' . $rid]['#value'];
                $this_row[] = drupal_render($form['theme_specific']['navigation']['nav-by-role']['rootcandy_navigation_source_' . $rid]);
                $this_row[] = drupal_render($form['theme_specific']['rows'][$rid]['role-weight-' . $rid]);
                //Add the row to the array of rows
                $table_rows[$weight] = array('data' => $this_row, 'class' => 'draggable');
            }
        }
        ksort($table_rows);
        $header = array("Role", "Navigation menu", "Order");
        $form['theme_specific']['navigation']['role-weights']['content']['#value'] = theme('table', $header, $table_rows, array('id' => 'rootcandy-settings-table'));
        $output = drupal_render($form);
        drupal_add_tabledrag('rootcandy-settings-table', 'order', 'sibling', 'weight');
    } else {
        $output = drupal_render($form);
    }
    return $output;
}
Exemplo n.º 27
0
/**
* Implementation of THEMEHOOK_settings() function.
*
* @param $saved_settings
*   array An array of saved settings for this theme.
* @return
*   array A form array.
*/
function phptemplate_settings($saved_settings)
{
    global $base_url;
    // Get theme name from url (admin/.../theme_name)
    $theme_name = arg(count(arg()) - 1);
    // Combine default theme settings from .info file & theme-settings.php
    $theme_data = list_themes();
    // get data for all themes
    $info_theme_settings = $theme_name ? $theme_data[$theme_name]->info['settings'] : array();
    $defaults = array_merge(fusion_core_default_theme_settings(), $info_theme_settings);
    // Combine default and saved theme settings
    $settings = array_merge($defaults, $saved_settings);
    // Create theme settings form widgets using Forms API
    // TNT Fieldset
    $form['tnt_container'] = array('#type' => 'fieldset', '#title' => t('Fusion theme settings'), '#description' => t('Use these settings to enhance the appearance and functionality of your Fusion theme.'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // General Settings
    $form['tnt_container']['general_settings'] = array('#type' => 'fieldset', '#title' => t('General settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Grid settings
    $form['tnt_container']['general_settings']['theme_grid_config'] = array('#type' => 'fieldset', '#title' => t('Layout'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Grid type
    // Generate grid type options
    $grid_options = array();
    foreach ($info_theme_settings['theme_grid_options'] as $grid_option) {
        $grid_type = substr($grid_option, 7) == 'fluid' ? t('fluid grid') : t('fixed grid') . ' [' . substr($grid_option, 7) . 'px]';
        $grid_options[$grid_option] = substr($grid_option, 4, 2) . t(' column ') . $grid_type;
    }
    $form['tnt_container']['general_settings']['theme_grid_config']['theme_grid'] = array('#type' => 'radios', '#title' => t('Select a grid layout for your theme'), '#default_value' => $settings['theme_grid'], '#options' => $grid_options);
    $form['tnt_container']['general_settings']['theme_grid_config']['theme_grid']['#options'][$defaults['theme_grid']] .= t(' - Theme Default');
    // Fluid grid width
    $form['tnt_container']['general_settings']['theme_grid_config']['fluid_grid_width'] = array('#type' => 'select', '#title' => t('Select a width for your fluid grid layout'), '#default_value' => $settings['fluid_grid_width'], '#options' => array('fluid-100' => t('100%'), 'fluid-95' => t('95%'), 'fluid-90' => t('90%'), 'fluid-85' => t('85%')));
    $form['tnt_container']['general_settings']['theme_grid_config']['fluid_grid_width']['#options'][$defaults['fluid_grid_width']] .= t(' - Theme Default');
    // Sidebar layout
    $form['tnt_container']['general_settings']['theme_grid_config']['sidebar_layout'] = array('#type' => 'radios', '#title' => t('Select a sidebar layout for your theme'), '#default_value' => $settings['sidebar_layout'], '#options' => array('sidebars-split' => t('Split sidebars'), 'sidebars-both-first' => t('Both sidebars first'), 'sidebars-both-last' => t('Both sidebars last')));
    $form['tnt_container']['general_settings']['theme_grid_config']['sidebar_layout']['#options'][$defaults['sidebar_layout']] .= t(' - Theme Default');
    // Calculate sidebar width options
    $grid_width = (int) substr($settings['theme_grid'], 4, 2);
    $grid_type = substr($settings['theme_grid'], 7);
    $width_options = array();
    for ($i = 1; $i <= floor($grid_width / 2); $i++) {
        $grid_units = $i . ($i == 1 ? t(' grid unit: ') : t(' grid units: '));
        $width_options[$i] = $grid_units . ($grid_type == 'fluid' ? round($i * (100 / $grid_width), 2) . '%' : $i * ((int) $grid_type / $grid_width) . 'px');
    }
    // Sidebar first width
    $form['tnt_container']['general_settings']['theme_grid_config']['sidebar_first_width'] = array('#type' => 'select', '#title' => t('Select a different width for your first sidebar'), '#default_value' => $settings['sidebar_first_width'], '#options' => $width_options);
    $form['tnt_container']['general_settings']['theme_grid_config']['sidebar_first_width']['#options'][$defaults['sidebar_first_width']] .= t(' - Theme Default');
    // Sidebar last width
    $form['tnt_container']['general_settings']['theme_grid_config']['sidebar_last_width'] = array('#type' => 'select', '#title' => t('Select a different width for your last sidebar'), '#default_value' => $settings['sidebar_last_width'], '#options' => $width_options);
    $form['tnt_container']['general_settings']['theme_grid_config']['sidebar_last_width']['#options'][$defaults['sidebar_last_width']] .= t(' - Theme Default');
    // Theme fonts
    $form['tnt_container']['general_settings']['theme_font_config'] = array('#type' => 'fieldset', '#title' => t('Typography'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Font family settings
    $form['tnt_container']['general_settings']['theme_font_config']['theme_font_config_font'] = array('#type' => 'fieldset', '#title' => t('Font family'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['theme_font_config']['theme_font_config_font']['theme_font'] = array('#type' => 'radios', '#title' => t('Select a new font family'), '#default_value' => $settings['theme_font'], '#options' => array('none' => t('Theme default'), 'font-family-sans-serif-sm' => '<span class="font-family-sans-serif-sm">' . t('Sans serif - smaller (Helvetica Neue, Arial, Helvetica, sans-serif)') . '</span>', 'font-family-sans-serif-lg' => '<span class="font-family-sans-serif-lg">' . t('Sans serif - larger (Verdana, Geneva, Arial, Helvetica, sans-serif)') . '</span>', 'font-family-serif-sm' => '<span class="font-family-serif-sm">' . t('Serif - smaller (Garamond, Perpetua, Nimbus Roman No9 L, Times New Roman, serif)') . '</span>', 'font-family-serif-lg' => '<span class="font-family-serif-lg">' . t('Serif - larger (Baskerville, Georgia, Palatino, Palatino Linotype, Book Antiqua, URW Palladio L, serif)') . '</span>', 'font-family-myriad' => '<span class="font-family-myriad">' . t('Myriad (Myriad Pro, Myriad, Trebuchet MS, Arial, Helvetica, sans-serif)') . '</span>', 'font-family-lucida' => '<span class="font-family-lucida">' . t('Lucida (Lucida Sans, Lucida Grande, Lucida Sans Unicode, Verdana, Geneva, sans-serif)') . '</span>'));
    // Font size settings
    $form['tnt_container']['general_settings']['theme_font_config']['theme_font_config_size'] = array('#type' => 'fieldset', '#title' => t('Font size'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['theme_font_config']['theme_font_config_size']['theme_font_size'] = array('#type' => 'radios', '#title' => t('Change the base font size'), '#description' => t('Adjusts all text in proportion to your base font size.'), '#default_value' => $settings['theme_font_size'], '#options' => array('font-size-10' => t('10px'), 'font-size-11' => t('11px'), 'font-size-12' => t('12px'), 'font-size-13' => t('13px'), 'font-size-14' => t('14px'), 'font-size-15' => t('15px'), 'font-size-16' => t('16px'), 'font-size-17' => t('17px'), 'font-size-18' => t('18px')));
    $form['tnt_container']['general_settings']['theme_font_config']['theme_font_config_size']['theme_font_size']['#options'][$defaults['theme_font_size']] .= t(' - Theme Default');
    // Navigation
    $form['tnt_container']['general_settings']['navigation'] = array('#type' => 'fieldset', '#title' => t('Navigation'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Primary menu dropdown
    $form['tnt_container']['general_settings']['navigation']['primary_menu'] = array('#type' => 'fieldset', '#title' => t('Primary Menu'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['navigation']['primary_menu']['primary_menu_dropdown'] = array('#type' => 'checkbox', '#title' => t('Enable primary menu as dropdown'), '#default_value' => $settings['primary_menu_dropdown']);
    // Breadcrumb
    $form['tnt_container']['general_settings']['navigation']['breadcrumb'] = array('#type' => 'fieldset', '#title' => t('Breadcrumb'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['navigation']['breadcrumb']['breadcrumb_display'] = array('#type' => 'checkbox', '#title' => t('Display breadcrumb'), '#default_value' => $settings['breadcrumb_display']);
    // Search Settings
    if (module_exists('search')) {
        $form['tnt_container']['general_settings']['search_container'] = array('#type' => 'fieldset', '#title' => t('Search results'), '#description' => t('What additional information should be displayed on your search results page?'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_snippet'] = array('#type' => 'checkbox', '#title' => t('Display text snippet'), '#default_value' => $settings['search_snippet']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_type'] = array('#type' => 'checkbox', '#title' => t('Display content type'), '#default_value' => $settings['search_info_type']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_user'] = array('#type' => 'checkbox', '#title' => t('Display author name'), '#default_value' => $settings['search_info_user']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_date'] = array('#type' => 'checkbox', '#title' => t('Display posted date'), '#default_value' => $settings['search_info_date']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_comment'] = array('#type' => 'checkbox', '#title' => t('Display comment count'), '#default_value' => $settings['search_info_comment']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_upload'] = array('#type' => 'checkbox', '#title' => t('Display attachment count'), '#default_value' => $settings['search_info_upload']);
    }
    // Username
    $form['tnt_container']['general_settings']['username'] = array('#type' => 'fieldset', '#title' => t('Username'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['username']['user_notverified_display'] = array('#type' => 'checkbox', '#title' => t('Display "not verified" for unregistered usernames'), '#default_value' => $settings['user_notverified_display']);
    // Admin settings
    $form['tnt_container']['admin_settings'] = array('#type' => 'fieldset', '#title' => t('Administrator settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['admin_settings']['block_config_link'] = array('#type' => 'checkbox', '#title' => t('Display block configure links for administrators.'), '#default_value' => $settings['block_config_link'], '#description' => t('This setting provides convenient hover links to block configuration pages directly from the block.'));
    $form['tnt_container']['admin_settings']['grid_mask'] = array('#type' => 'checkbox', '#title' => t('Enable grid overlay mask for administrators.'), '#default_value' => $settings['grid_mask'], '#description' => t('This setting enables a "GRID" button in the upper left corner of each page to toggle a grid overlay and block outlines, which can help with visualizing page layout and block positioning.'));
    // Developer settings
    $form['tnt_container']['themedev'] = array('#type' => 'fieldset', '#title' => t('Developer settings'), '#collapsible' => TRUE, '#collapsed' => $settings['rebuild_registry'] ? FALSE : TRUE);
    $form['tnt_container']['themedev']['rebuild_registry'] = array('#type' => 'checkbox', '#title' => t('Rebuild theme registry for every page.'), '#default_value' => $settings['rebuild_registry'], '#description' => t('This setting is useful while developing themes (see <a href="!link">rebuilding the theme registry</a>). However, it <strong>significantly degrades performance</strong> and should be turned off for any production website.', array('!link' => 'http://drupal.org/node/173880#theme-registry')));
    $form['tnt_container']['themedev']['fix_css_limit'] = array('#type' => 'checkbox', '#title' => t('Avoid IE stylesheet limit.'), '#default_value' => $settings['fix_css_limit'], '#description' => t('This setting groups css files so Internet Explorer can see more than 30 of them. This is useful when you cannot use aggregation (e.g., when developing or using private file downloads). But because it degrades performance and can load files out of order, CSS aggregation (<a href="!link">Optimize CSS files</a>) is <strong>strongly</strong> recommended instead for any production website.', array('!link' => $base_url . '/admin/settings/performance')));
    // Return theme settings form
    return $form;
}
Exemplo n.º 28
0
function at_commerce_preprocess(&$vars)
{
    if (!array_key_exists('adaptivetheme', list_themes())) {
        drupal_set_message(t('Error! <a href="!link">AT Core</a> base theme not found. Please install and enable Adaptivetheme Core.', array('!link' => 'http://drupal.org/project/adaptivetheme')), 'error', false);
    }
}
Exemplo n.º 29
0
/**
 * Read the theme settings' default values from the .info and save them into the database.
 *
 * @param $theme
 *   The actual name of theme that is being checked.
 */
function rootcandy_settings_init($theme)
{
    $themes = list_themes();
    // Get the default values from the .info file.
    $defaults = $themes[$theme]->info['settings'];
    // Get the theme settings saved in the database.
    $settings = theme_get_settings($theme);
    // Don't save the toggle_node_info_ variables.
    if (module_exists('node')) {
        foreach (node_get_types() as $type => $name) {
            unset($settings['toggle_node_info_' . $type]);
        }
    }
    // Save default theme settings.
    variable_set(str_replace('/', '_', 'theme_' . $theme . '_settings'), array_merge($defaults, $settings));
    // Force refresh of Drupal internals.
    theme_get_setting('', TRUE);
}
<?php

global $base_url;
global $theme_key;
$themes = list_themes();
$theme_object = $themes[$theme_key];
$site_var = variable_get('site_country', '');
$site_node = node_load($site_var);
$theme_name = $theme_object->name;
$access_denied = 0;
$admin_page_urls = variable_get('admin_pages_list', '');
$flag_img = substr($site_node->field_website_header_image[0]['filepath'], strpos($site_node->field_website_header_image[0]['filepath'], "files/"));
if (variable_get('file_downloads', '') == 2) {
    $site_img = $base_url . "/system/" . $flag_img;
} else {
    $site_img = $base_url . '/' . $site_node->field_website_header_image[0]['filepath'];
}
$portal_url = $site_node->field_country_portal_url[0]['url'];
$gov_name = $site_node->field_union_govt_name[0]['value'];
if (in_array(drupal_get_path_alias($_GET['q']), explode("\r\n", $admin_page_urls)) && in_array('anonymous user', $user->roles)) {
    $access_denied = 1;
    $head_title = "Access Denied";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php 
print $language->language;
?>
" xml:lang="<?php 
print $language->language;
?>