Skip to content

Commit

Permalink
link to #2711
Browse files Browse the repository at this point in the history
  • Loading branch information
zoic21 authored Jun 24, 2024
1 parent 1fa6f11 commit dd0c84b
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 4 deletions.
7 changes: 5 additions & 2 deletions core/class/plugin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class plugin {
private $documentation_beta = '';
private $source = '';
private $whiteListFolders = array();
private $specialAttributes = array('object' => array(), 'user' => array());
private $specialAttributes = array('object' => array(), 'user' => array(), 'eqLogic' => array());
private $info = array();
private $include = array();
private $functionality = array();
Expand Down Expand Up @@ -112,9 +112,12 @@ public static function byId($_id,$_full = false) {
if (isset($data['specialAttributes']['object'])) {
$plugin->specialAttributes['object'] = $data['specialAttributes']['object'];
}
if (isset($data['specialAttributes']['user'])) {
if (isset($data['specialAttributes']['eqLogic'])) {
$plugin->specialAttributes['user'] = $data['specialAttributes']['user'];
}
if (isset($data['specialAttributes']['eqLogic'])) {
$plugin->specialAttributes['eqLogic'] = $data['specialAttributes']['eqLogic'];
}
}
$plugin->mobile = '';
if (file_exists(__DIR__ . '/../../plugins/' . $data['id'] . '/mobile/html')) {
Expand Down
46 changes: 44 additions & 2 deletions desktop/modal/eqLogic.configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
}
?>
<li role="presentation"><a href="#eqLogic_alert" aria-controls="messages" role="tab" data-toggle="tab"><i class="fas fa-exclamation-triangle"></i> {{Alertes}}</a></li>
<li role="presentation"><a href="#eqLogic_specialAttributesPlugin" aria-controls="messages" role="tab" data-toggle="tab"><i class="fa-solid fa-gears"></i> {{Informations complémentaires}}</a></li>
</ul>

<div class="tab-content" id="div_displayEqLogicConfigure">
Expand Down Expand Up @@ -334,8 +335,7 @@
</div>
<?php } ?>

<?php if ($eqLogic->widgetPossibility('custom::layout')) {
?>
<?php if ($eqLogic->widgetPossibility('custom::layout')) { ?>
<div role="tabpanel" class="tab-pane" id="eqLogic_layout">
<form class="form-horizontal">
<legend><i class="fas fa-table"></i> {{Mise en forme générale}}</legend>
Expand Down Expand Up @@ -468,6 +468,48 @@
</form>
</div>

<div role="tabpanel" class="tab-pane" id="eqLogic_specialAttributesPlugin">
<form class="form-horizontal">
<?php
try {
$plugins = plugin::listPlugin(true);
foreach ($plugins as $plugin) {
$specialAttributes = $plugin->getSpecialAttributes();
if (!isset($specialAttributes['eqLogic']) || !is_array($specialAttributes['eqLogic']) || count($specialAttributes['eqLogic']) == 0) {
continue;
}
$spAttr = '<legend><i class="fas fa-users-cog"></i> {{Informations complémentaires demandées par}} ' . $plugin->getName() . '</legend>';
foreach ($specialAttributes['eqLogic'] as $key => $config) {
$spAttr .= '<div class="form-group">';
$spAttr .= '<label class="col-sm-3 control-label">' . $config['name'][translate::getLanguage()] . '</label>';
$spAttr .= '<div class="col-sm-7">';
switch ($config['type']) {
case 'input':
$spAttr .= '<input class="form-control eqLogicAttr" data-l1key="configuration" data-l2key="plugin::' . $plugin->getId() . '::' . $key . '"/>';
break;
case 'number':
$spAttr .= '<input type="number" class="form-control eqLogicAttr" data-l1key="configuration" data-l2key="plugin::' . $plugin->getId() . '::' . $key . '" min="' . (isset($config['min']) ? $config['min'] : '') . '" max="' . (isset($config['max']) ? $config['max'] : '') . '" />';
break;
case 'select':
$spAttr .= '<select class="form-control eqLogicAttr" data-l1key="configuration" data-l2key="plugin::' . $plugin->getId() . '::' . $key . '">';
foreach ($config['values'] as $value) {
$spAttr .= '<option value="' . $value['value'] . '">' . $value['name'] . '</option>';
}
$spAttr .= '</select>';
break;
}
$spAttr .= '</div>';
$spAttr .= '</div>';
}
echo $spAttr;
}
} catch (\Exception $e) {
}
?>
</form>
</div>


</div>
</div>
</div>
Expand Down

0 comments on commit dd0c84b

Please sign in to comment.