function popup_test_ajax in Popup 7
Same name and namespace in other branches
- 7.x modules/popup_test/includes/popup_test.pages.inc \popup_test_ajax()
- 6.x modules/popup_test/includes/popup_test.pages.inc \popup_test_ajax()
Popup test AJAX content page
1 string reference to 'popup_test_ajax'
- popup_test_menu in modules/
popup_test/ popup_test.module - Implementation of hook_menu
File
- modules/
popup_test/ includes/ popup_test.pages.inc, line 165
Code
function popup_test_ajax() {
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(
$firstnode > 0 ? 'Node: Some text ' . popup(array(
'node' => $firstnode,
'activate' => 'click',
'ajax' => 1,
'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',
'ajax' => 1,
)) . ' and some more text.',
$firstblock > 0 ? 'Custom block: Some text ' . popup(array(
'block' => 1,
'activate' => 'click',
'ajax' => 1,
)) . ' 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',
'ajax' => 1,
'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',
'ajax' => 1,
'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',
'ajax' => 1,
)) . ' and some more text.',
);
return implode('<br />', $content);
}