You are here

function popup_test_content in Popup 7

Same name and namespace in other branches
  1. 7.x modules/popup_test/includes/popup_test.pages.inc \popup_test_content()
  2. 6.x modules/popup_test/includes/popup_test.pages.inc \popup_test_content()

Popup test content page

1 string reference to 'popup_test_content'
popup_test_menu in modules/popup_test/popup_test.module
Implementation of hook_menu

File

modules/popup_test/includes/popup_test.pages.inc, line 123

Code

function popup_test_content() {
  module_load_include('inc', 'popup', 'includes/popup.api');
  $firstnode = db_query("SELECT nid FROM {node} LIMIT 1")
    ->fetchField();
  $firstblock = db_query("SELECT bid FROM {block_custom} LIMIT 1")
    ->fetchField();
  $content = array(
    'Text: Some text ' . popup(array(
      'text' => 'This is popup text',
      'activate' => 'click',
    )) . ' and some more text.',
    $firstnode > 0 ? 'Node: Some text ' . popup(array(
      'node' => $firstnode,
      'activate' => 'click',
      'width' => 450,
    )) . ' and some more text.' : '[No nodes have been loaded, skipping node test]',
    'Module block: Some text ' . popup(array(
      'block' => TRUE,
      'module' => 'user',
      'delta' => 'online',
      'activate' => 'click',
    )) . ' and some more text.',
    $firstblock > 0 ? 'Custom block: Some text ' . popup(array(
      'block' => 1,
      'activate' => 'click',
    )) . ' and some more text.' : '[No custom blocks loaded, skipping custom block test]',
    module_exists('search') ? 'Form: Some text ' . popup(array(
      'form' => 'search_form',
      'activate' => 'click',
      'width' => 350,
    )) . ' and some more text.' : '[Search module not enabled, skipping form test.]',
    module_exists('views') ? 'View: Some text ' . popup(array(
      'view' => 'frontpage',
      'activate' => 'click',
      'width' => 500,
    )) . ' and some more text.' : '[Views module not enabled, skipping view test.]',
    'PHP: Some text ' . popup(array(
      'php' => 'return "Some php generated text: ' . date('d-M-Y', time()) . ' ";',
      'activate' => 'click',
    )) . ' and some more text.',
    'Menu: Some text ' . popup(array(
      'menu' => 'management',
      'origin' => 'top-right',
      'expand' => 'bottom-right',
    )) . ' and some more text.',
  );
  return implode('<br />', $content);
}