define variable with app name refered later. Make it easier to change the name module later
authornowmad@23.1.168.192.in-addr.arpa
Fri, 06 Nov 2015 17:23:26 +0100
changeset 11 9e5799ff8538
parent 10 585ec02908b6
child 12 cb28c4bda940
define variable with app name refered later. Make it easier to change the name module later
cms/corpus_module/corpus.module
--- a/cms/corpus_module/corpus.module	Fri Nov 06 17:02:08 2015 +0100
+++ b/cms/corpus_module/corpus.module	Fri Nov 06 17:23:26 2015 +0100
@@ -1,6 +1,7 @@
 <?php
 define('CORPUS_URL', 'corpus');
 define('CORPUS_APP', 'app-client');
+define('MODULE_NAME', 'corpus');
 
 /**
  * Implements hook_menu().
@@ -23,7 +24,7 @@
 function corpus_page() {
 
  $app = CORPUS_APP;
- $path = drupal_get_path('module', 'corpus') . '/' . $app;
+ $path = drupal_get_path('module', MODULE_NAME) . '/' . $app;
 
  $element = array(
    '#tag' => 'base', // The #tag is the html tag - <link />
@@ -37,7 +38,7 @@
    '#tag' => 'meta', // The #tag is the html tag - <link />
    '#attributes' => array( // Set up an array of attributes inside the tag
      'name' => 'app-client/config/environment',
-     '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'
+     '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'
    ),
  );