function supplement_display($form, $fields)
 {
     $fld_start = '<input ';
     $fld_start_len = strlen($fld_start);
     $fld_end = '>';
     $fld_end_len = strlen($fld_end);
     $offset = 0;
     $date_format = 'd-m-y';
     do {
         $pos = strpos($form->template, $fld_start, $offset);
         if ($pos === false) {
             break;
         }
         if ($pos > $offset) {
             $this->_form->addElement('html', substr($form->template, $offset, $pos - $offset));
             // output any HTML
         }
         $offset = $pos + $fld_start_len;
         $pos = strpos($form->template, $fld_end, $offset);
         if ($pos === false) {
             break;
         }
         $element = split_input_field(substr($form->template, $offset, $pos - $offset));
         $offset = $pos + $fld_end_len;
         $text = $fields[$element['id']];
         if ($element['type'] == 'checkbox') {
             // map a checkbox value to a nice character
             if ($text == '1') {
                 $text = '&#10004;';
             } else {
                 $text = '';
             }
         }
         if ($element['type'] == 'date' && $text) {
             // map a UNIX date to a nice text string
             $date = date_create();
             date_timestamp_set($date, $text);
             $text = date_format($date, $date_format);
         }
         if ($element['type'] == 'file' && $text) {
             // map a file pathname hash to a URL for the file
             $text = get_file_link($text);
         }
         $this->_form->addElement('static', $element['id'], $element['value'], $text);
     } while (true);
     $this->_form->addElement('html', substr($form->template, $offset));
     // output any remaining HTML
     return;
 }
Beispiel #2
0
    _e('Direct link');
    ?>
" href="<?php 
    echo ROOT_URL . (!empty($p) ? '/' . $p : '') . '/' . $f . '/';
    ?>
" target="_blank"><i class="icon-chain"></i></a>
</td></tr>
    <?php 
    flush();
}
foreach ($files as $f) {
    $img = get_file_icon($path . '/' . $f);
    $modif = date("d.m.y H:i", filemtime($path . '/' . $f));
    $filesize_raw = filesize($path . '/' . $f);
    $filesize = get_filesize($filesize_raw);
    $filelink = get_file_link($p, $f);
    $all_files_size += $filesize_raw;
    $perms = substr(decoct(fileperms($path . '/' . $f)), -4);
    ?>
<tr>
<?php 
    if (!READONLY) {
        ?>
<td><label><input type="checkbox" name="file[]" value="<?php 
        echo encode_html($f);
        ?>
"></label></td><?php 
    }
    ?>
<td><?php 
    if (!empty($filelink)) {