Click2Dial-Funktion auf InfocenterDetails

Addon-JS injection FHC-Header
This commit is contained in:
Gerald Raab
2018-03-01 17:16:13 +01:00
parent a2864eb47a
commit 67dbca5be3
3 changed files with 37 additions and 1 deletions
+1
View File
@@ -10,6 +10,7 @@
'tablesorter' => true,
'tinymce' => true,
'sbadmintemplate' => true,
'addons' => true,
'customCSSs' =>
array(
'skin/admintemplate.css',
+3 -1
View File
@@ -58,6 +58,7 @@
<tr>
<td><?php echo ucfirst($kontakt->kontakttyp); ?></td>
<td>
<?php echo '<span class="'.$kontakt->kontakttyp.'">';?>
<?php if ($kontakt->kontakttyp === 'email'): ?>
<a href="mailto:<?php echo $kontakt->kontakt; ?>" target="_top">
<?php
@@ -67,6 +68,7 @@
?>
</a>
<?php endif; ?>
<?php echo '</span>'?>
</td>
<td><?php echo $kontakt->anmerkung; ?></td>
</tr>
@@ -106,4 +108,4 @@
<?php endif; ?>
</div>
</div>
</div>
</div>
+33
View File
@@ -15,6 +15,7 @@ $fontawesome = isset($fontawesome) ? $fontawesome : false;
$tablesorter = isset($tablesorter) ? $tablesorter : false;
$tinymce = isset($tinymce) ? $tinymce : false;
$sbadmintemplate = isset($sbadmintemplate) ? $sbadmintemplate : false;
$addons = isset($addons) ? $addons : false;
/**
* Print the given title of the page
@@ -76,6 +77,16 @@ function _generateJSsInclude($JSs)
}
}
/**
* Generates global JS-Object to pass parms to addon-js-functions
*/
function _generateAddonDataStorageObject()
{
echo '<script type="text/javascript">';
echo 'var FHC_ADDON_DATA_STORAGE_OBJECT = {app_root:"'.APP_ROOT.'"};';
echo "</script>\n";
}
?>
<!-- Header start -->
<!DOCTYPE HTML>
@@ -142,6 +153,28 @@ function _generateJSsInclude($JSs)
_generateJSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/dist/js/sb-admin-2.min.js');
}
// load addon hooks JS
if ($addons === true)
{
_generateAddonDataStorageObject();
$aktive_addons = array_filter(explode(";", ACTIVE_ADDONS));
$called_from = $this->router->directory.$this->router->class.'/'.$this->router->method;
foreach ($aktive_addons as $addon)
{
$hookfile = DOC_ROOT.'addons/'.$addon.'/hooks.config.inc.php';
if (file_exists($hookfile))
{
include($hookfile);
if (key_exists($called_from, $js_hooks))
{
foreach ($js_hooks[$called_from] as $js_file)
_generateJSsInclude('addons/'.$addon.'/'.$js_file);
}
}
}
}
// Eventually required JS
_generateJSsInclude($customJSs);
?>