You are here

private function GatherContentCurl::getParentPageId in GatherContent 7.2

Return option to be selected in the parent dropdown.

1 call to GatherContentCurl::getParentPageId()
GatherContentCurl::generateFormSettings in includes/curl.inc
Generate page settings for pages_import page.

File

includes/curl.inc, line 480
Contains functions used to process and retrieve data from GatherContent.

Class

GatherContentCurl
@file Contains functions used to process and retrieve data from GatherContent.

Code

private function getParentPageId($parent_id, $selected_pages, $cur_settings) {
  $new_parent_id = 0;
  if (isset($cur_settings['parent_id'])) {
    $new_parent_id = $cur_settings['parent_id'];
  }
  else {
    if ($parent_id > 0) {
      if (in_array($parent_id, $selected_pages)) {
        $new_parent_id = '_imported_page_';
      }
      else {
        $cur_settings = variable_get('gathercontent_saved_settings', array());
        if (isset($cur_settings[$this->settings['project_id']]) && isset($cur_settings[$this->settings['project_id']][$parent_id])) {
          $new_parent_id = $cur_settings[$this->settings['project_id']][$parent_id]['overwrite'];
        }
      }
    }
  }
  return $new_parent_id;
}