Project

General

Profile

Paste
Download (1021 Bytes) Statistics
| Branch: | Revision:

root / drupal7 / sites / all / modules / addthis / addthis_test / addthis_test.module @ 2c8c2b87

1
<?php
2
/**
3
 * Implements hook_page_build().
4
 */
5
function addthis_test_page_build(&$page) {
6

    
7
  // See AddThisTestHelper.php.page.inc for more info.
8
  if (current_path() == 'addthis/test/2') {
9
    $manager = AddThisScriptManager::getInstance();
10
    $manager->attachJsToElement($page['content']);
11
  }
12
}
13

    
14
/**
15
 * Implements hook_menu().
16
 */
17
function addthis_test_menu() {
18
  // Test pages.
19
  // Pages used in the test cases.
20
  $menu_items['addthis/test/1'] = array(
21
    'title' => 'Test no Javascript load',
22
    'type' => MENU_CALLBACK,
23
    'page callback' => 'addthis_test_no_js',
24
    'access arguments' => array(AddThis::PERMISSION_ADMINISTER_ADDTHIS),
25
    'file' => 'includes/addthis.test_pages.inc'
26
  );
27
  $menu_items['addthis/test/2'] = array(
28
    'title' => 'Test Javascript load on preprocess',
29
    'type' => MENU_CALLBACK,
30
    'page callback' => 'addthis_test_with_js',
31
    'access arguments' => array(AddThis::PERMISSION_ADMINISTER_ADDTHIS),
32
    'file' => 'includes/addthis.test_pages.inc'
33
  );
34
  return $menu_items;
35
}