Beispiel #1
0
<?php

if (!defined("WIKINI_VERSION")) {
    die("acc&egrave;s direct interdit");
}
// classe css supplémentaire
$class = $this->GetParameter('class');
$class = 'row-fluid row' . (!empty($class) ? ' ' . $class : '');
$pagetag = $this->GetPageTag();
// teste s'il y a bien un element de fermeture associé avant d'ouvrir une balise
if (!isset($GLOBALS['check_' . $pagetag]['grid'])) {
    $GLOBALS['check_' . $pagetag]['grid'] = check_graphical_elements('grid', $pagetag, $this->page['body']);
}
if ($GLOBALS['check_' . $pagetag]['grid']) {
    echo '<div class="' . $class . '"> <!-- start of grid -->' . "\n";
} else {
    echo '<div class="alert alert-danger"><strong>' . _t('TEMPLATE_ACTION_GRID') . '</strong> : ' . _t('TEMPLATE_ELEM_GRID_NOT_CLOSED') . '.</div>' . "\n";
    return;
}
// icone du bouton
$icon = $this->GetParameter('icon');
if (!empty($icon)) {
    $icon = '<i class="icon-' . $icon . ' glyphicon glyphicon-' . $icon . '"></i>';
}
// classe css supplémentaire l'ensemble du
$class = $this->GetParameter('class');
// classe css supplémentaire pour changer le look des boutons
$btnclass = $this->GetParameter('btnclass');
$btnclass = 'btn ' . $btnclass;
if (!strstr($btnclass, 'btn-')) {
    $btnclass .= ' btn-default';
}
$nobtn = $this->GetParameter('nobtn');
if (!empty($nobtn) && $nobtn == '1') {
    $btnclass = str_replace(array('btn ', 'btn-default'), array('', ''), $btnclass);
}
$pagetag = $this->GetPageTag();
// teste s'il y a bien un element de fermeture associé avant d'ouvrir une balise
if (!isset($GLOBALS['check_' . $pagetag]['buttondropdown'])) {
    $GLOBALS['check_' . $pagetag]['buttondropdown'] = check_graphical_elements('buttondropdown', $pagetag, $this->page['body']);
}
if ($GLOBALS['check_' . $pagetag]['buttondropdown']) {
    echo '<div class="btn-group' . (!empty($class) ? ' ' . $class : '') . '"> <!-- start of buttondropdown -->
  <button type="button" class="' . $btnclass . ' dropdown-toggle" data-toggle="dropdown" title="' . htmlentities($title, ENT_COMPAT, TEMPLATES_DEFAULT_CHARSET) . '">
    ' . $icon . $text . ($caret == "1" ? ' <span class="caret"></span>' : '') . '
  </button>' . "\n";
} else {
    echo '<div class="alert alert-danger"><strong>' . _t('TEMPLATE_ACTION_BUTTONDROPDOWN') . '</strong> : ' . _t('TEMPLATE_ELEM_BUTTONDROPDOWN_NOT_CLOSED') . '.</div>' . "\n";
    return;
}
Beispiel #3
0
<?php

if (!defined("WIKINI_VERSION")) {
    die("acc&egrave;s direct interdit");
}
// classe css supplémentaire
$elem = $this->GetParameter('elem');
if (empty($elem)) {
    echo '<div class="alert alert-danger"><strong>' . _t('TEMPLATE_ACTION_END') . '</strong> : ' . _t('TEMPLATE_ELEM_PARAMETER_REQUIRED') . '.</div>' . "\n";
    return;
} else {
    $pagetag = $this->GetPageTag();
    // teste s'il y a bien un element de fermeture associé avant d'ouvrir une balise
    if (!isset($GLOBALS['check_' . $pagetag]['col'])) {
        $GLOBALS['check_' . $pagetag][$elem] = check_graphical_elements($elem, $pagetag, $this->page['body']);
    }
    if ($GLOBALS['check_' . $pagetag][$elem]) {
        switch ($elem) {
            case 'grid':
                echo "\n</div> <!-- end of grid -->\n";
                break;
            case 'col':
                echo "\n</div> <!-- end of col -->\n";
                break;
            case 'buttondropdown':
                echo "\n</div> <!-- end of buttondropdown -->\n";
                break;
            default:
                break;
        }
    }