function load()
 {
     if ($this->getOption(REPOOPTSHOWONLYFOLDER) === TRUE) {
         $this->tdb->setFilterTypes(array(''));
         $this->refresh = TRUE;
         // we must refresh
         $this->_visitArrayDeep($this->posTree, $this->posFlat, $this->expandList, $this->compressList);
     }
     $ot = parent::load();
     if ($this->selector_mode) {
         if (!$this->multi_choice) {
             // only a choice - set all previously selecteds items as printed
             // and print the first as radio with checked = "cheched" in a
             // hidden div
             $arr_selected_not_printed = array_diff($this->itemSelectedMulti, $this->printed_items);
             $ot .= "<div style=\"display: none\">\n";
             if (is_array($arr_selected_not_printed) && count($arr_selected_not_printed) > 0) {
                 $idst = $arr_selected_not_printed[0];
                 $ot .= '<input type="radio"' . ' id="' . $this->id . REPO_OP_SELECTMONO . '_' . $idst . '" ' . ' name="' . $this->id . '[' . REPO_OP_SELECTMONO . ']" ' . ' value="' . $idst . '"' . ' checked="checked" />' . "\n";
             }
             $ot .= "</div>\n";
             $this->printed_items = array_merge($this->printed_items, $this->itemSelectedMulti);
         }
         $ot .= '<input type="hidden"' . ' id="' . $this->id . '_' . REPO_ID_PRINTEDITEM . '"' . ' name="' . $this->id . '[' . REPO_ID_PRINTEDITEM . ']"' . ' value="' . urlencode(serialize($this->printed_items)) . '" />' . "\n";
     }
     return $ot;
 }
Ejemplo n.º 2
0
 function load()
 {
     if ($this->select_all) {
         $this->itemSelectedMulti = $this->tdb->getAllGroupST();
     }
     $ot = parent::load();
     if ($this->selector_mode) {
         if (!$this->multi_choice) {
             // only a choice - set all previously selecteds items as printed
             // and print the first as radio with checked = "cheched" in a
             // hidden div
             $arr_selected_not_printed = array_diff($this->itemSelectedMulti, $this->printed_items);
             $ot .= "<div style=\"display: none\">\n";
             if (is_array($arr_selected_not_printed) && count($arr_selected_not_printed) > 0) {
                 $idst = $arr_selected_not_printed[0];
                 $ot .= '<input type="radio"' . ' id="' . DIRECTORY_ID . DIRECTORY_OP_SELECTMONO . '_' . $idst . '" ' . ' name="' . DIRECTORY_ID . '[' . DIRECTORY_OP_SELECTMONO . ']" ' . ' value="' . $idst . '"' . ' checked="checked" />' . "\n";
             }
             $ot .= "</div>\n";
             $this->printed_items = array_merge($this->printed_items, $this->itemSelectedMulti);
         } elseif ($this->select_all) {
             $arr_selected_not_printed = array_diff($this->itemSelectedMulti, $this->printed_items_alt);
             $arr_selected_not_printed = array_diff($arr_selected_not_printed, $this->printed_items);
             $ot .= "<div style=\"display: none\">\n";
             if (is_array($arr_selected_not_printed) && count($arr_selected_not_printed) > 0) {
                 foreach ($arr_selected_not_printed as $idst) {
                     $ot .= '<input type="checkbox"' . ' id="' . DIRECTORY_ID . DIRECTORY_OP_SELECTMONO . '_' . $idst . '" ' . ' name="' . DIRECTORY_ID . '[' . DIRECTORY_OP_SELECTITEM . '][' . $idst . ']" ' . ' value="' . $idst . '"' . ' checked="checked" />' . "\n";
                 }
             }
             $ot .= "</div>\n";
         }
         $ot .= '<input type="hidden"' . ' id="' . DIRECTORY_ID . '_' . DIRECTORY_ID_PRINTEDITEM . '"' . ' name="' . DIRECTORY_ID . '[' . DIRECTORY_ID_PRINTEDITEM . ']"' . ' value="' . urlencode(serialize($this->printed_items)) . '" />' . "\n";
         $ot .= '<input type="hidden"' . ' id="' . DIRECTORY_ID . '_' . DIRECTORY_ID_PRINTEDFOLD . '"' . ' name="' . DIRECTORY_ID . '[' . DIRECTORY_ID_PRINTEDFOLD . ']"' . ' value="' . urlencode(serialize($this->printed_items_alt)) . '" />' . "\n";
     }
     return $ot;
 }