phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] sitemgr modules/class.module_calendar.inc.php s... [s


From: Dave Hall
Subject: [Phpgroupware-cvs] sitemgr modules/class.module_calendar.inc.php s... [skwashd-16-compat]
Date: Mon, 21 Aug 2006 12:59:11 +0000

CVSROOT:        /cvsroot/phpgroupware
Module name:    sitemgr
Branch:         skwashd-16-compat
Changes by:     Dave Hall <skwashd>     06/08/21 12:59:11

Modified files:
        modules        : class.module_calendar.inc.php 
Added files:
        sitemgr-site/templates/default/modules/calendar: list.tpl 
Removed files:
        sitemgr-site/templates/default/modules/calendar: mini_cal.tpl 

Log message:
        new look calendar module, a lot better looking, although it still needs 
some polish

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/sitemgr/modules/class.module_calendar.inc.php?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&r1=1.1.2.1.4.1&r2=1.1.2.1.4.2
http://cvs.savannah.gnu.org/viewcvs/sitemgr/sitemgr-site/templates/default/modules/calendar/list.tpl?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/sitemgr/sitemgr-site/templates/default/modules/calendar/mini_cal.tpl?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&r1=1.1&r2=0

Patches:
Index: modules/class.module_calendar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/modules/class.module_calendar.inc.php,v
retrieving revision 1.1.2.1.4.1
retrieving revision 1.1.2.1.4.2
diff -u -b -r1.1.2.1.4.1 -r1.1.2.1.4.2
--- modules/class.module_calendar.inc.php       24 Jul 2006 03:31:54 -0000      
1.1.2.1.4.1
+++ modules/class.module_calendar.inc.php       21 Aug 2006 12:59:11 -0000      
1.1.2.1.4.2
@@ -23,8 +23,10 @@
 
     function get_content(&$arguments,$properties)
     {
-               //TODO Look at caching - skwashd jun-2006
-               $t = createObject('phpgwapi.Template');
+               $this->template = createObject('phpgwapi.Template');
+               $this->template->set_root($this->find_template_dir());
+               $this->template->set_file('cal', 'list.tpl');
+               $this->template->set_block('cal', 'event', 'events');
 
                $this->bo->read_holidays(date('Y'));
 
@@ -34,8 +36,6 @@
                list($start['d'], $start['m'], $start['y']) = explode('-', 
date('d-n-Y'));
                list($end['d'], $end['m'], $end['y']) = explode('-', 
date('d-n-Y', strtotime('+1 month')));
                
-               $str = $this->_get_css();
-
                $ids = array();
                $ids += $cal->list_events($start['y'], $start['m'], 
$start['d'], $end['y'], $end['m'], $end['d']);
                $ids += $cal->list_repeated_events($start['y'], $start['m'], 
$start['d'], $end['y'], $end['m'], $end['d']);
@@ -45,99 +45,28 @@
                        return lang('no events');
                }
                
+               $lang_more = lang('read more');
+
                foreach ( $ids as $id )
                {
                        $event = $cal->read_entry($id);
                        $time_str = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['timeformat'] == 12 ? 
'g:i a' : 'H:i';
                        $date_str = date("d M||$time_str", 
mktime($event['start']['hour'], $event['start']['min'], $event['start']['sec'], 
$event['start']['month'], $event['start']['mday'], $event['start']['year']));
                        list($fmtd_date, $fmtd_time) = explode('||', $date_str);
-/* TODO Consider implementing the hcal microformat - need some more work and a 
decision on xhtml - skwashd jun-2006
-$str .= <<<EOT
-                       
-                       <div id="cal_123" class="cal_block vevent">
-                               <abbr class="dtstart dtstamp" 
title="2005-10-05">{$fmtd_date}</abbr>
-                               <span class="details" 
onclick="document.getElementById('descr_123').style.display = 'block'; return 
true;">                             
-                               <h3>
-                                       <abbr class="dtend" 
title="2005-10-08">7:00 am</abbr> -
-                                       <span class="summary">Demo Event</span>
-                               </h3>
-                               <span class="location">Somewhere</span>
-                               <p class="description" id="descr_123">
-                                       More info here<br>
-                                       <a href="#" class="url">[more info]</a>
-                               </p>
-                       </div>
-EOT;
-*/
-                       $str .= <<<EOT
-                       
-                       <div id="cal_123" class="vevent">
-                               <span class="event_date">{$fmtd_date}</span>
-                               <span class="event_details" 
onclick="document.getElementById('descr_{$id}').style.display = 'block'; return 
true;">                             
-                               <h3>
-                                       <span 
class="event_start">{$fmtd_time}</span> -
-                                       <span 
class="event_summary">{$event['title']}</span>
-                               </h3>
-                               <span 
class="location">{$event['location']}</span>
-                               <p class="event_description" id="descr_{$id}">
-                                       {$event['description']} 
-                               </p>
-                       </div>
-EOT;
-
-               }
-               //FIXME use templates - skwashd jun-2006
-               return $str;
-       }
 
