Exemplo n.º 1
0
 function SetHiden($ids = array(), $bHide)
 {
     if (!is_array($ids)) {
         $ids = array($ids);
     }
     if (!CSticker::CanDoOperation('sticker_edit')) {
         return GetMessage('FMST_EDIT_ACCESS_ERROR');
     }
     if (count($ids) == 0) {
         return GetMessage('FMST_NO_ITEMS_WARN');
     }
     global $DB;
     $strIds = "";
     for ($i = 0; $i < count($ids); $i++) {
         $strIds .= "," . IntVal($ids[$i]);
     }
     $arFields = array("CLOSED" => $bHide ? "Y" : "N");
     $strUpdate = $DB->PrepareUpdate("b_sticker", $arFields);
     $strSql = "UPDATE b_sticker SET " . $strUpdate . " WHERE ID in (" . trim($strIds, ", ") . ")";
     if (!$DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__)) {
         return GetMessage('FMST_REQ_ERROR');
     }
     CSticker::ClearCache();
     return true;
 }