You are here

public function GatherContentCurl::parentDropdown in GatherContent 7.2

Return dropdown for parent page list.

File

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

Class

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

Code

public function parentDropdown() {
  $html = '<li>
      <a href="#" data-value="0">' . t('No Menu Link') . '</a>
    </li>
    <li class="imported-page">
      <a href="#" data-value="_imported_page_">' . t('Parent Being Imported') . '</a>
    </li>
    <li class="divider"></li>';
  $types = array_keys($this->hierarchical);
  foreach ($types as $type) {
    $options = menu_parent_options(menu_get_menus(), $type, $type);
    foreach ($options as $id => $page_name) {
      $html .= '
    <li data-post-type="' . $type . '">
      <a href="#" data-value="' . $id . '">' . check_plain($page_name) . '</a>
    </li>';
    }
  }
  $this->data['parent_select'] = $html;
}