-       function _get_css()
-       {
-               //FIXME move to template stylesheet definitions - dependent on 
final decision re xhtml/hcal - skwashd jun-2006
-               $str = <<<EOT
-               <style type="text/css">
-                       .vevent
-                       {
-                               clear: both;
-                       }
-                       
-                       .vevent a
-                       {
-                               text-decoration: none;
-                       }
-                       
-                       .event_date
-                       {
-                               background-color: #eee;
-                               border: 0px solid #000;
-                               border-width: 0px 1px 1px 0px;
-                               display: block;
-                               font-size: 20px;
-                               font-weight: bold;
-                               float: left;
-                               margin: 2px 10px;
-                               padding: 3px;
-                               text-align: center;
-                               width: 50px;
-                       }
-
-                       .vevent p
-                       {
-                               margin: 3px 0px;
-                       }
-
-                       .vevent .event_description
-                       {
-                               display: none;
-                       }
-
-                       .vevent .event_details
-                       {
-                               display: block;
-                               margin-left: 75px;
+                       $this->template->set_var(array
+                       (
+                               'event_descr'   => $event['description'],
+                               'event_id'              => $id,
+                               'event_loc'             => $event['location'],
+                               'event_title'   => $event['title'],
+                               'fmtd_date'             => $fmtd_date,
+                               'fmtd_time'             => $fmtd_time,
+                               'lang_more'             => $lang_more
+                       ));
+                       $this->template->parse('events', 'event');
                        }
-               </style>
-EOT;
-               return $str;
+               return $this->template->parse('out', 'cal');
        }
 }
 ?>

Index: sitemgr-site/templates/default/modules/calendar/list.tpl
===================================================================
RCS file: sitemgr-site/templates/default/modules/calendar/list.tpl
diff -N sitemgr-site/templates/default/modules/calendar/list.tpl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ sitemgr-site/templates/default/modules/calendar/list.tpl    21 Aug 2006 
12:59:11 -0000      1.1.2.1
@@ -0,0 +1,63 @@
+                       <style type="text/css">
+                               .vevent
+                               {
+                                       clear: both;
+                               }
+                               
+                               .vevent a
+                               {
+                                       text-decoration: none;
+                               }
+                               
+                               .event_date
+                               {
+                                       background-color: #eee;
+                                       border: 0px solid #000;
+                                       border-width: 0px 1px 1px 0px;
+                                       display: block;
+                                       font-size: 20px;
+                                       font-weight: bold;
+                                       float: left;
+                                       margin: 2px 10px;
+                                       padding: 3px;
+                                       text-align: center;
+                                       width: 50px;
+                               }
+
+                               .vevent p
+                               {
+                                       margin: 3px 0px;
+                               }
+
+                               .vevent .event_description
+                               {
+                                       display: none;
+                               }
+
+                               .vevent .event_details
+                               {
+                                       display: block;
+                                       margin-left: 75px;
+                               }
+
+                               .cal_more
+                               {
+                                       font-size: small;
+                               }
+                       </style>
+                       <!-- BEGIN event -->
+                       <div id="cal_{event_id}" class="vevent">
+                               <span class="event_date">{fmtd_date}</span>
+                               <div class="event_details" 
onclick="document.getElementById('cal_more_{event_id}').style.display = 'none'; 
document.getElementById('descr_{event_id}').style.display = 'block';">          
                     
+                                       <h3>
+                                               <span 
class="event_start">{fmtd_time}</span> -
+                                               <span 
class="event_summary">{event_title}</span>
+                                       </h3>
+                               <div>
+                               <span class="location">{event_loc}</span>
+                               <span class="cal_more" 
id="cal_more_{event_id}">[{lang_more}]</span>
+                               <div class="event_description" 
id="descr_{event_id}">
+                                       {event_descr}   
+                               </div>
+                       </div>
+                       <!-- END event -->

Index: sitemgr-site/templates/default/modules/calendar/mini_cal.tpl
===================================================================
RCS file: sitemgr-site/templates/default/modules/calendar/mini_cal.tpl
diff -N sitemgr-site/templates/default/modules/calendar/mini_cal.tpl
--- sitemgr-site/templates/default/modules/calendar/mini_cal.tpl        4 Mar 
2003 17:28:09 -0000       1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@
-<!-- $Id: mini_cal.tpl,v 1.1 2003/03/04 17:28:09 totschnig Exp $ -->
-<!-- BEGIN mini_cal -->
-<table border="0" cellspacing="0" cellpadding="0" valign="top" width="80" 
cols="7">
- <tr valign="middle">
-  <td align="left" colspan=4><font 
size="-2">&nbsp;&nbsp;&nbsp;&nbsp;<b>{month}</b></font></td>
-  <td align="right" colspan=3>{navig}</td>
- </tr>
- <tr>
-  <td align="center" colspan=7><img src="{cal_img_root}" width="90%" 
height="5"></td>
- </tr>
- <tr valign="top">
-  <td colspan="7">
-   <table border="0" width="100%" cellspacing="7" cellpadding="0" valign="top" 
cols="7">
-    <tr>{daynames}    </tr>{display_monthweek}   </table>
-  </td>
- </tr>
-</table>
-<!-- END mini_cal -->
-<!-- BEGIN mini_week -->
-    <tr>{monthweek_day}
-    </tr>
-<!-- END mini_week -->
-<!-- BEGIN mini_day -->
-     <td align="center"{day_image}><font size="-2">{dayname}</font></td>
-<!-- END mini_day -->




reply via email to

[Prev in Thread] Current Thread [Next in Thread]