You are here

function popup_onload_choose_popup in Popup On Load 8

Same name and namespace in other branches
  1. 7 popup_onload.module \popup_onload_choose_popup()

Load the current popup using current choose method.

Return value

object Fully loaded popup_onload entity, or NULL if no popups have been chosen.

File

./popup_onload.module, line 44
Contains main popup_onload hooks and functions.

Code

function popup_onload_choose_popup() {
  $popup_onload = NULL;
  $cur_method = PopupOnLoadSettingsForm::popupOnLoadGetDefaults(POPUP_ONLOAD_VAR_SORT_METHOD, POPUP_ONLOAD_DEFAULT_SORT_METHOD);
  $methods = popup_onload_sort_methods();
  if (isset($methods[$cur_method]) && !empty($methods[$cur_method])) {
    if (function_exists($cur_method)) {
      $popup_onload = $cur_method();
    }
  }
  return $popup_onload;
}