Esempio n. 1
0
 public static function getPSCorrespondence($actFile)
 {
     if (!$actFile || !CModule::IncludeModule('sale')) {
         return false;
     }
     $arPSCorrespondence = array();
     $file = CCrmPaySystem::getActionPath($actFile);
     $path2SystemPSFiles = "/bitrix/modules/sale/payment/";
     $path2UserPSFiles = COption::GetOptionString("sale", "path2user_ps_files", BX_PERSONAL_ROOT . "/php_interface/include/sale_payment/");
     if (substr($path2UserPSFiles, strlen($path2UserPSFiles) - 1, 1) != "/") {
         $path2UserPSFiles .= "/";
     }
     $bSystemPSFile = substr($file, 0, strlen($path2SystemPSFiles)) == $path2SystemPSFiles;
     if (!$bSystemPSFile) {
         if (substr($path2UserPSFiles, strlen($path2UserPSFiles) - 1, 1) != "/") {
             $path2UserPSFiles .= "/";
         }
         $bUserPSFile = substr($file, 0, strlen($path2UserPSFiles)) == $path2UserPSFiles;
     }
     if ($bUserPSFile || $bSystemPSFile) {
         if ($bUserPSFile) {
             $fileName = substr($file, strlen($path2UserPSFiles));
         } else {
             $fileName = substr($file, strlen($path2SystemPSFiles));
         }
         $fileName = preg_replace("#[^A-Za-z0-9_.-]#i", "", $fileName);
         $arPSCorrespondence = CCrmPaySystem::LocalGetPSActionParams($_SERVER["DOCUMENT_ROOT"] . ($bUserPSFile ? $path2UserPSFiles : $path2SystemPSFiles) . $fileName . "/.description.php");
     }
     return $arPSCorrespondence;
 }