*/ class DownloadRegistryFileView extends GalleryView { /** * @see GalleryView::isImmediate() */ function isImmediate() { return true; } /** * Renders the Windows registry file. * * Generates the registry file to be downloaded and installed on Windows * systems. The gallery name and hostname are used as part of the web service * for publishing. * * @see GalleryView::renderImmediate */ function renderImmediate($status, $error) { global $gallery; /* Get the domain name */ $urlGenerator =& $gallery->getUrlGenerator(); $domain = $urlGenerator->getHostName(); /* Get the name of the gallery */ list($ret, $rootId) = GalleryCoreApi::getPluginParameter('module', 'core', 'id.rootAlbum'); if ($ret) { return $ret->wrap(__FILE__, __LINE__); } list($ret, $root) = GalleryCoreApi::loadEntitiesById($rootId); if ($ret) { return $ret->wrap(__FILE__, __LINE__); } $title = $root->getTitle(); /* Setup the headers for the Registry file */ header("Cache-control: private"); header("Content-Type: application/octet-stream"); header("Content-Disposition: filename=install_registry.reg"); GalleryCoreApi::requireOnce('modules/core/classes/GalleryTemplate.class'); $template = new GalleryTemplate(dirname(__FILE__) . '/../..'); $template->setVariable('l10Domain', 'modules_publishxp'); $DownloadRegistryFile['title'] = $title; $DownloadRegistryFile['domain'] = $domain; $template->setVariable('DownloadRegistryFile', $DownloadRegistryFile); list ($ret, $html) = $template->fetch('gallery:modules/publishxp/templates/DownloadRegistryFile.tpl'); if ($ret) { return $ret->wrap(__FILE__, __LINE__); } /* Make sure we use Windows line endings */ print preg_replace("/(?