1 <?php |
1 <?php |
2 define('CORPUS_URL', 'corpus'); |
2 define('CORPUS_URL', 'corpus'); |
|
3 |
3 define('CORPUS_APP', 'app-client'); |
4 define('CORPUS_APP', 'app-client'); |
4 define('MODULE_NAME', 'corpus'); |
|
5 |
5 |
6 /** |
6 /** |
7 * Implements hook_menu(). |
7 * Implements hook_menu(). |
8 */ |
8 */ |
9 function corpus_menu() { |
9 function corpus_menu() { |
22 * The page callback function. Loads the Ember app |
22 * The page callback function. Loads the Ember app |
23 */ |
23 */ |
24 function corpus_page() { |
24 function corpus_page() { |
25 |
25 |
26 $app = CORPUS_APP; |
26 $app = CORPUS_APP; |
27 $path = drupal_get_path('module', MODULE_NAME) . '/' . $app; |
27 $path = drupal_get_path('module', 'corpus') . '/' . $app; |
28 |
28 |
29 $element = array( |
29 $element = array( |
30 '#tag' => 'base', // The #tag is the html tag - <link /> |
30 '#tag' => 'base', // The #tag is the html tag - <link /> |
31 '#attributes' => array( // Set up an array of attributes inside the tag |
31 '#attributes' => array( // Set up an array of attributes inside the tag |
32 'href' => '/corpus/', |
32 'href' => '/'.CORPUS_URL.'/', |
33 ), |
33 ), |
34 ); |
34 ); |
35 drupal_add_html_head($element, 'ember_init_base'); |
35 drupal_add_html_head($element, 'ember_init_base'); |
36 |
36 |
37 $element = array( |
37 $element = array( |
38 '#tag' => 'meta', // The #tag is the html tag - <link /> |
38 '#tag' => 'meta', // The #tag is the html tag - <link /> |
39 '#attributes' => array( // Set up an array of attributes inside the tag |
39 '#attributes' => array( // Set up an array of attributes inside the tag |
40 'name' => 'app-client/config/environment', |
40 'name' => 'app-client/config/environment', |
41 'content' => '%7B%22rootElement%22%3A%22%23corpus-app%22%2C%22modulePrefix%22%3A%22app-client%22%2C%22environment%22%3A%22production%22%2C%22baseURL%22%3A%22/corpus%22%2C%22locationType%22%3A%22auto%22%2C%22APP%22%3A%7B%22baseStatic%22%3A%22/'.drupal_get_path('module', MODULE_NAME).'/app-client/%22%2C%22name%22%3A%22app-client%22%2C%22version%22%3A%220.0.0+%22%7D%2C%22contentSecurityPolicyHeader%22%3A%22Content-Security-Policy-Report-Only%22%2C%22contentSecurityPolicy%22%3A%7B%22default-src%22%3A%22%27none%27%22%2C%22script-src%22%3A%22%27self%27%22%2C%22font-src%22%3A%22%27self%27%22%2C%22connect-src%22%3A%22%27self%27%22%2C%22img-src%22%3A%22%27self%27%22%2C%22style-src%22%3A%22%27self%27%22%2C%22media-src%22%3A%22%27self%27%22%7D%2C%22exportApplicationGlobal%22%3Afalse%7D' |
41 'content' => '%7B%22rootElement%22%3A%22%23corpus-app%22%2C%22modulePrefix%22%3A%22app-client%22%2C%22environment%22%3A%22production%22%2C%22baseURL%22%3A%22/corpus%22%2C%22locationType%22%3A%22auto%22%2C%22APP%22%3A%7B%22baseStatic%22%3A%22/'.drupal_get_path('module', 'corpus').'/app-client/%22%2C%22name%22%3A%22app-client%22%2C%22version%22%3A%220.0.0+%22%7D%2C%22contentSecurityPolicyHeader%22%3A%22Content-Security-Policy-Report-Only%22%2C%22contentSecurityPolicy%22%3A%7B%22default-src%22%3A%22%27none%27%22%2C%22script-src%22%3A%22%27self%27%22%2C%22font-src%22%3A%22%27self%27%22%2C%22connect-src%22%3A%22%27self%27%22%2C%22img-src%22%3A%22%27self%27%22%2C%22style-src%22%3A%22%27self%27%22%2C%22media-src%22%3A%22%27self%27%22%7D%2C%22exportApplicationGlobal%22%3Afalse%7D' |
42 ), |
42 ), |
43 ); |
43 ); |
44 |
44 |
45 drupal_add_html_head($element, 'ember_init'); |
45 drupal_add_html_head($element, 'ember_init'); |
46 |
46 |