예제 #1
0
 function list_actions(Contact $user, $qreq, PaperList $pl, &$actions)
 {
     $xactions = SearchAction::list_subactions("get", $user, $qreq, $pl);
     foreach (PaperOption::option_ids() as $oid) {
         if ($pl->any["opt{$oid}"] && ($o = PaperOption::find($oid)) && $o->is_document()) {
             $xactions[] = GetDocument_SearchAction::make_option_action($o);
         }
     }
     usort($xactions, function ($a, $b) {
         return $a[0] - $b[0];
     });
     $sel_opt = array();
     $last_group = null;
     foreach ($xactions as $xact) {
         if ($xact[2] !== $last_group) {
             $sel_opt[] = ["optgroup", $xact[2]];
             $last_group = $xact[2];
         }
         $sel_opt[] = ["value" => $xact[1], "label" => $xact[3]];
     }
     if (!empty($sel_opt)) {
         $actions[] = [0, "get", "Download", "<b>:</b> &nbsp;" . Ht::select("getfn", $sel_opt, $qreq->getfn, ["tabindex" => 6, "class" => "wantcrpfocus", "style" => "max-width:10em"]) . "&nbsp; " . Ht::submit("fn", "Go", ["value" => "get", "tabindex" => 6, "onclick" => "return plist_submit.call(this)", "data-plist-submit-all" => 1])];
     }
 }