[cvs] [Wiki] changed: ScreenScrapingKronolith

Wiki Guest wikiguest at horde.org
Tue Jul 21 13:01:07 UTC 2009


guest [72.15.14.12]  Tue, 21 Jul 2009 09:01:07 -0400

Modified page: http://wiki.horde.org/ScreenScrapingKronolith
New Revision:  2.1
Change log:  Adding information about hiding the menu

@@ -1,11 +1,11 @@
  This how-to explains how to integrate public kronolith calendars  
with your other websites through screen scraping with PHP.  There are  
other methods of embedding kronolith calendars with javascript, but  
they don't provide the same level of functionality.

-Assumptions:
+==Assumptions==
  # Your horde installation is located in '''/calendar'''
  # You have a file named '''calendar.horde.inc.php''' in your include path

-
+==Setup==
  This setup uses two files, one to provide the necessary functions  
and another that you can put anywhere on your site (or multiple  
places) where you'd like the calendar displayed.

  The file used to display the calendars is fairly simple, it includes  
a link to appropriate stylesheets, the call to the calendar with  
associated config variables and if necessary header and footer  
information.  This example is designed to go inside the <body> tags on  
your page.
  '''Place this in the php file where you would like to have the  
calendar display'''
@@ -119,4 +119,48 @@

  <?
  }
  </code>
+
+==Further Customization==
+If you would like to hide the menus for guests you can adjust the  
pages in kronolith that display the different views.  Here's an  
example of the kronolith/day.php file.  You'll want to adjust the  
month, week, workweek and year files as well.
+
+<code type="php">
+require_once dirname(__FILE__) . '/lib/base.php';
+
+$view = Kronolith::getView('Day');
+$title = $view->getTime($prefs->getValue('date_format'));
+$print_view = (bool)Util::getFormData('print');
+
+Horde::addScriptFile('tooltip.js', 'horde', true);
+if (!$print_view) {
+    Horde::addScriptFile('popup.js', 'horde', true);
+}
+require KRONOLITH_TEMPLATES . '/common-header.inc';
+$user = Auth::getAuth();
+if ($user != '') {
+if ($print_view) {
+    require $registry->get('templates', 'horde') . '/javascript/print.js';
+} else {
+    require KRONOLITH_TEMPLATES . '/menu.inc';
+}
+
+echo '<div id="page">';
+}
+else {
+	echo '<div id="page" style="margin-right: 0;">';
+}
+if (!$print_view) {
+    Kronolith::tabs();
+}
+$view->html(KRONOLITH_TEMPLATES);
+echo '</div>';
+
+if ($print_view) {
+    require KRONOLITH_TEMPLATES . '/calendar_titles.inc';
+} else {
+    require KRONOLITH_TEMPLATES . '/panel.inc';
+}
+require $registry->get('templates', 'horde') . '/common-footer.inc';
+</code>
+
+



More information about the cvs mailing list