Esempio n. 1
0
 public static function OnChangeFile($path, $site)
 {
     global $BX_WORKFLOW_PUBLISHED_PATH, $BX_WORKFLOW_PUBLISHED_SITE;
     if ($BX_WORKFLOW_PUBLISHED_PATH == $path && $BX_WORKFLOW_PUBLISHED_SITE == $site) {
         return;
     }
     $err_mess = CWorkflow::err_mess() . "<br>Function: OnChangeFile<br>Line: ";
     global $DB, $USER, $APPLICATION;
     $HISTORY_SIMPLE_EDITING = COption::GetOptionString("workflow", "HISTORY_SIMPLE_EDITING", "N");
     if ($HISTORY_SIMPLE_EDITING == "Y") {
         $HISTORY_COPIES = intval(COption::GetOptionString("workflow", "HISTORY_COPIES", "10"));
         CWorkflow::CleanUpHistoryCopies_SE($path, $HISTORY_COPIES - 1);
         if ($HISTORY_COPIES > 0) {
             $DOC_ROOT = CSite::GetSiteDocRoot($site);
             $filesrc = $APPLICATION->GetFileContent($DOC_ROOT . $path);
             $arContent = ParseFileContent($filesrc);
             $TITLE = $arContent["TITLE"];
             $BODY = $arContent["CONTENT"];
             $arFields = array("DOCUMENT_ID" => 0, "MODIFIED_BY" => $USER->GetID(), "TITLE" => $TITLE, "FILENAME" => $path, "SITE_ID" => $site, "BODY" => $BODY, "BODY_TYPE" => "html", "STATUS_ID" => 1, "~TIMESTAMP_X" => $DB->CurrentTimeFunction());
             $DB->Add("b_workflow_log", $arFields, array("BODY"), "workflow");
         }
     }
 }