@@ -17,29 +17,29 @@ |
||
| 17 | 17 | |
| 18 | 18 | /* prepare the toolbox */ |
| 19 | 19 | if (empty($_SESSION[Toolbox::class])) { |
| 20 | - $_SESSION[Toolbox::class] =& Toolbox::fromConfiguration(CONFIG_FILE); |
|
| 20 | + $_SESSION[Toolbox::class] =& Toolbox::fromConfiguration(CONFIG_FILE); |
|
| 21 | 21 | } |
| 22 | 22 | $toolbox =& $_SESSION[Toolbox::class]; |
| 23 | 23 | if (php_sapi_name() !== 'cli') { |
| 24 | - $toolbox->smarty_prependTemplateDir(__DIR__ . '/templates', basename(__DIR__)); |
|
| 25 | - $toolbox->smarty_assign([ |
|
| 26 | - 'category' => DataUtilities::titleCase(preg_replace('/[\-_]+/', ' ', basename(__DIR__))) |
|
| 27 | - ]); |
|
| 28 | - $smarty =& $toolbox->getSmarty(); |
|
| 24 | + $toolbox->smarty_prependTemplateDir(__DIR__ . '/templates', basename(__DIR__)); |
|
| 25 | + $toolbox->smarty_assign([ |
|
| 26 | + 'category' => DataUtilities::titleCase(preg_replace('/[\-_]+/', ' ', basename(__DIR__))) |
|
| 27 | + ]); |
|
| 28 | + $smarty =& $toolbox->getSmarty(); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /* set the Tool Consumer's instance URL, if present */ |
| 32 | 32 | if (empty($_SESSION[CANVAS_INSTANCE_URL])) { |
| 33 | - if (!empty($requestApiDomain)) { |
|
| 34 | - $_SESSION[CANVAS_INSTANCE_URL] = "https://{$requestApiDomain}"; |
|
| 35 | - } elseif (!empty($_SESSION[ToolProvider::class]['canvas']['api_domain'])) { |
|
| 36 | - $_SESSION[CANVAS_INSTANCE_URL] = 'https://' . $_SESSION[ToolProvider::class]['canvas']['api_domain']; |
|
| 37 | - } else { |
|
| 38 | - $_SESSION[CANVAS_INSTANCE_URL] = $httpReferer; |
|
| 39 | - |
|
| 40 | - /* FIXME hack to trick the Toolbox into using the right API domain */ |
|
| 41 | - $_SESSION[ToolProvider::class]['canvas']['api_domain'] = parse_url($httpReferer, PHP_URL_HOST); |
|
| 42 | - } |
|
| 33 | + if (!empty($requestApiDomain)) { |
|
| 34 | + $_SESSION[CANVAS_INSTANCE_URL] = "https://{$requestApiDomain}"; |
|
| 35 | + } elseif (!empty($_SESSION[ToolProvider::class]['canvas']['api_domain'])) { |
|
| 36 | + $_SESSION[CANVAS_INSTANCE_URL] = 'https://' . $_SESSION[ToolProvider::class]['canvas']['api_domain']; |
|
| 37 | + } else { |
|
| 38 | + $_SESSION[CANVAS_INSTANCE_URL] = $httpReferer; |
|
| 39 | + |
|
| 40 | + /* FIXME hack to trick the Toolbox into using the right API domain */ |
|
| 41 | + $_SESSION[ToolProvider::class]['canvas']['api_domain'] = parse_url($httpReferer, PHP_URL_HOST); |
|
| 42 | + } |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* |