示例#1
0
/**
 * generates form fields for the submitted multidimensional array
 *
 * @param string $variable the name of the array, which is filled with the data
 * @param mixed  $data     the data-array
 * @param mixed  $parent   leave this entry as is
 *
 * @return string the inputs of type hidden as html
 */
function addHiddenFields($variable, $data, $parent = array())
{
    if (is_array($data)) {
        foreach ($data as $key => $value) {
            if (is_array($value)) {
                $ret .= addHiddenFields($variable, $value, array_merge($parent, array($key)));
            } else {
                $ret .= '<input type="hidden" name="' . htmlReady($variable . '[' . implode('][', array_merge($parent, array($key))) . ']') . '" value="' . htmlReady($value) . '">' . "\n";
            }
        }
    } else {
        $ret .= '<input type="hidden" name="' . htmlReady($variable) . '" value="' . htmlReady($data) . '">' . "\n";
    }
    return $ret;
}
示例#2
0
<div style="text-align: right;">
    <?php 
echo $reset_search;
?>
</div>
<? endif; ?>
<form action="<?php 
echo $url;
?>
" method="<?php 
echo $method;
?>
" <? if (isset($id)) printf('id="%s"', htmlReady($id)); ?> class="sidebar-search">
<? foreach ($url_params as $key => $value): ?>
    <?php 
echo addHiddenFields($key, $value);
?>
<? endforeach; ?>
    <ul class="needles">
    <? foreach ($needles as $needle): ?>
        <li <? if ($needle['quick_search'] && $needle['quick_search']->hasExtendedLayout()) echo 'class="extendedLayout" id="' . $needle['quick_search']->getId() . '_frame"'; ?>>
            <label for="needle-<?php 
echo $hash = md5($url . '|' . $needle['name']);
?>
" <? if ($needle['placeholder']) echo 'style="display:none;"'; ?>>
                <?php 
echo htmlReady($needle['label']);
?>
            </label>
        <? if ($needle['quick_search']): ?>
            <?php 
示例#3
0
<? foreach(PageLayout::getMessages() as $pm) : ?>
    <?php 
echo $pm;
?>
<? endforeach; ?>
<form class="studip_form" action="<?php 
echo $controller->link_for();
?>
" method="post">
<?php 
echo CSRFProtection::tokenTag();
?>
<? foreach($request as $k => $v) : ?>
    <?php 
echo addHiddenFields($k, $v);
?>
<? endforeach ?>
<div data-dialog-button>
    <?php 
echo Studip\Button::create(_("Ja"), $button_yes, array('data-dialog' => ''));
?>
    <?php 
echo Studip\Button::create(_("Nein"), $button_no, array('data-dialog' => ''));
?>
</div>
</form>