You are here

function popup_onload_choose_popup in Popup On Load 7

Same name and namespace in other branches
  1. 8 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.

1 call to popup_onload_choose_popup()
popup_onload_init in ./popup_onload.module
Implements hook_init().

File

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

Code

function popup_onload_choose_popup() {
  $popup_onload = NULL;
  $cur_method = variable_get(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;
}