You are here

function hosting_platform_node_presave in Hosting 7.4

Implements hook_node_presave()

File

platform/hosting_platform.module, line 544
Platform node type definition.

Code

function hosting_platform_node_presave($node) {

  // Generate publish path from git_root and git_docroot if it is not already set.
  if ($node->type == 'platform' && !empty($node->git_root)) {

    // If no git_docroot, just set git_root.
    if (empty($node->git_docroot)) {
      $node->publish_path = $node->git_root;
    }
    else {
      $node->publish_path = $node->git_root . DIRECTORY_SEPARATOR . $node->git_docroot;
    }
  }
}