示例#1
0
    $table_manager->set_columns($columns);
    $table_manager->row_callback = function ($row_data) {
        // load the full file data before displaying each row so we have access to more details
        if (isset($row_data['file_id']) && (int) $row_data['file_id'] > 0) {
            // not needed in this case
            //return module_file::get_file($row_data['file_id']);
        }
        return array();
    };
    $table_manager->set_rows($files);
    $table_manager->pagination = false;
    $table_manager->print_table();
    $buttons = array();
    $buttons[] = array('url' => module_file::link_open('new', false, $file_id), 'title' => _l('Add New File'), 'type' => 'add');
    if (count($files)) {
        $buttons[] = array('url' => module_file::link_public_download_bucket($file_id), 'title' => _l('Download All'), 'type' => 'button');
    }
    $fieldset_data = array('heading' => array('title' => _l('Bucket Files'), 'type' => 'h3', 'button' => $buttons), 'elements_before' => ob_get_clean());
    echo module_form::generate_fieldset($fieldset_data);
    unset($fieldset_data);
}
hook_handle_callback('layout_column_half', 'end');
$form_actions = array('class' => 'action_bar action_bar_center action_bar_single', 'elements' => array(array('type' => 'save_button', 'name' => 'butt_save', 'id' => 'butt_save', 'value' => _l('Save Bucket')), array('ignore' => !((int) $file_id && module_file::can_i('delete', 'Files')), 'type' => 'delete_button', 'name' => 'butt_del', 'value' => _l('Delete')), array('type' => 'button', 'name' => 'cancel', 'value' => _l('Cancel'), 'class' => 'submit_button', 'onclick' => "window.location.href='" . module_file::link_open(false) . "';")));
echo module_form::generate_form_actions($form_actions);
if ((int) $file_id > 0 && isset($file['file_path']) && $file['file_path'] && is_file($file['file_path']) && module_file::can_i('view', 'File Comments')) {
    ?>

        <h2><?php 
    echo _l('File Comments');
    ?>
</h2>