Exemplo n.º 1
0
 public function __construct()
 {
     $this->Path = \CApi::DataPath() . '/sessions';
     $oSession = \MailSo\Cache\CacheClient::NewInstance();
     $oSessionDriver = \MailSo\Cache\Drivers\File::NewInstance($this->Path);
     $oSessionDriver->bRootDir = true;
     $oSession->SetDriver($oSessionDriver);
     $oSession->SetCacheIndex(\CApi::Version());
     $this->Session = $oSession;
 }
Exemplo n.º 2
0
 /**
  * @param string $sWebPath Default value is **'.'**.
  * @param bool $bHelpdesk Default value is **false**.
  * @param int $iHelpdeskIdTenant Default value is **null**.
  * @param string $sHelpdeskHash Default value is empty string.
  * @param string $sCalendarPubHash Default value is empty string.
  * @param string $sFileStoragePubHash Default value is empty string.
  * @param bool $bMobile Default value is **false**.
  *
  * @return string
  */
 public function buildBody($sWebPath = '.', $bHelpdesk = false, $iHelpdeskIdTenant = null, $sHelpdeskHash = '', $sCalendarPubHash = '', $sFileStoragePubHash = '', $bMobile = false)
 {
     list($sLanguage, $sTheme, $sSiteName) = $this->getThemeAndLanguage();
     $sMobileSuffix = $bMobile && !$bHelpdesk ? '-mobile' : '';
     $sWebPath = empty($sWebPath) ? '.' : $sWebPath;
     return '<div class="pSevenMain"><div id="pSevenLoading"></div><div id="pSevenContent"></div><div id="pSevenHidden"></div>' . '<div>' . $this->compileTemplates($sTheme, $bMobile) . '<script src="' . $sWebPath . '/static/js/libs.js?' . CApi::VersionJs() . '"></script>' . $this->compileLanguage($sLanguage) . $this->compileAppData($bHelpdesk, $iHelpdeskIdTenant, $sHelpdeskHash, $sCalendarPubHash, $sFileStoragePubHash) . '<script src="' . $sWebPath . '/static/js/app' . $sMobileSuffix . ($bHelpdesk ? '-helpdesk' : (empty($sCalendarPubHash) ? empty($sFileStoragePubHash) ? '' : '-filestorage-pub' : '-calendar-pub')) . (CApi::GetConf('labs.use-app-min-js', false) ? '.min' : '') . '.js?' . CApi::VersionJs() . '"></script>' . (CApi::Plugin()->HasJsFiles() ? '<script src="?/Plugins/js/' . CApi::Plugin()->Hash() . '/"></script>' : '') . '</div></div>' . "\r\n" . '<!-- ' . CApi::Version() . ' -->';
 }
Exemplo n.º 3
0
 /**
  * @return string
  */
 public static function VersionJs()
 {
     return preg_replace('/[^0-9a-z]/', '', CApi::Version() . (CApi::GetConf('labs.cache.static', true) ? '' : '-' . md5(time())));
 }
Exemplo n.º 4
0
 /**
  * @return string
  */
 public function Hash()
 {
     $sResult = md5(CApi::Version());
     foreach ($this->_aPlugins as $oPlugin) {
         $sResult = md5($sResult . $oPlugin->GetPath() . $oPlugin->GetName() . $oPlugin->GetHash());
     }
     return $sResult;
 }
Exemplo n.º 5
0
 /**
  * @return string
  */
 public function Hash()
 {
     $sResult = md5(CApi::Version());
     foreach ($this->_aModules as $oModule) {
         $sResult = md5($sResult . $oModule->GetPath() . $oModule->GetName() . $oModule->GetHash());
     }
     return $sResult;
 }
Exemplo n.º 6
0
 /**
  * Returns application html.
  * 
  * @param string $sModuleHash
  * @return string
  */
 public function buildBody($sModuleHash = '')
 {
     list($sLanguage, $sTheme, $sSiteName) = $this->getThemeAndLanguage();
     return $this->compileTemplates() . $this->compileLanguage($sLanguage) . $this->compileAppData() . $this->getJsLinks($sModuleHash) . "\r\n" . '<!-- ' . CApi::Version() . ' -->';
 }