$t('PHP Max Execution Time'), 'value' => ini_get('max_execution_time'), ); $max_execution_time = (int)ini_get('max_execution_time'); // Don't set the error when max_execution_time is 0 (Infinite). if ($max_execution_time && $max_execution_time < DRUPAL_MINIMUM_MAX_EXECUTION_TIME) { $requirements['php_max_execution_time']['description'] = $t('Your PHP execution time is too low, please set it greater than or equal to %time seconds.', array('%time' => DRUPAL_MINIMUM_MAX_EXECUTION_TIME)); $requirements['php_max_execution_time']['severity'] = REQUIREMENT_ERROR; } } return $requirements; } /** * Implements hook_install(). * * Perform actions to set up the site for this profile. * * @see system_install() */ function groups_install() { // Enable the Origins theme and set it as the default. theme_enable(array('adaptivetheme', 'commons_origins', 'adaptivetheme_admin', 'openstack')); // The Bartik theme is automatically enabled during installation. Disable it. db_update('system') ->fields(array('status' => 0)) ->condition('type', 'theme') ->condition('name', 'bartik') ->execute(); // Set the default and administration themes. variable_set('theme_default', 'openstack'); // Set a default administrative theme: variable_set('admin_theme', 'adaptivetheme_admin'); variable_set('node_admin_theme', FALSE); // Do not use the administration theme when editing or creating content. variable_set('node_admin_theme', '0'); // Set a default user avatar. groups_set_default_avatar(); // Create openstack.org menu item $item = array( 'link_title' => st('OpenStack.org'), 'link_path' => 'http://openstack.org', 'menu_name' => 'main-menu', 'weight' => -5, ); menu_link_save($item); $search_block = array( 'module' => 'search', 'delta' => 'form', 'theme' => 'openstack', 'visibility' => 0, 'region' => 'header', 'status' => 1, 'pages' => '', 'weight' => 2, 'title' => '', ); drupal_write_record('block', $search_block); // Create a default role for site administrators, with all available permissions assigned. // $admin_role = new stdClass(); // $admin_role->name = 'administrator'; // $admin_role->weight = 2; // user_role_save($admin_role); // Set this as the administrator role. variable_set('user_admin_role', $admin_role->rid); // Assign user 1 the "administrator" role. // db_insert('users_roles') // ->fields(array('uid' => 1, 'rid' => $admin_role->rid)) // ->execute(); // AdaptiveTheme requires that the system theme settings form // be submitted in order for its themes' settings to be properly set // and the resulting css files generated. // For more background, see http://drupal.org/node/1776730. module_load_include('inc', 'system', 'system.admin'); foreach (array('adaptivetheme', 'commons_origins') as $theme_name) { $form_state = form_state_defaults(); $form_state['build_info']['args'][0] = $theme_name; $form_state['values'] = array(); drupal_form_submit('system_theme_settings', $form_state); } // add markdown filter format _groups_add_markdown_filter(); } /** * Enable markdown module if it is not already enabled. */ function groups_update_7100() { module_enable(array('markdown')); if (!module_exists('markdown')) { throw new DrupalUpdateException('The Markdown module must be downloaded and available for groups updates to proceed.'); } _groups_add_markdown_filter(); } /** * Enable feeds_jsonpath_parser module if it is not already enabled. */ function groups_update_7101() { module_enable(array('feeds_jsonpath_parser')); } /** * Enable groups_events_pages module if it is not already enabled. */ function groups_update_7102() { module_enable(array('groups_events_pages')); } /** * Add markdown filter with permissions. */ function _groups_add_markdown_filter() { // add markdown format filter $markdown_format = array( 'format' => 'markdown', 'name' => 'Markdown', 'weight' => 1, 'filters' => array( // Markdown filter. 'filter_markdown' => array( 'weight' => 0, 'status' => 1, 'settings' => array(), ), // URL filter. 'filter_url' => array( 'weight' => 0, 'status' => 1, ), ), ); $markdown_format = (object) $markdown_format; filter_format_save($markdown_format); // assign default permissions to filter if ($roles = user_roles(FALSE)) { $permissions = array('use text format markdown'); foreach ($roles as $rid => $name) { $module = 'filter'; foreach ($permissions as $name) { db_merge('role_permission')->key(array( 'rid' => $rid, 'permission' => $name, ))->fields(array( 'module' => $module, ))->execute(); } } } }