You are here

hosting_platform_composer.module in Aegir Deploy 7.3

Drupal hooks for the hosting_platform_composer module.

File

modules/platform_composer/hosting_platform_composer.module
View source
<?php

/**
 * @file
 * Drupal hooks for the hosting_platform_composer module.
 */
function hosting_platform_composer_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'platform_node_form') {
    $platform_node_form = new HostingPlatformComposerForm($form, $form_state);
    $platform_node_form
      ->alter();
  }
}

/**
 * Implements hook_node_insert().
 */
function hosting_platform_composer_node_insert($node) {
  if ($node->type == 'platform') {
    $platform = new HostingPlatformComposerNode($node);
    $platform
      ->nodeInsert();
  }
}

/**
 * Submit callback for the platform node form.
 */
function hosting_platform_composer_platform_submit($form, &$form_state) {
  $platform_node_form = new HostingPlatformComposerForm($form, $form_state);
  $platform_node_form
    ->submit();
}

/**
 * Implements hook_node_view().
 */
function hosting_platform_composer_node_view($node, $view_mode, $langcode) {
  if ($node->type == 'platform') {
    $platform = new HostingPlatformComposerNode($node);
    $platform
      ->nodeView();
  }
}

/**
 * Implements hook_platform_deploy_strategies().
 */
function hosting_platform_composer_platform_deploy_strategies() {
  return [
    'platform_composer' => [
      'label' => t('Deploy a Composer project from a Packagist repository'),
      'required_fields' => [
        'field_composer_project_package',
      ],
    ],
  ];
}

Functions

Namesort descending Description
hosting_platform_composer_form_alter @file Drupal hooks for the hosting_platform_composer module.
hosting_platform_composer_node_insert Implements hook_node_insert().
hosting_platform_composer_node_view Implements hook_node_view().
hosting_platform_composer_platform_deploy_strategies Implements hook_platform_deploy_strategies().
hosting_platform_composer_platform_submit Submit callback for the platform node form.