You are here

function express_install in Express 7.2

Same name and namespace in other branches
  1. 8 express.install \express_install()

Implements hook_install().

Perform actions to set up the site for this profile.

File

./express.install, line 7

Code

function express_install() {

  // Enable some express blocks.

  //$default_theme = 'express_modern';

  //$admin_theme = 'express_admin_theme';
  $default_theme = 'cuspirit';
  $admin_theme = 'expressadmin';

  // disable all themes
  db_update('system')
    ->fields(array(
    'status' => 0,
  ))
    ->condition('type', 'theme')
    ->execute();

  // enable $default_theme
  db_update('system')
    ->fields(array(
    'status' => 1,
  ))
    ->condition('type', 'theme')
    ->condition('name', $default_theme)
    ->execute();
  variable_set('theme_default', $default_theme);
  variable_set('admin_theme', $admin_theme);

  // activate admin theme when editing a node
  variable_set('node_admin_theme', '1');
  $blocks = array(
    array(
      'module' => 'system',
      'delta' => 'main',
      'theme' => $default_theme,
      'status' => 1,
      'weight' => 0,
      'region' => 'content',
      'pages' => '',
      'cache' => -1,
    ),
    array(
      'module' => 'system',
      'delta' => 'help',
      'theme' => $default_theme,
      'status' => 1,
      'weight' => -10,
      'region' => 'content',
      'pages' => '',
      'cache' => -1,
    ),
    array(
      'module' => 'system',
      'delta' => 'main',
      'theme' => $admin_theme,
      'status' => 1,
      'weight' => 0,
      'region' => 'content',
      'pages' => '',
      'cache' => -1,
    ),
    array(
      'module' => 'system',
      'delta' => 'help',
      'theme' => $admin_theme,
      'status' => 1,
      'weight' => 0,
      'region' => 'help',
      'pages' => '',
      'cache' => -1,
    ),
  );

  // drop system / user blocks to ensure correct building
  db_delete('block')
    ->condition('module', 'system')
    ->execute();
  db_delete('block')
    ->condition('module', 'user')
    ->execute();

  // add in our blocks defined above
  $query = db_insert('block')
    ->fields(array(
    'module',
    'delta',
    'theme',
    'status',
    'weight',
    'region',
    'pages',
    'cache',
  ));
  foreach ($blocks as $block) {
    $query
      ->values($block);
  }
  $query
    ->execute();

  // From shortcut.install, add shortcuts to the default set on install
  $shortcut_set = shortcut_set_load(SHORTCUT_DEFAULT_SET_NAME);
  $shortcut_set->links = NULL;
  $shortcut_set->links = array(
    array(
      'link_path' => 'admin/structure/menu/manage/main-menu',
      'link_title' => st('Main Menu'),
      'weight' => -12,
    ),
  );
  shortcut_set_save($shortcut_set);

  // FROM CU_FIT
  variable_set('node_admin_theme', 1);
  variable_set('quicktabs_tabstyle', 'Tabs');

  // move to advanced layout bundle
  variable_set('image_allow_insecure_derivatives', TRUE);
  variable_set('pathauto_transliterate', 1);

  // moved from bucket to admin theme.
  variable_set('error_level', 0);
  variable_set('site_default_country', 'US');
  variable_set('user_register', 0);
  variable_set('focal_point_default_method', 'smartcrop');

  // Set menu source variables for secondary and footer menus
  variable_set('menu_footer_links_source', 'menu-footer-menu');
  variable_set('menu_secondary_links_source', 'menu-secondary-menu');

  // Set google_appliance_error_gsa_no_results_format to wysiwyg
  variable_set('google_appliance_error_gsa_no_results_format', 'wysiwyg');

  // Moved from cu_cache.
  variable_set('honeypot_element_name', 'url');
  variable_set('honeypot_form_user_pass', 0);
  variable_set('honeypot_log', 0);
  variable_set('honeypot_protect_all_forms', 1);
  variable_set('honeypot_time_limit', 0);
  $locale_custom_strings_en = array(
    'Each menu has a corresponding block that is managed on the <a href="@blocks">Blocks administration page</a>.' => 'Each menu has a corresponding block which can be placed in a content region.',
    'Set and configure the default theme for your website.  Alternative <a href="@themes">themes</a> are available.' => 'Set and configure the default theme for your website.',
    'The menu module allows on-the-fly creation of menu links in the content authoring forms. To configure these settings for a particular content type, visit the <a href="@content-types">Content types</a> page, click the <em>edit</em> link for the content type, and go to the <em>Menu settings</em> section.' => 'The menu module allows on-the-fly creation of menu links.',
  );
  variable_set('locale_custom_strings_en', $locale_custom_strings_en);

  // Update the menu router information.
  menu_rebuild();

  // revert features to ensure they are all installed

  //$features = array('files', 'cu_block_theme', 'cu_block_selector', 'cu_view_modes','cu_jquery', 'quicktab_beans');

  //features_revert($features);

  // ignore any rebuild messages
  node_access_needs_rebuild(FALSE);

  // ignore any other install messages
  drupal_get_messages();
}