<commit_before><?php
if (!defined("WIKINI_VERSION")) {
    die("acc&egrave;s direct interdit");
}

// taille de la colonne
$size = $this->GetParameter('title');
if (empty($size)) {
    echo '<div><div class="alert alert-danger"><strong>' . _t('TEMPLATE_ACTION_PANEL') . '</strong> : '
        . _t('TEMPLATE_TITLE_PARAMETER_REQUIRED') . '.</div>' . "\n";
    return;
}

// classe css pour la couleur du panel ou autre
$class = $this->GetParameter('class');
if (empty($class)) {
    $class = 'panel-default';
}

// data attributes
$data = getDataParameter();

$pagetag = $this->GetPageTag();

// teste s'il y a bien un element de fermeture associé avant d'ouvrir une balise
if (!isset($GLOBALS['check_' . $pagetag]['panel'])) {
    $GLOBALS['check_' . $pagetag]['panel'] = check_graphical_elements('panel', $pagetag, $this->page['body']);
}

if ($GLOBALS['check_' . $pagetag]['panel']) {
    $headingID = uniqid('heading');
    $collapseID = uniqid('collapse');
    if (isset($GLOBALS['check_'.$pagetag]['accordion_uniqueID'])) {
        $accordionID = $GLOBALS['check_'.$pagetag]['accordion_uniqueID'];
    } else {
        $accordionID = '';
    }

    $data = '';
    if (is_array($data)) {
        foreach ($data as $key => $value) {
            $data .= ' data-'.$key.'="'.$value.'"';
        }
    }

    echo "<!-- start of panel -->"
    . "<div class=\"panel $class\" $data>
      <div class=\"panel-heading\" role=\"tab\" id=\"$headingID\" role=\"button\" data-toggle=\"collapse\" data-parent=\"#$accordionID\" href=\"#$collapseID\" aria-expanded=\"true\" aria-controls=\"$collapseID\">
          <h4 class=\"panel-title\">
           $title
          </h4>
      </div>
      <div id=\"$collapseID\" class=\"panel-collapse".(!empty($accordionID) ? " collapse" : "")."\" role=\"tabpanel\" aria-labelledby=\"$headingID\">
        <div class=\"panel-body\">";
} else {
    echo '<div class="alert alert-danger"><strong>' . _t('TEMPLATE_ACTION_PANEL') . '</strong> : '
        . _t('TEMPLATE_ELEM_PANEL_NOT_CLOSED') . '.</div>' . "\n";
    return;
}<commit_msg>Action panel add parameter type: null|collapsed|collapsible<commit_after><?php
if (!defined("WIKINI_VERSION")) {
    die("acc&egrave;s direct interdit");
}

// Titre du pannel
$title = $this->GetParameter('title');
if (empty($title)) {
    echo '<div><div><div class="alert alert-danger"><strong>' . _t('TEMPLATE_ACTION_PANEL') . '</strong> : '
        . _t('TEMPLATE_TITLE_PARAMETER_REQUIRED');
    return;
}

// classe css pour la couleur du panel ou autre
$class = $this->GetParameter('class');
if (empty($class)) {
    $class = 'panel-default';
}

// collapsed: initial state is collasped, and the panel is collaspible
// collaspsible: initial state is displayed, and the panel is collaspible
// empty: initial state is displayed, and the panel is not collapsable
$type = $this->GetParameter('type');
if (empty($type)) {
    $type = '';
}
$collapsible = ($type == "collapsed" || $type == "collapsible");
$collapsed = ($type == "collapsed");

// data attributes
$data = getDataParameter();

$pagetag = $this->GetPageTag();

// teste s'il y a bien un element de fermeture associé avant d'ouvrir une balise
if (!isset($GLOBALS['check_' . $pagetag]['panel'])) {
    $GLOBALS['check_' . $pagetag]['panel'] = check_graphical_elements('panel', $pagetag, $this->page['body']);
}

if ($GLOBALS['check_' . $pagetag]['panel']) {
    $headingID = uniqid('heading');
    $collapseID = uniqid('collapse');
    if (isset($GLOBALS['check_'.$pagetag]['accordion_uniqueID'])) {
        $accordionID = $GLOBALS['check_'.$pagetag]['accordion_uniqueID'];
    } else {
        $accordionID = '';
    }

    $data = '';
    if (is_array($data)) {
        foreach ($data as $key => $value) {
            $data .= ' data-'.$key.'="'.$value.'"';
        }
    }

    $result = "<!-- start of panel -->"
    . "<div class=\"panel $class\" $data>
      <div class=\"panel-heading " . ($collapsed ? "collapsed" : "") ."\" role=\"tab\" id=\"$headingID\" role=\"button\"";
    if (!empty($accordionID)) $result .= " data-parent=\"#$accordionID\"";

    if ($collapsible) {
        $result .= " data-toggle=\"collapse\" href=\"#$collapseID\" aria-controls=\"$collapseID\"
         aria-expanded='" . ($collasped ? "true" : "false") . "'";
    }
    $result .= ">";
    $result .= "
          <h4 class=\"panel-title\">
           $title
          </h4>
      </div>
      <div id=\"$collapseID\" class=\"panel-collapse collapse " . ($collapsed ? "" : "in") ."\"
        aria-expanded='" . ($collapsed ? "true" : "false") ."' role=\"tabpanel\" aria-labelledby=\"$headingID\">
        <div class=\"panel-body\">";

    echo $result;
} else {
    echo '<div class="alert alert-danger"><strong>' . _t('TEMPLATE_ACTION_PANEL') . '</strong> : '
        . _t('TEMPLATE_ELEM_PANEL_NOT_CLOSED') . '.</div>' . "\n";
    return;
}
{'fraction_non_alphanumeric': 0.21902017291066284, 'fraction_numerical': 0.0008233841086867024, 'mean_word_length': 3.2660228270412643, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 48, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4312600', 'n_tokens_mistral': 1655, 'n_tokens_neox': 1653, 'n_words': 331}