function tag_file_download_list() { global $step, $endform, $name; $invars = gpsa(array('form', 'category', 'limit', 'sort', 'wraptag', 'break', 'label', 'labeltag')); $sorts = array('' => '', 'filename' => 'Name', 'downloads desc' => 'Download Count descending', 'downloads asc' => 'Download Count ascending', 'rand()' => 'Random'); extract($invars); $out = form(startTable('list') . tr(tdcs(hed(gTxt('tag_file_download_list'), 3), 2)) . tagRow('form', form_pop($form, 'file', 'form')) . tagRow('category', file_category_pop($category)) . tagRow('limit', fInput('text', 'limit', $limit, 'edit', '', '', 2)) . tagRow('sort_by', selectInput("sort", $sorts, $sort)) . tagRow('wraptag', fInput('text', 'wraptag', $wraptag, 'edit', '', '', 2)) . tagRow('break', fInput('text', 'break', $break, 'edit', '', '', 5)) . tagRow('label', fInput('text', 'label', $label, 'edit', '', '', 20)) . tagRow('labeltag', fInput('text', 'labeltag', $labeltag, 'edit', '', '', 5)) . $endform); $out .= $step == 'build' ? tdb(tb($name, $invars)) : ''; echo $out; }
function tag_file_download_list() { global $step, $endform, $tag_name; $atts = gpsa(array('break', 'category', 'form', 'label', 'labeltag', 'limit', 'sort', 'wraptag')); $asc = ' (' . gTxt('ascending') . ')'; $desc = ' (' . gTxt('descending') . ')'; $sorts = array('filename asc' => gTxt('file_name') . $asc, 'filename desc' => gTxt('file_name') . $desc, 'downloads asc' => gTxt('downloads') . $asc, 'downloads desc' => gTxt('downloads') . $desc, 'rand()' => 'Random'); extract($atts); $out = form(startTable('tagbuilder') . tr(tdcs(hed(gTxt('tag_' . $tag_name), 3), 2)) . tagRow('category', file_category_pop($category)) . tagRow('sort', ' ' . selectInput('sort', $sorts, $sort, true)) . tagRow('limit', input_limit($limit)) . tagRow('label', fInput('text', 'label', $label, 'edit', '', '', 25)) . tagRow('labeltag', input_tag('labeltag', $labeltag)) . tagRow('wraptag', input_tag('wraptag', $wraptag)) . tagRow('break', input_tag('break', $break)) . tagRow('form', form_pop('form', 'file', $form)) . $endform); if ($step == 'build') { $out .= tdb(tb($tag_name, $atts)); } echo $out; }