Career diagram: Move tpl code in separate tpls

In order to allow to be added in an iframe BT#18720
pull/3883/head
Julio Montoya 5 years ago
parent d9e57ba093
commit 417982b528
  1. 2
      main/admin/career_diagram.php
  2. 20
      main/template/default/career/diagram.tpl
  3. 6
      main/template/default/career/diagram_full.tpl
  4. 6
      main/template/default/career/diagram_iframe.tpl
  5. 7
      main/user/career_diagram.php

@ -107,5 +107,5 @@ if (!empty($diagram)) {
} }
$tpl->assign('content', $html); $tpl->assign('content', $html);
$layout = $tpl->get_template('career/diagram.tpl'); $layout = $tpl->get_template('career/diagram_full.tpl');
$tpl->display($layout); $tpl->display($layout);

@ -1,16 +1,13 @@
{% extends 'layout/layout_1_col.tpl'|get_template %} <script>
{% block content %}
<script>
mxBasePath = '{{ _p.web_lib }}mxgraph/src/'; mxBasePath = '{{ _p.web_lib }}mxgraph/src/';
</script> </script>
<style> <style>
#graphContainer svg { #graphContainer svg {
min-width: 100% !important; min-width: 100% !important;
} }
</style> </style>
<script type="text/javascript" src="{{ _p.web_lib }}mxgraph/src/js/mxClient.js"></script> <script type="text/javascript" src="{{ _p.web_lib }}mxgraph/src/js/mxClient.js"></script>
<script> <script>
// Overridden to define per-shape connection points // Overridden to define per-shape connection points
mxGraph.prototype.getAllConnectionConstraints = function(terminal, source) { mxGraph.prototype.getAllConnectionConstraints = function(terminal, source) {
if (terminal != null && terminal.shape != null) { if (terminal != null && terminal.shape != null) {
@ -160,6 +157,5 @@
} }
}); });
}); });
</script> </script>
{{ content }} {{ content }}
{% endblock %}

@ -0,0 +1,6 @@
{% extends 'layout/layout_1_col.tpl'|get_template %}
{% block content %}
{% include 'diagram.tpl'%}
{{ content }}
{% endblock %}

@ -0,0 +1,6 @@
{% extends 'layout/blank_no_header.tpl'|get_template %}
{% block body %}
{% include 'diagram.tpl'%}
{{ content }}
{% endblock %}

@ -97,5 +97,10 @@ if (!empty($diagram)) {
} }
$tpl->assign('content', $html); $tpl->assign('content', $html);
$layout = $tpl->get_template('career/diagram.tpl'); if ($showFullPage) {
$layout = $tpl->get_template('career/diagram_full.tpl');
} else {
$layout = $tpl->get_template('career/diagram_iframe.tpl');
}
$tpl->display($layout); $tpl->display($layout);

Loading…
Cancel
Save