Exemplo n.º 1
0
 /**
  * Exports current user's binded hot keys and using custom codes
  * @return string exported file name
  * */
 public function Export()
 {
     $this->LoadToCache();
     if (!is_array($this->arList) || empty($this->arList)) {
         return false;
     }
     $arForExport = array();
     $tmpDir = CTempFile::GetDirectoryName();
     CheckDirPath($tmpDir);
     $tmpExportFile = $tmpDir . self::$ExpImpFileName;
     foreach ($this->arList as $arHK) {
         $res = self::$codes->GetByID($arHK['CODE_ID']);
         $arTmpCode = $res->Fetch();
         if (!is_array($arTmpCode) || empty($arTmpCode)) {
             continue;
         }
         $arTmpLink = array('KEYS_STRING' => $arHK['KEYS_STRING'], 'CLASS_NAME' => $arTmpCode['CLASS_NAME'], 'NAME' => $arTmpCode['NAME'], 'IS_CUSTOM' => $arTmpCode['IS_CUSTOM']);
         if ($arTmpCode['IS_CUSTOM']) {
             $arTmpLink['CODE'] = $arTmpCode['CODE'];
             $arTmpLink['COMMENTS'] = $arTmpCode['COMMENTS'];
             $arTmpLink['URL'] = $arTmpCode['URL'];
         }
         $arForExport[] = $arTmpLink;
     }
     $result = file_put_contents($tmpExportFile, serialize($arForExport));
     if ($result === false) {
         return false;
     }
     return $tmpExportFile;
 }
Exemplo n.º 2
0
	}
	else
	{
		if($e = $APPLICATION->GetException())
			$errMess = new CAdminMessage(GetMessage("HK_EDIT_ERROR"),$e);
		else
			$errMess = new CAdminMessage(GetMessage("HK_EDIT_ERROR"));

		$bVarsFromForm = true;
	}

}

if($ID>0)
{
	$hk = $hotKeyCodes->GetByID($ID);
	if(!($hk_arr = $hk->ExtractFields("str_")))
		$ID=0;
}

if($bVarsFromForm)
	$DB->InitTableVarsForEdit("b_hot_keys_code", "", "str_");


$sDocTitle = ($ID>0? GetMessage("HK_EDIT_RECORD", array("#ID#"=>$ID)) : GetMessage("HK_NEW_RECORD"));

$APPLICATION->SetTitle($sDocTitle);

require($_SERVER["DOCUMENT_ROOT"].FX_ROOT."/modules/main/include/prolog_admin_after.php");

$aMenu = array(