1: <?php
2: /**
3: * XPPublisher Wizard
4: * Builds a "Publish this file/folder to the web" handler for Windows XP+.
5: *
6: * @package Ansel
7: * @author Chuck Hagenbuch <chuck@horde.org>
8: */
9: class Ansel_XPPublisher
10: {
11: /**
12: * Generates a Windows Registry file that a user can double-click
13: * to add your provider to their list of Providers for the
14: * Publishing Wizard.
15: *
16: * @param string $appKey The unique name of your application. If
17: * people can use your application on multiple servers, make sure
18: * to include a hostname or something else server-specific in this
19: * string.
20: *
21: * @param string $displayName The name of your service in the
22: * Providers list.
23: *
24: * @param string $description Shows up as the description (2nd
25: * line) of your service in the Providers list.
26: *
27: * @param string $href The address of the wizard interface.
28: *
29: * @param string $icon The location of an icon for the
30: * service. Usually displayed at 32x32, will be scaled if it's not
31: * that size.
32: */
33: public function sendRegFile($appKey, $displayName, $description, $href, $icon)
34: {
35: $GLOBALS['browser']->downloadHeaders('install_registry.reg', 'application/octet-stream');
36:
37: $lines = array(
38: 'Windows Registry Editor Version 5.00',
39: '',
40: '[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\PublishingWizard\PublishingWizard\Providers\\' . $appKey . ']',
41: '"displayname"="' . $displayName . '"',
42: '"description"="' . $description . '"',
43: '"href"="' . $href . '"',
44: '"icon"="' . $icon . '"');
45: echo implode("\r\n", $lines) . "\r\n";
46: }
47:
48: }
49: