mirror of https://github.com/MISP/MISP
Merge branch 'feature/assetloader' into 2.4
commit
13fb91a101
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
if (!empty($css)) {
|
||||
if (!is_array($css) || !isset($css[0])) {
|
||||
$css = array($css);
|
||||
}
|
||||
foreach ($css as $item) {
|
||||
if (is_array($item)) {
|
||||
$path = $item[0];
|
||||
$options = empty($item[1]) ? array() : $item[1];
|
||||
} else {
|
||||
$path = $item;
|
||||
$options = array();
|
||||
}
|
||||
if (!empty($me)) {
|
||||
$path .= '.css?' . $queryVersion;
|
||||
}
|
||||
echo $this->Html->css($path, $options);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($js)) {
|
||||
if (!is_array($js) || !isset($js[0])) {
|
||||
$js = array($js);
|
||||
}
|
||||
foreach ($js as $item) {
|
||||
if (is_array($item)) {
|
||||
$path = $item[0];
|
||||
$options = empty($item[1]) ? array() : $item[1];
|
||||
} else {
|
||||
$path = $item;
|
||||
$options = array();
|
||||
}
|
||||
if (!empty($me)) {
|
||||
$path .= '.js?' . $queryVersion;
|
||||
}
|
||||
echo $this->Html->script($path, $options);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($meta)) {
|
||||
if (!is_array($meta) || !isset($meta[0])) {
|
||||
$meta = array($meta);
|
||||
}
|
||||
foreach ($meta as $item) {
|
||||
if (is_array($item)) {
|
||||
$type = $item[0];
|
||||
$url = empty($item[1]) ? null : $item[1];
|
||||
$options = empty($item[2]) ? array() : $item[2];
|
||||
} else {
|
||||
$type = $item;
|
||||
$url = null;
|
||||
$options = array();
|
||||
}
|
||||
echo $this->Html->meta($type, $url, $options);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -8,30 +8,32 @@
|
|||
<?php echo $title_for_layout, ' - '. h(Configure::read('MISP.title_text') ? Configure::read('MISP.title_text') : 'MISP'); ?>
|
||||
</title>
|
||||
<?php
|
||||
echo $this->Html->meta('icon');
|
||||
echo $this->Html->css('bootstrap');
|
||||
//echo $this->Html->css('bootstrap4');
|
||||
echo $this->Html->css('bootstrap-datepicker');
|
||||
echo $this->Html->css('bootstrap-timepicker');
|
||||
echo $this->Html->css('bootstrap-colorpicker');
|
||||
echo $this->Html->css('famfamfam-flags');
|
||||
echo $this->Html->css('font-awesome');
|
||||
if ($me) {
|
||||
echo $this->Html->css('main.css?' . $queryVersion);
|
||||
} else {
|
||||
echo $this->Html->css('main');
|
||||
}
|
||||
$css_collection = array(
|
||||
'bootstrap',
|
||||
//'bootstrap4',
|
||||
'bootstrap-datepicker',
|
||||
'bootstrap-colorpicker',
|
||||
'famfamfam-flags',
|
||||
'font-awesome',
|
||||
'jquery-ui',
|
||||
'chosen.min',
|
||||
'main',
|
||||
array('print', array('media' => 'print'))
|
||||
);
|
||||
if (Configure::read('MISP.custom_css')) {
|
||||
$css = preg_replace('/\.css$/i', '', Configure::read('MISP.custom_css'));
|
||||
echo $this->Html->css($css);
|
||||
$css_collection[] = preg_replace('/\.css$/i', '', Configure::read('MISP.custom_css'));
|
||||
}
|
||||
echo $this->Html->css('print', 'stylesheet', array('media' => 'print'));
|
||||
echo $this->Html->css('jquery-ui');
|
||||
echo $this->Html->script('jquery'); // Include jQuery library
|
||||
echo $this->Html->script('misp-touch'); // touch interface support
|
||||
echo $this->Html->script('jquery-ui'); // UI support
|
||||
echo $this->Html->css('chosen.min');
|
||||
echo $this->Html->script('chosen.jquery.min');
|
||||
$js_collection = array(
|
||||
'jquery',
|
||||
'misp-touch',
|
||||
'jquery-ui',
|
||||
'chosen.jquery.min'
|
||||
);
|
||||
echo $this->element('genericElements/assetLoader', array(
|
||||
'css' => $css_collection,
|
||||
'js' => $js_collection,
|
||||
'meta' => 'icon'
|
||||
));
|
||||
?>
|
||||
|
||||
</head>
|
||||
|
@ -53,8 +55,7 @@
|
|||
<div id="flashContainer" style="padding-top:<?php echo $topPadding; ?>px; !important;">
|
||||
<div id="main-view-container" class="container-fluid ">
|
||||
<?php
|
||||
$flash = $this->Flash->render();
|
||||
echo $flash;
|
||||
echo $this->Flash->render();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -64,17 +65,18 @@
|
|||
?>
|
||||
</div>
|
||||
<?php
|
||||
echo $this->element('genericElements/assetLoader', array(
|
||||
'js' => array(
|
||||
'bootstrap',
|
||||
'bootstrap-timepicker',
|
||||
'bootstrap-datepicker',
|
||||
'bootstrap-colorpicker',
|
||||
'misp',
|
||||
'keyboard-shortcuts'
|
||||
)
|
||||
));
|
||||
echo $this->element('footer');
|
||||
echo $this->element('sql_dump');
|
||||
echo $this->Html->script('bootstrap');
|
||||
//echo $this->Html->script('bootstrap4');
|
||||
echo $this->Html->script('bootstrap-timepicker');
|
||||
echo $this->Html->script('bootstrap-datepicker');
|
||||
echo $this->Html->script('bootstrap-colorpicker');
|
||||
if ($me) {
|
||||
echo $this->Html->script('misp.js?' . $queryVersion);
|
||||
echo $this->Html->script('keyboard-shortcuts.js?' . $queryVersion);
|
||||
}
|
||||
?>
|
||||
<div id = "ajax_success_container" class="ajax_container">
|
||||
<div id="ajax_success" class="ajax_result ajax_success"></div>
|
||||
|
@ -86,7 +88,6 @@
|
|||
<div class="spinner"></div>
|
||||
<div class="loadingText"><?php echo __('Loading');?></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
<?php
|
||||
if (!isset($debugMode)):
|
||||
|
@ -121,7 +122,6 @@
|
|||
endif;
|
||||
?>
|
||||
if ($('.alert').text().indexOf("$flashErrorMessage") >= 0) {
|
||||
//$('#flashErrorMessage').html()
|
||||
var flashMessageLink = '<span class="useCursorPointer underline bold" onClick="flashErrorPopover();">here</span>';
|
||||
$('.alert').html(($('.alert').html().replace("$flashErrorMessage", flashMessageLink)));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue