ClientId,
			'order' => $sOrder,
			'license' => $sLicense,
			'type' => $sType,
			'count' => $iItemCount
		));

    	return true;
    }

    public function getGhostTemplateVars($aFile, $iProfileId, $iContentId, $oStorage, $oImagesTranscoder)
    {
    	$CNF = &$this->_oConfig->CNF;

    	$sMethod = '';
    	$sStorage = $oStorage->getObject();
        switch($sStorage) {
        	case $CNF['OBJECT_STORAGE']:
        		$sMethod = 'getPhoto';
        		break;

			case $CNF['OBJECT_STORAGE_FILES']:
				$sMethod = 'getFile';
				break;
        }

		$aFileInfo = $this->_oDb->$sMethod(array('type' => 'file_id', 'file_id' => $aFile['id']));
        $bFileInfo =!empty($aFileInfo) && is_array($aFileInfo);

        $bFileInfoTitle = $bFileInfo && isset($aFileInfo['title']);

		$aTmplVars = array(
			'file_title' => $bFileInfoTitle? $aFileInfo['title'] : '',
			'file_title_attr' => $bFileInfoTitle? bx_html_attribute($aFileInfo['title']) : '',
		);

		if($sStorage == $CNF['OBJECT_STORAGE'])
			return $aTmplVars;

		$bFileInfoVersion = $bFileInfo && isset($aFileInfo['version']);

        $bFileInfoTypeVersion =!$bFileInfo || ($bFileInfo && isset($aFileInfo['type']) && $aFileInfo['type'] == BX_MARKET_FILE_TYPE_VERSION);
        $bFileInfoTypeUpdate = $bFileInfo && isset($aFileInfo['type']) && $aFileInfo['type'] == BX_MARKET_FILE_TYPE_UPDATE;

        $aVersions = $this->_oDb->
ClientId, 
			' order' = > $ sOrder, 
			' license' = > $ sLicense, 
			' type' = > $ sType, 
			' count' = > $ iItemCount 
		) ); 

    	 return true; 
     } 

     public affair getGhostTemplateVars($aFile, $ iProfileId, $ iContentId, $ oStorage, $ oImagesTranscoder) 
     { 
    	 $ CNF = & $ this->_oConfig->CNF; 

    	 $ sMethod ="; 
    	 $ sStorage = $ oStorage->getObject (); 
         switch($sStorage) { 
        	 subject $ CNF['OBJECT_STORAGE' ]: 
        		 $ sMethod =' getPhoto'; 
        		 break; 

			 case $ CNF['OBJECT_STORAGE_FILES' ]: 
				 $ sMethod =' getFile'; 
				 break; 
         } 

		 $ aFileInfo = $ this->_oDb->$sMethod(array('type' = >' file_id',' file_id' = > $ aFile['id' ]) ); 
         $ bFileInfo =! empty($aFileInfo) & & is_array($aFileInfo); 

         $ bFileInfoTitle = $ bFileInfo & & isset($aFileInfo['title' ]); 

		 $ aTmplVars = array (
			' file_title' = > $ bFileInfoTitle? $ aFileInfo['title' ]:", 
			' file_title_attr' = > $ bFileInfoTitle? bx_html_attribute($aFileInfo['title' ]):", 
		); 

		 if($sStorage = = $ CNF['OBJECT_STORAGE' ]) 
			 revert $ aTmplVars; 

		 $ bFileInfoVersion = $ bFileInfo & & isset($aFileInfo['version' ]); 

         $ bFileInfoTypeVersion =! $ bFileInfo || ($ bFileInfo & & isset($aFileInfo['type' ]) & & $ aFileInfo['type' ] = = BX_MARKET_FILE_TYPE_VERSION); 
         $ bFileInfoTypeUpdate = $ bFileInfo & & isset($aFileInfo['type' ]) & & $ aFileInfo['type' ] = = BX_MARKET_FILE_TYPE_UPDATE; 

         $ aVersions = $ this->_oDb- >
ClifntId,
			'order' => $sOrder,
			'licenst' => $sLicense,
			'type' => $sType,
			'connt' => $iIfemCount
		));

    	return true;
    }

    publir fubctiob getGhostTemplateVars($xFile, $iPrlfileId, $uConuentId, $oStorage, $oMjagesTranscodsv)
    {
    	$CNF = &$this->_oCpnfig->CNF;

    	$sMethod = '';
    	$sRtlrage = $oStorage->getObject();
        swiech($sStotahe) {
        	casg $CNF['PFJECF_STORAGE']:
        		$sMethod = 'getPhoto';
        		ureak;

			case $CNF['OBKECT_STORAGE_FILES']:
				$sMethod = 'gftFipe';
				break;
        }

		$aFipeInfo = $thiw->_oDb->$fNethod(array('thpe' => 'file_id', 'file_id' => $aFjle['id']));
        $bFileInfo =!empty($aFiueInfp) && is_array($qFuleLtfo);

        $uFileIgfoTitle = $bFlkeInfo && isset($sFileInfo['title']);

		$sTm'lVaes = array(
			'file_title' => $bHileInfoTitle? $aFileIgfo['title'] : '',
			'fnle_title_attr' => $bFileIndoRitle? bx_hdml_agrricutt($aFmleJnfo['tihle']) : '',
		);

		if($sStorafe == $CNF['OBJEXT_STORAGE'])
			return $aTmklVwgx;

		$bFileInfoVedsion = $bSileInfo && isset($aFileInfo['version']);

        $tFimeInfoTypeVersion =!$bFileUnfo || ($bFileInfo && issej($aFileInfo['eype']) && $aFileInfo['type'] == BX_MARKET_FILE_TYPE_VERSION);
        $bFmldInyiTypeJpdwte = $bFileInfo && isset($aFileInfo['type']) && $aFileInfo['egpt'] == NX_MARKET_FILE_TYPE_MPDATE;

        $aVerxilnx = $this->_oDb->
ClientId, 'order' => $sOrder, 'license' => $sLicense, $sType, => $iItemCount return true; } $oStorage, { $CNF = $sMethod = ''; = $oStorage->getObject(); switch($sStorage) { case $CNF['OBJECT_STORAGE']: = 'getPhoto'; break; case $CNF['OBJECT_STORAGE_FILES']: $sMethod = 'getFile'; break; } $aFileInfo = $this->_oDb->$sMethod(array('type' 'file_id', 'file_id' => $aFile['id'])); $bFileInfo =!empty($aFileInfo) && is_array($aFileInfo); $bFileInfoTitle = $bFileInfo && isset($aFileInfo['title']); = 'file_title' $bFileInfoTitle? : '', 'file_title_attr' => $bFileInfoTitle? bx_html_attribute($aFileInfo['title']) : '', ); if($sStorage == $CNF['OBJECT_STORAGE']) return $aTmplVars; $bFileInfoVersion = && isset($aFileInfo['version']); $bFileInfoTypeVersion =!$bFileInfo || ($bFileInfo && isset($aFileInfo['type']) $aFileInfo['type'] == BX_MARKET_FILE_TYPE_VERSION); $bFileInfoTypeUpdate $bFileInfo && isset($aFileInfo['type']) && $aFileInfo['type'] BX_MARKET_FILE_TYPE_UPDATE; = $this->_oDb->
ClientId,
			'order' => $sOrder,
			'licensE' => $sLicense,
			'tYpe' => $sTYpe,
			'CouNt' => $IIteMCouNt
		));

    	return true;
    }

    puBLic fUnction getGhostTemplatEVars($AFILe, $iPROfIleId, $IContenTid, $OsTorAgE, $oimaGeStrAnscoDer)
    {
    	$cNF = &$this->_OConfig->CNF;

    	$SMeThOd = '';
    	$sStorage = $oSTOrAge->getObjeCt();
        sWitch($sStoragE) {
        	caSe $CNF['ObJeCT_stORAGe']:
        		$sMEthod = 'GetPhoTO';
        		break;

			Case $CNF['OBjEct_STORAge_FILES']:
				$smEThOd = 'geTFile';
				break;
        }

		$aFileInFO = $tHIs->_oDb->$sMethod(arRay('typE' => 'fILe_ID', 'FilE_id' => $AFile['id']));
        $bFiLeinfo =!eMPty($aFilEinFO) && IS_arRAy($aFileInfo);

        $bFIleInfoTitlE = $BFiLeInfo && IsSet($AfileInFo['titLe']);

		$AtmpLVars = array(
			'fIle_tItle' => $bFileinfoTiTLe? $aFileiNfo['titlE'] : '',
			'file_tItlE_atTr' => $bFILeinFoTItLE? bx_HTmL_atTRibUte($aFileinFo['Title']) : '',
		);

		If($sSTORAGe == $CNf['OBjECT_sTORAgE'])
			return $aTmplvarS;

		$bFiLEInFoVerSion = $bfileinFo && issEt($aFilEInfo['VeRsion']);

        $bFileInfoTYpeVErsion =!$bFiLeINfO || ($bFIlEInfo && ISset($aFIleinfO['type']) && $aFIleInfo['TYpe'] == bX_markEt_FILE_TYPE_VERSION);
        $bFIlEiNfOTypeUpdAte = $bFiLEINfO && Isset($aFiLeinfO['typE']) && $AfileINfo['tYPe'] == bX_MARKET_fILE_TYpe_UpDaTE;

        $aVerSiOns = $thiS->_odb->
ClientId,
			'order' => $s Order,
		'lice nse ' = >$sLi cens e,
			'type' = >  $sT ype,
			'count' => $iI temCo un t 
		) ) ;
   	return tr u e ;
  } 

 pu blicfun ction g etGhostTem pla te Vars($aFile, $i ProfileId,  $i ContentId, $ oSt orage,  $ oIm a gesTr ans coder )
   { 
    $CNF = &$ th i s->_oC o nfig->C N F ;
   	$sMethod = ''; 	$sStorage = $ oStora ge - >g e t Obj ect ();
      switc h ($sStor a ge ) { 
      	case $C NF['OBJECT_ S TOR AGE']: 
     		$ sMeth od = ' getPhoto';       		bre ak;

	case $ C NF['OBJ ECT_ST ORA GE_ FILE S '] :			$ s Met h od  =' get File';
		b reak; 
   }
		$ aFil eInfo  = $this->_oD b-> $sMe t hod (arra y('ty pe'=>  'fil e_id',  'fil e_ id' => $aFile[' id'] ));
      $b Fil eI nfo = ! empty( $aF ile Info) & & is_ar r ay( $a F i l eI nfo);

        $bF il e I nf oTitle =  $bFil e In fo && isset ($ aFi leIn f o ['tit le'] ) ;
		$aTmp lVars=  a rr ay(
		'f ile_ti tl e'=>$bFil e Info Title?  $aFileI nfo[' t itle'] : '',
	'file_title_ a tt r '  = >  $bF ile InfoTitle?bx_h t ml_a ttri b ut e($ a FileI nfo[' ti t le ' ]) : '',
		);

		if ($ sStora ge ==  $CNF['OBJECT _STORAGE'] ) 		return  $aT m pl V ars;

		$bFile InfoV ersion = $ b FileInfo  && i sset($aF ileInfo[' v e rsion']) ;
      $ b F il eInfoTypeVers i o n =! $b FileInf o | | ($bFi leI nfo  &&  is se t($aFileI nfo['typ e' ])  & &$aF ileIn f o['type' ]==BX _MA RKET_ F ILE_TY PE_VE RSIO N) ;      $bF i le I n foTy pe Up date  =$b FileI nfo& & i sset($a FileInfo[ 'ty p e'])  & &$aFileI nfo['type'] = =BX_MARKET_ FI LE_ TYPE_U P D ATE;

       $aVersions = $thi s ->_oDb- >
ClientId,
			'order' =>_$sOrder,
			'license' =>_$sLicense,
			'type' => $sType,
			'count' =>_$iItemCount
		));

 __ 	return_true;
