You are here

commons_q_a.install in Drupal Commons 7.3

File

modules/commons/commons_q_a/commons_q_a.install
View source
<?php

/**
 * Set default Q/A roles upon enable
 */
function commons_q_a_enable() {
  $revert = array(
    'commons_q_a' => array(
      'og_features_permission',
    ),
  );
  features_revert($revert);
  $groups = og_get_all_group();
  foreach ($groups as $gid) {
    commons_groups_features_permission_rebuild('commons_q_a', $gid);
  }
}

/**
 * Update the Rate module settings for changes to the Up/Down widget.
 */
function commons_q_a_update_3100() {
  $revert = array(
    'commons_like' => array(
      'variable',
    ),
  );
  features_revert($revert);
  return array();
}

/**
 * Disable comments on Question nodes. Don't feature answers by default
 * (http://drupal.org/node/1921498).
 */
function commons_q_a_update_3101() {
  $revert = array(
    'commons_q_a' => array(
      'variable',
    ),
  );
  features_revert($revert);
  return array();
}

/**
 * Disable summary on Question/Answer nodes.
 */
function commons_q_a_update_3102() {
  $revert = array(
    'commons_q_a' => array(
      'field_instance',
    ),
  );
  features_revert($revert);
  return array();
}

/**
 * Update the Commons Q&A widget per http://drupal.org/node/1940644.
 */
function commons_q_a_update_3103() {

  // The Commons Q&A widget is defined via a hook_strongarm_alter()
  // implementation altering rate_widgets variable, defined by commons_like.
  $revert = array(
    'commons_like' => array(
      'variable',
    ),
  );
  features_revert($revert);
  return array();
}

/**
 * Disable comments on Answer nodes.
 */
function commons_q_a_update_3104() {
  $revert = array(
    'commons_q_a' => array(
      'variable',
    ),
  );
  features_revert($revert);
  return array();
}

/**
 * Link the 'Answer added' activity stream message to the Answer node as
 * displayed on the question per http://drupal.org/node/1946120.
 */
function commons_q_a_update_3105() {
  $revert = array(
    'commons_q_a' => array(
      'field_instance',
      'message_type',
      'variable',
    ),
  );
  features_revert($revert);
  return array();
}

/**
 * Use the standard user picture image size.
 */
function commons_q_a_update_3106() {
  $revert = array(
    'commons_q_a' => array(
      'message_type',
    ),
  );
  features_revert($revert);
  return array();
}

/**
 * Remove the "Like" widget from answer nodes, since they have a +/- widget.
 * Related issue: https://drupal.org/node/1935312.
 */
function commons_q_a_update_3107() {
  $revert = array(
    'commons_like' => array(
      'variable',
    ),
  );
  features_revert($revert);
  return array();
}

/**
 * Standardize Browsing Widget views.
 */
function commons_q_a_update_3108() {
  $revert = array(
    'commons_q_a' => array(
      'views_view',
    ),
  );
  features_revert($revert);
  return array();
}

/**
 * Display sticky content at top of lists.
 */
function commons_q_a_update_3109() {
  $revert = array(
    'commons_q_a' => array(
      'views_view',
    ),
  );
  features_revert($revert);
  return array();
}

/**
 * Indicate in the view that empty answers text is overridden by commons_q_a.
 */
function commons_q_a_update_3110() {
  $revert = array(
    'commons_q_a' => array(
      'views_view',
    ),
  );
  features_revert($revert);
  return array();
}

/**
 * Change the Answer URL alias to be a subpath of the question.
 */
function commons_q_a_update_3111() {
  $revert = array(
    'commons_q_a' => array(
      'variable',
    ),
  );
  features_revert($revert);
  return array();
}

/**
 * Improve the browsing widget empty text.
 */
function commons_q_a_update_3112() {
  $revert = array(
    'commons_q_a' => array(
      'views_view',
    ),
  );
  features_revert($revert);
  return array();
}

/**
 * Replace the title attribute with the title field in view displays.
 */
function commons_q_a_update_3113() {
  $revert = array(
    'commons_q_a' => array(
      'views_view',
    ),
  );
  features_revert($revert);
  return array();
}

/**
 * Fix URL aliases for group references
 */
function commons_q_a_update_3114() {
  $revert = array(
    'commons_q_a' => array(
      'variable',
    ),
  );
  features_revert($revert);
  return array();
}

/**
 * Standardize browsing widget field weights.
 */
function commons_q_a_update_3115() {
  $revert = array(
    'commons_q_a' => array(
      'field_instance',
    ),
  );
  features_revert($revert);
  return array();
}

/**
 * Accommodate changes to message definitions.
 */
function commons_q_a_update_3116() {
  $revert = array(
    'commons_q_a' => array(
      'message_type',
    ),
  );
  features_revert($revert);
  return array();
}

Functions

Namesort descending Description
commons_q_a_enable Set default Q/A roles upon enable
commons_q_a_update_3100 Update the Rate module settings for changes to the Up/Down widget.
commons_q_a_update_3101 Disable comments on Question nodes. Don't feature answers by default (http://drupal.org/node/1921498).
commons_q_a_update_3102 Disable summary on Question/Answer nodes.
commons_q_a_update_3103 Update the Commons Q&A widget per http://drupal.org/node/1940644.
commons_q_a_update_3104 Disable comments on Answer nodes.
commons_q_a_update_3105 Link the 'Answer added' activity stream message to the Answer node as displayed on the question per http://drupal.org/node/1946120.
commons_q_a_update_3106 Use the standard user picture image size.
commons_q_a_update_3107 Remove the "Like" widget from answer nodes, since they have a +/- widget. Related issue: https://drupal.org/node/1935312.
commons_q_a_update_3108 Standardize Browsing Widget views.
commons_q_a_update_3109 Display sticky content at top of lists.
commons_q_a_update_3110 Indicate in the view that empty answers text is overridden by commons_q_a.
commons_q_a_update_3111 Change the Answer URL alias to be a subpath of the question.
commons_q_a_update_3112 Improve the browsing widget empty text.
commons_q_a_update_3113 Replace the title attribute with the title field in view displays.
commons_q_a_update_3114 Fix URL aliases for group references
commons_q_a_update_3115 Standardize browsing widget field weights.
commons_q_a_update_3116 Accommodate changes to message definitions.