You are here

hosting_platform_git.module in Aegir Deploy 7.3

Drupal hooks for the hosting_platform_git module.

File

modules/platform_git/hosting_platform_git.module
View source
<?php

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

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

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

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

/**
 * Implements hook_platform_deploy_strategies().
 */
function hosting_platform_git_platform_deploy_strategies() {
  return [
    'platform_git' => [
      'label' => t('Deploy from Git repository (not managed by Composer)'),
      'required_fields' => [
        'field_git_repository_url',
      ],
    ],
  ];
}

Functions

Namesort descending Description
hosting_platform_git_form_alter @file Drupal hooks for the hosting_platform_git module.
hosting_platform_git_node_insert Implements hook_node_insert().
hosting_platform_git_node_view Implements hook_node_view().
hosting_platform_git_platform_deploy_strategies Implements hook_platform_deploy_strategies().
hosting_platform_git_platform_submit Submit callback for the platform node form.