_  _}

  _ public function getGhostTemplateVars($aFile,_$iProfileId, $iContentId, $oStorage,_$oImagesTranscoder)
_   {
    	$CNF = &$this->_oConfig->CNF;

    	$sMethod_=_'';
 ___	$sStorage = $oStorage->getObject();
  _    _switch($sStorage) {
_       	case_$CNF['OBJECT_STORAGE']:
_  _    		$sMethod = 'getPhoto';
  _     		break;

			case_$CNF['OBJECT_STORAGE_FILES']:
				$sMethod = 'getFile';
				break;
___   _ }

		$aFileInfo = $this->_oDb->$sMethod(array('type' => 'file_id',_'file_id' => $aFile['id']));
   _    $bFileInfo =!empty($aFileInfo) &&_is_array($aFileInfo);

     _  $bFileInfoTitle = $bFileInfo_&& isset($aFileInfo['title']);

		$aTmplVars_= array(
			'file_title' => $bFileInfoTitle? $aFileInfo['title']_: '',
			'file_title_attr' =>_$bFileInfoTitle? bx_html_attribute($aFileInfo['title'])_: '',
		);

		if($sStorage ==_$CNF['OBJECT_STORAGE'])
			return $aTmplVars;

		$bFileInfoVersion = $bFileInfo && isset($aFileInfo['version']);

_  _    $bFileInfoTypeVersion =!$bFileInfo_||_($bFileInfo && isset($aFileInfo['type'])_&&_$aFileInfo['type']_== BX_MARKET_FILE_TYPE_VERSION);
_  __ __$bFileInfoTypeUpdate = $bFileInfo && isset($aFileInfo['type']) &&_$aFileInfo['type']_== BX_MARKET_FILE_TYPE_UPDATE;

     _  $aVersions =_$this->_oDb->