Project

General

Profile

« Previous | Next » 

Revision beb914ef

Added by Andreas Kohlbecker over 6 years ago

fix #5943 back to search button/link moved to drupal block

View differences:

modules/cdm_dataportal/profile/CDM_Portal/CDM_Portal.install
45 45
  // After the standard_install() the dataportal
46 46
  // customization can be applied
47 47

  
48
  include_once DRUPAL_ROOT . '/profiles/standard/standard.install';
48
  require_once DRUPAL_ROOT . '/profiles/standard/standard.install';
49 49
  standard_install();
50 50

  
51 51
  // >>> admin/appearance/settings
......
260 260
  )
261 261
  ->execute();
262 262

  
263
  $new_blocks = array(
264
      // enable "CDM Search Taxa" block for all themes
265
      array(
266
          'block' => array(
267
              'module' => 'cdm_dataportal',
268
              'delta' => '2',
269
              'theme' => $default_theme,
270
              'status' => 1,
271
              'weight' => -11,
272
              'region' => 'sidebar_first',
273
              'pages' => '',
274
              'cache' => -1,
275
          )
276
      ),
277
      // CDM web service debug block
278
      array(
279
          'block' => array(
280
              'module' => 'cdm_api',
281
              'delta' => 'cdm_ws_debug',
282
              'theme' => $default_theme,
283
              'status' => 1,
284
              'weight' => -50,
285
              'region' => 'sidebar_first',
286
              'pages' => '',
287
              'cache' => -1,
288
          ),
289
          'block_role' => array(
290
              'module' => 'cdm_api',
291
              'delta' => 'cdm_ws_debug',
292
              'rid' => $admin_role->rid
293
          )
263
  $new_blocks = array();
264

  
265
;
266
  // enable "CDM Search Taxa" block for all themes
267
  $block_search_taxa = cdm_dataportal_block_info()["2"];
268
  $block_search_taxa= array_merge($block_search_taxa, array(
269
    'module' => 'cdm_dataportal',
270
    'delta' => '2',
271
    'theme' => $default_theme,
272
    'status' => 1,
273
    'weight' => -11,
274
    'region' => 'sidebar_first',
275
    'pages' => '',
276
  ));
277
  $new_blocks[] = array(
278
      'block' => $block_search_taxa
279
  );
280

  
281
  $block_back_to_search_results = cdm_dataportal_block_info()["back_to_search_results"];
282
  $block_back_to_search_results= array_merge($block_back_to_search_results, array(
283
    'module' => 'cdm_dataportal',
284
    'delta' => 'back_to_search_results',
285
    'theme' => $default_theme,
286
    'status' => 1,
287
    'weight' => 10,
288
    'region' => 'navigation'
289
  ));
290
  $new_blocks[] = array(
291
    'block' => $block_back_to_search_results
292
  );
293

  
294
  // CDM web service debug block
295
  $block_cdm_ws_debug = cdm_api_block_info()['cdm_ws_debug'];
296
  $block_cdm_ws_debug= array_merge($block_cdm_ws_debug, array(
297
    'module' => 'cdm_api',
298
    'delta' => 'cdm_ws_debug',
299
    'theme' => $default_theme,
300
    'status' => 1,
301
    'weight' => -50,
302
    'region' => 'sidebar_first',
303
    'pages' => '',
304
  ));
305

  
306
  $new_blocks[] = array(
307
      'block' => $block_cdm_ws_debug,
308
      'block_role' => array(
309
          'module' => 'cdm_api',
310
          'delta' => 'cdm_ws_debug',
311
          'rid' => $admin_role->rid
294 312
      )
295 313
  );
314

  
315
  // TODO consider using block_flush_caches() to initially populate the block table with blocks from contributed
316
  //      modules, and only update the blocks afterwards with block_save()?
296 317
  $block_insert = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
297 318
  $block_role_insert = db_insert('block_role')->fields(array('module', 'delta', 'rid'));
298 319
  foreach ($new_blocks as $block) {

Also available in: Unified diff