[cvs] [Wiki] changed: LegacyApps

Jan Schneider jan at horde.org
Fri Aug 19 02:07:54 PDT 2005


jan  Fri, 19 Aug 2005 02:07:54 -0700

Modified page: http://wiki.horde.org/LegacyApps
New Revision:  1.2
Change log:  Add Horde_Block examples

@@ -59,5 +59,26 @@
 
 The Registry already takes care of loading the Horde configuration, so {{$conf['auth']['driver']}} contains the correct driver name. The Auth library retrieves the authentication driver parameters from the configuration automatically.
 {{$authenticated}} will contain a boolean indicating whether the authentication succeeded.
 
-TODO: Horde_Block examples
+
+++ Using Horde_Blocks to embed HTML
+
+A quick way to embed HTML snippets from a Horde application into a website or application is to use a Horde_Block. The Horde_Block library powers the portal page of the Horde Application Framework. Each application and Horde itself are providing blocks of HTML that can be arranged by the users on their personal portal page. All blocks can be retrieved through a single API method.
+
+To embed a simple month calender for example, all you have to do is:
+
+<code type="php">
+echo $registry->call('horde/blockContent',
+                     array('kronolith', 'month', array('calendar' => 'jan')));
+</code>
+
+This code is calling the "month" block from the "kronolith" application, and passes it a "calendar" parameter. The method returns a string with HTML code that can be embedded into any HTML page.
+
+As Horde is using CSS for all styling and the CSS rules are not included in the HTML, the local CSS need to tweaked to give the block a nice look.
+One could also use Horde's CSS files, but these would be applied to the complete page:
+
+<code type="php">
+echo Horde::stylesheetLink('kronolith', 'mozilla');
+</code>
+
+Such a call would have to happen after the Registry has been initialized, and so that the output is echoed in the page's HTML HEAD.


More information about the cvs mailing list