11<?php
22
3- use yii \helpers \Html ;
43use yii \helpers \Url ;
4+ use yii \helpers \Html ;
5+ use humhub \modules \codebox \components \HtmlParser ;
56
67/* @var $this yii\web\View */
7- /* @var $model app \models\ConfigureForm */
8+ /* @var $model \humhub\modules\codebox \models\ConfigureForm */
89
910// Generate unique IDs for panel menu and panel content
1011$ panelMenuId = 'panel-menu- ' . $ model ->id ;
1617
1718 $('#panel-heading- $ model ->id ').hover(
1819 function() {
19- clearTimeout(timer); // Clear the collapse timer
20+ clearTimeout(timer);
2021 $('#panel-content- $ model ->id ').collapse('show');
2122 },
2223 function() {
2324 timer = setTimeout(function() {
2425 $('#panel-content- $ model ->id ').collapse('hide');
25- }, 500); // Adjust the delay time as needed (in milliseconds)
26+ }, 500);
2627 }
2728 );
2829
2930 // Keep the panel content open when hovering over it
3031 $('#panel-content- $ model ->id ').hover(
3132 function() {
32- clearTimeout(timer); // Clear the collapse timer
33+ clearTimeout(timer);
3334 },
3435 function() {
3536 timer = setTimeout(function() {
3637 $('#panel-content- $ model ->id ').collapse('hide');
37- }, 500); // Adjust the delay time as needed (in milliseconds)
38+ }, 500);
3839 }
3940 );
4041});
4142JS ;
4243$ this ->registerJs ($ js );
4344
45+ // Instantiate HtmlParser and render the HTML code
46+ $ htmlParser = new HtmlParser ($ model ->htmlCode );
47+ $ renderedHtml = $ htmlParser ->render ();
48+
4449?>
4550<div class="col-md-6">
4651 <div class="panel panel-default">
4752 <div class="panel-heading" id="panel-heading-<?= $ model ->id ?> ">
4853 <?= Html::encode ($ model ->title ) ?>
4954 </div>
5055 <div class="panel-body collapse" id="<?= $ panelContentId ?> ">
51- <?= Html:: encode ( $ model -> htmlCode ) ?>
56+ <?= $ renderedHtml ?>
5257 <br>
5358 <div class="form-group">
5459 <?= Html::a (Yii::t ('CodeboxModule.base ' , 'Update ' ), ['update ' , 'id ' => $ model ->id ], ['class ' => 'btn btn-primary btn-sm ' , 'data-toggle ' => 'modal ' , 'data-target ' => '#globalModal ' ]); ?>
@@ -60,4 +65,4 @@ function() {
6065 </div>
6166 </div>
6267 </div>
63- </div>
68+ </div>
0 commit comments