Completed
Push — 14.2 ( e07840...cec2da )
by Ralf
83:18 queued 52:04
created
calendar/inc/class.calendar_import_ical.inc.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
 	private $bo;
65 65
 
66 66
 	/**
67
-	* For figuring out if an entry has changed
68
-	*/
67
+	 * For figuring out if an entry has changed
68
+	 */
69 69
 	protected $tracking;
70 70
 
71 71
 	/**
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
 	protected $errors = array();
95 95
 
96 96
 	/**
97
-         * List of actions, and how many times that action was taken
98
-         */
99
-        protected $results = array();
97
+	 * List of actions, and how many times that action was taken
98
+	 */
99
+		protected $results = array();
100 100
 
101 101
 	/**
102 102
 	 * imports entries according to given definition object.
@@ -202,39 +202,39 @@  discard block
 block discarded – undo
202 202
 	}
203 203
 
204 204
 	/**
205
-        * Returns warnings that were encountered during importing
206
-        * Maximum of one warning message per record, but you can append if you need to
207
-        *
208
-        * @return Array (
209
-        *       record_# => warning message
210
-        *       )
211
-        */
212
-        public function get_warnings() {
205
+	 * Returns warnings that were encountered during importing
206
+	 * Maximum of one warning message per record, but you can append if you need to
207
+	 *
208
+	 * @return Array (
209
+	 *       record_# => warning message
210
+	 *       )
211
+	 */
212
+		public function get_warnings() {
213 213
 		return $this->warnings;
214 214
 	}
215 215
 
216 216
 	/**
217
-        * Returns errors that were encountered during importing
218
-        * Maximum of one error message per record, but you can append if you need to
219
-        *
220
-        * @return Array (
221
-        *       record_# => error message
222
-        *       )
223
-        */
224
-        public function get_errors() {
217
+	 * Returns errors that were encountered during importing
218
+	 * Maximum of one error message per record, but you can append if you need to
219
+	 *
220
+	 * @return Array (
221
+	 *       record_# => error message
222
+	 *       )
223
+	 */
224
+		public function get_errors() {
225 225
 		return $this->errors;
226 226
 	}
227 227
 
228 228
 	/**
229
-        * Returns a list of actions taken, and the number of records for that action.
230
-        * Actions are things like 'insert', 'update', 'delete', and may be different for each plugin.
231
-        *
232
-        * @return Array (
233
-        *       action => record count
234
-        * )
235
-        */
236
-        public function get_results() {
237
-                return $this->results;
238
-        }
229
+	 * Returns a list of actions taken, and the number of records for that action.
230
+	 * Actions are things like 'insert', 'update', 'delete', and may be different for each plugin.
231
+	 *
232
+	 * @return Array (
233
+	 *       action => record count
234
+	 * )
235
+	 */
236
+		public function get_results() {
237
+				return $this->results;
238
+		}
239 239
 } // end of iface_export_plugin
240 240
 ?>
Please login to merge, or discard this patch.
calendar/inc/class.calendar_ui.inc.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -455,11 +455,11 @@  discard block
 block discarded – undo
455 455
 	}
456 456
 
457 457
 	/**
458
-	* gets the icons displayed for a given event
459
-	*
460
-	* @param array $event
461
-	* @return array of 'img' / 'title' pairs
462
-	*/
458
+	 * gets the icons displayed for a given event
459
+	 *
460
+	 * @param array $event
461
+	 * @return array of 'img' / 'title' pairs
462
+	 */
463 463
 	function event_icons($event)
464 464
 	{
465 465
 		$is_private = !$event['public'] && !$this->bo->check_perms(EGW_ACL_READ,$event);
@@ -519,9 +519,9 @@  discard block
 block discarded – undo
519 519
 	}
520 520
 
521 521
 	/**
522
-	* Create a select-box item in the sidebox-menu
523
-	* @privat used only by sidebox_menu !
524
-	*/
522
+	 * Create a select-box item in the sidebox-menu
523
+	 * @privat used only by sidebox_menu !
524
+	 */
525 525
 	function _select_box($title,$name,$options,$width='99%')
526 526
 	{
527 527
 		$select = " <select style=\"width: $width;\" name=\"".$name.'" id="calendar_'.$name.'" title="'.
Please login to merge, or discard this patch.
calendar/inc/class.calendar_sif.inc.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -407,14 +407,14 @@  discard block
 block discarded – undo
407 407
 	}
408 408
 
409 409
 	/**
410
-	* @return int event id
411
-	* @param string	$_sifdata   the SIFE data
412
-	* @param int	$_calID=-1	the internal addressbook id
413
-	* @param boolean $merge=false	merge data with existing entry
414
-	* @param int $recur_date=0 if set, import the recurrence at this timestamp,
415
-	*                          default 0 => import whole series (or events, if not recurring)
416
-	* @desc import a SIFE into the calendar
417
-	*/
410
+	 * @return int event id
411
+	 * @param string	$_sifdata   the SIFE data
412
+	 * @param int	$_calID=-1	the internal addressbook id
413
+	 * @param boolean $merge=false	merge data with existing entry
414
+	 * @param int $recur_date=0 if set, import the recurrence at this timestamp,
415
+	 *                          default 0 => import whole series (or events, if not recurring)
416
+	 * @desc import a SIFE into the calendar
417
+	 */
418 418
 	function addSIF($_sifdata, $_calID=-1, $merge=false, $recur_date=0)
419 419
 	{
420 420
 		if ($this->log)
@@ -794,13 +794,13 @@  discard block
 block discarded – undo
794 794
 	}
795 795
 
796 796
 	/**
797
-	* return a sife
798
-	*
799
-	* @param int	$_id		the id of the event
800
-	* @param int $recur_date=0	if set export the next recurrence at or after the timestamp,
801
-	*                          	default 0 => export whole series (or events, if not recurring)
802
-	* @return string containing the SIFE
803
-	*/
797
+	 * return a sife
798
+	 *
799
+	 * @param int	$_id		the id of the event
800
+	 * @param int $recur_date=0	if set export the next recurrence at or after the timestamp,
801
+	 *                          	default 0 => export whole series (or events, if not recurring)
802
+	 * @return string containing the SIFE
803
+	 */
804 804
 	function getSIF($_id, $recur_date=0)
805 805
 	{
806 806
 		if ($this->log)
@@ -1166,13 +1166,13 @@  discard block
 block discarded – undo
1166 1166
 	}
1167 1167
 
1168 1168
 	/**
1169
-	* Set the supported fields
1170
-	*
1171
-	* Currently we only store name and version, manucfacturer is always Funambol
1172
-	*
1173
-	* @param string $_productName
1174
-	* @param string $_productSoftwareVersion
1175
-	*/
1169
+	 * Set the supported fields
1170
+	 *
1171
+	 * Currently we only store name and version, manucfacturer is always Funambol
1172
+	 *
1173
+	 * @param string $_productName
1174
+	 * @param string $_productSoftwareVersion
1175
+	 */
1176 1176
 	function setSupportedFields($_productName='', $_productSoftwareVersion='')
1177 1177
 	{
1178 1178
 		$state =& $_SESSION['SyncML.state'];
Please login to merge, or discard this patch.
calendar/inc/class.calendar_activesync.inc.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@
 block discarded – undo
177 177
 	 * @param int $cutoffdate =null
178 178
 	 * @param array $not_uids =null uids NOT to return for meeting requests
179 179
 	 * @return array
180
-  	 */
180
+	 */
181 181
 	function GetMessageList($id, $cutoffdate=NULL, array $not_uids=null)
182 182
 	{
183 183
 		if (!isset($this->calendar)) $this->calendar = new calendar_boupdate();
Please login to merge, or discard this patch.
calendar/inc/class.calendar_uiforms.inc.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2452,7 +2452,7 @@  discard block
 block discarded – undo
2452 2452
 	 */
2453 2453
 	function export($content=0,$return_error=false)
2454 2454
 	{
2455
-        $boical = new calendar_ical();
2455
+		$boical = new calendar_ical();
2456 2456
 		#error_log(__METHOD__.print_r($content,true));
2457 2457
 		if (is_numeric($cal_id = $content ? $content : $_REQUEST['cal_id']))
2458 2458
 		{
@@ -2616,8 +2616,8 @@  discard block
 block discarded – undo
2616 2616
 	}
2617 2617
 
2618 2618
 	/**
2619
-	* Set up the required fields to get the history tab
2620
-	*/
2619
+	 * Set up the required fields to get the history tab
2620
+	 */
2621 2621
 	public function setup_history(&$content, &$sel_options)
2622 2622
 	{
2623 2623
 		$status = 'history_status';
Please login to merge, or discard this patch.
calendar/inc/class.calendar_ical.inc.php 1 patch
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -480,15 +480,15 @@  discard block
 block discarded – undo
480 480
 									{
481 481
 										$user = $this->resource_info($this->user);
482 482
 										$attributes['ATTENDEE'][] = 'mailto:' . $user['email'];
483
-			    						$parameters['ATTENDEE'][] = array(
484
-			    							'CN'		=>	$user['name'],
485
-			    							'ROLE'		=> 'REQ-PARTICIPANT',
483
+										$parameters['ATTENDEE'][] = array(
484
+											'CN'		=>	$user['name'],
485
+											'ROLE'		=> 'REQ-PARTICIPANT',
486 486
 											'PARTSTAT'	=> 'NEEDS-ACTION',
487 487
 											'CUTYPE'	=> 'INDIVIDUAL',
488 488
 											'RSVP'		=> 'TRUE',
489 489
 											'X-EGROUPWARE-UID'	=> (string)$this->user,
490
-			    						);
491
-			    						$event['participants'][$this->user] = true;
490
+										);
491
+										$event['participants'][$this->user] = true;
492 492
 									}
493 493
 									break;
494 494
 								case 'r':
@@ -540,24 +540,24 @@  discard block
 block discarded – undo
540 540
 						}
541 541
 						break;
542 542
 
543
-    				case 'ORGANIZER':
544
-	    				if (!$organizerURL)
545
-	    				{
546
-	    					$organizerCN = '"' . trim($GLOBALS['egw']->accounts->id2name($event['owner'],'account_firstname')
547
-			    				. ' ' . $GLOBALS['egw']->accounts->id2name($event['owner'],'account_lastname')) . '"';
548
-			    			$organizerEMail = $GLOBALS['egw']->accounts->id2name($event['owner'],'account_email');
549
-			    			if ($version == '1.0')
550
-			    			{
551
-		    					$organizerURL = trim($organizerCN . (empty($organizerURL) ? '' : ' <' . $organizerURL .'>'));
552
-			    			}
553
-			    			else
554
-			    			{
555
-		    					$organizerURL = empty($organizerEMail) ? '' : 'mailto:' . $organizerEMail;
556
-			    			}
557
-			    			$organizerUID = $event['owner'];
558
-		    				if (!isset($event['participants'][$event['owner']]))
559
-		    				{
560
-			    				$options = array(
543
+					case 'ORGANIZER':
544
+						if (!$organizerURL)
545
+						{
546
+							$organizerCN = '"' . trim($GLOBALS['egw']->accounts->id2name($event['owner'],'account_firstname')
547
+								. ' ' . $GLOBALS['egw']->accounts->id2name($event['owner'],'account_lastname')) . '"';
548
+							$organizerEMail = $GLOBALS['egw']->accounts->id2name($event['owner'],'account_email');
549
+							if ($version == '1.0')
550
+							{
551
+								$organizerURL = trim($organizerCN . (empty($organizerURL) ? '' : ' <' . $organizerURL .'>'));
552
+							}
553
+							else
554
+							{
555
+								$organizerURL = empty($organizerEMail) ? '' : 'mailto:' . $organizerEMail;
556
+							}
557
+							$organizerUID = $event['owner'];
558
+							if (!isset($event['participants'][$event['owner']]))
559
+							{
560
+								$options = array(
561 561
 									'ROLE'     => 'CHAIR',
562 562
 									'PARTSTAT' => 'DELEGATED',
563 563
 									'CUTYPE'   => 'INDIVIDUAL',
@@ -567,20 +567,20 @@  discard block
 block discarded – undo
567 567
 								if (!empty($organizerEMail)) $options['EMAIL'] = $organizerEMail;
568 568
 								if (!empty($event['owner'])) $options['X-EGROUPWARE-UID'] = $event['owner'];
569 569
 								$attributes['ATTENDEE'][] = $organizerURL;
570
-			    				$parameters['ATTENDEE'][] = $options;
571
-		    				}
572
-	    				}
573
-    					// do NOT use ORGANIZER for events without further participants or a different organizer
574
-	    				if (count($event['participants']) > 1 || !isset($event['participants'][$event['owner']]))
575
-	    				{
576
-		    				$attributes['ORGANIZER'] = $organizerURL;
577
-		    				$parameters['ORGANIZER']['CN'] = $organizerCN;
578
-		    				if (!empty($organizerUID))
579
-		    				{
580
-			    				$parameters['ORGANIZER']['X-EGROUPWARE-UID'] = $organizerUID;
581
-		    				}
582
-	    				}
583
-	    				break;
570
+								$parameters['ATTENDEE'][] = $options;
571
+							}
572
+						}
573
+						// do NOT use ORGANIZER for events without further participants or a different organizer
574
+						if (count($event['participants']) > 1 || !isset($event['participants'][$event['owner']]))
575
+						{
576
+							$attributes['ORGANIZER'] = $organizerURL;
577
+							$parameters['ORGANIZER']['CN'] = $organizerCN;
578
+							if (!empty($organizerUID))
579
+							{
580
+								$parameters['ORGANIZER']['X-EGROUPWARE-UID'] = $organizerUID;
581
+							}
582
+						}
583
+						break;
584 584
 
585 585
 					case 'DTSTART':
586 586
 						if (empty($event['whole_day']))
@@ -989,12 +989,12 @@  discard block
 block discarded – undo
989 989
 				foreach (is_array($value) && $parameters[$key]['VALUE']!='DATE' ? $value : array($value) as $valueID => $valueData)
990 990
 				{
991 991
 					$valueData = translation::convert($valueData,translation::charset(),$charset);
992
-                    $paramData = (array) translation::convert(is_array($value) ?
993
-                    		$parameters[$key][$valueID] : $parameters[$key],
994
-                            translation::charset(),$charset);
995
-                    $valuesData = (array) translation::convert($values[$key],
996
-                    		translation::charset(),$charset);
997
-                    $content = $valueData . implode(';', $valuesData);
992
+					$paramData = (array) translation::convert(is_array($value) ?
993
+							$parameters[$key][$valueID] : $parameters[$key],
994
+							translation::charset(),$charset);
995
+					$valuesData = (array) translation::convert($values[$key],
996
+							translation::charset(),$charset);
997
+					$content = $valueData . implode(';', $valuesData);
998 998
 
999 999
 					if ($version == '1.0' && (preg_match('/[^\x20-\x7F]/', $content) ||
1000 1000
 						($paramData['CN'] && preg_match('/[^\x20-\x7F]/', $paramData['CN']))))
@@ -2230,7 +2230,7 @@  discard block
 block discarded – undo
2230 2230
 	 * @param string|resource $_vcalData
2231 2231
 	 * @param string $principalURL ='' Used for CalDAV imports
2232 2232
 	 * @param string $charset  The encoding charset for $text. Defaults to
2233
-     *                         utf-8 for new format, iso-8859-1 for old format.
2233
+	 *                         utf-8 for new format, iso-8859-1 for old format.
2234 2234
 	 * @return Iterator|array|boolean Iterator if resource given or array of events on success, false on failure
2235 2235
 	 */
2236 2236
 	function icaltoegw($_vcalData, $principalURL='', $charset=null)
@@ -2747,10 +2747,10 @@  discard block
 block discarded – undo
2747 2747
 					// fall throught
2748 2748
 				case 'ATTENDEE':
2749 2749
 					if (isset($attributes['params']['PARTSTAT']))
2750
-				    {
2751
-				    	$attributes['params']['STATUS'] = $attributes['params']['PARTSTAT'];
2752
-				    }
2753
-				    if (isset($attributes['params']['STATUS']))
2750
+					{
2751
+						$attributes['params']['STATUS'] = $attributes['params']['PARTSTAT'];
2752
+					}
2753
+					if (isset($attributes['params']['STATUS']))
2754 2754
 					{
2755 2755
 						$status = $this->status_ical2egw[strtoupper($attributes['params']['STATUS'])];
2756 2756
 						if (empty($status)) $status = 'X';
@@ -3141,7 +3141,7 @@  discard block
 block discarded – undo
3141 3141
 				array2string($event)."\n",3,$this->logfile);
3142 3142
 		}
3143 3143
 		//Horde::logMessage("vevent2egw:\n" . print_r($event, true),
3144
-        //    	__FILE__, __LINE__, PEAR_LOG_DEBUG);
3144
+		//    	__FILE__, __LINE__, PEAR_LOG_DEBUG);
3145 3145
 		return $event;
3146 3146
 	}
3147 3147
 
Please login to merge, or discard this patch.
phpgwapi/js/jscalendar/test.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 if (preg_match('/^[a-z0-9-]+$/i', $_REQUEST['lang'])) {
4
-    $lang = $_REQUEST['lang'];
4
+	$lang = $_REQUEST['lang'];
5 5
 }
6 6
 else {
7
-    $lang = 'en';
7
+	$lang = 'en';
8 8
 }
9 9
 setcookie('lang', $lang);
10 10
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 <h1>Form submitted</h1>
48 48
 
49 49
 <?php foreach ($_REQUEST as $key => $val) {
50
-    echo htmlspecialchars($key) . ' = ' . htmlspecialchars($val) . '<br />';
50
+	echo htmlspecialchars($key) . ' = ' . htmlspecialchars($val) . '<br />';
51 51
 } ?>
52 52
 
53 53
 <?php } else { ?>
@@ -60,16 +60,16 @@  discard block
 block discarded – undo
60 60
 $cwd = getcwd();
61 61
 chdir('lang');
62 62
 foreach (glob('*.js') as $filename) {
63
-    $l = preg_replace('/(^calendar-|.js$)/', '', $filename);
64
-    $selected = '';
65
-    if ($l == $lang)
66
-        $selected = 'selected="selected" ';
67
-    $display = $l;
68
-    if ($l == 'en')
69
-        $display = 'EN';
70
-    echo '<option ' . $selected . 'value="' . $l . '">' . $display . '</option>';
63
+	$l = preg_replace('/(^calendar-|.js$)/', '', $filename);
64
+	$selected = '';
65
+	if ($l == $lang)
66
+		$selected = 'selected="selected" ';
67
+	$display = $l;
68
+	if ($l == 'en')
69
+		$display = 'EN';
70
+	echo '<option ' . $selected . 'value="' . $l . '">' . $display . '</option>';
71 71
 }
72
-     ?>
72
+	 ?>
73 73
      </select>
74 74
      <blockquote style="font-size: 90%">
75 75
        <b>NOTE</b>: as of this release, 0.9.6, only "EN" and "RO", which I
@@ -90,16 +90,16 @@  discard block
 block discarded – undo
90 90
      </td>
91 91
      <td>
92 92
        <?php $calendar->make_input_field(
93
-           // calendar options go here; see the documentation and/or calendar-setup.js
94
-           array('firstDay'       => 1, // show Monday first
95
-                 'showsTime'      => true,
96
-                 'showOthers'     => true,
97
-                 'ifFormat'       => '%Y-%m-%d %I:%M %P',
98
-                 'timeFormat'     => '12'),
99
-           // field attributes go here
100
-           array('style'       => 'width: 15em; color: #840; background-color: #ff8; border: 1px solid #000; text-align: center',
101
-                 'name'        => 'date1',
102
-                 'value'       => strftime('%Y-%m-%d %I:%M %P', strtotime('now')))); ?>
93
+		   // calendar options go here; see the documentation and/or calendar-setup.js
94
+		   array('firstDay'       => 1, // show Monday first
95
+				 'showsTime'      => true,
96
+				 'showOthers'     => true,
97
+				 'ifFormat'       => '%Y-%m-%d %I:%M %P',
98
+				 'timeFormat'     => '12'),
99
+		   // field attributes go here
100
+		   array('style'       => 'width: 15em; color: #840; background-color: #ff8; border: 1px solid #000; text-align: center',
101
+				 'name'        => 'date1',
102
+				 'value'       => strftime('%Y-%m-%d %I:%M %P', strtotime('now')))); ?>
103 103
      </td>
104 104
      </tr>
105 105
      </table>
Please login to merge, or discard this patch.
phpgwapi/js/jscalendar/calendar.php 1 patch
Indentation   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -13,107 +13,107 @@
 block discarded – undo
13 13
 define('NEWLINE', "\n");
14 14
 
15 15
 class DHTML_Calendar {
16
-    var $calendar_lib_path;
17
-
18
-    var $calendar_file;
19
-    var $calendar_lang_file;
20
-    var $calendar_setup_file;
21
-    var $calendar_theme_file;
22
-    var $calendar_options;
23
-
24
-    function DHTML_Calendar($calendar_lib_path = '/calendar/',
25
-                            $lang              = 'en',
26
-                            $theme             = 'calendar-win2k-1',
27
-                            $stripped          = true) {
28
-        if ($stripped) {
29
-            $this->calendar_file = 'calendar_stripped.js';
30
-            $this->calendar_setup_file = 'calendar-setup_stripped.js';
31
-        } else {
32
-            $this->calendar_file = 'calendar.js';
33
-            $this->calendar_setup_file = 'calendar-setup.js';
34
-        }
35
-        $this->calendar_lang_file = 'lang/calendar-' . $lang . '.js';
36
-        $this->calendar_theme_file = $theme.'.css';
37
-        $this->calendar_lib_path = preg_replace('/\/+$/', '/', $calendar_lib_path);
38
-        $this->calendar_options = array('ifFormat' => '%Y/%m/%d',
39
-                                        'daFormat' => '%Y/%m/%d');
40
-    }
41
-
42
-    function set_option($name, $value) {
43
-        $this->calendar_options[$name] = $value;
44
-    }
45
-
46
-    function load_files() {
47
-        echo $this->get_load_files_code();
48
-    }
49
-
50
-    function get_load_files_code() {
51
-        $code  = ( '<link rel="stylesheet" type="text/css" media="all" href="' .
52
-                   $this->calendar_lib_path . $this->calendar_theme_file .
53
-                   '" />' . NEWLINE );
54
-        $code .= ( '<script type="text/javascript" src="' .
55
-                   $this->calendar_lib_path . $this->calendar_file .
56
-                   '"></script>' . NEWLINE );
57
-        $code .= ( '<script type="text/javascript" src="' .
58
-                   $this->calendar_lib_path . $this->calendar_lang_file .
59
-                   '"></script>' . NEWLINE );
60
-        $code .= ( '<script type="text/javascript" src="' .
61
-                   $this->calendar_lib_path . $this->calendar_setup_file .
62
-                   '"></script>' );
63
-        return $code;
64
-    }
65
-
66
-    function _make_calendar($other_options = array()) {
67
-        $js_options = $this->_make_js_hash(array_merge($this->calendar_options, $other_options));
68
-        $code  = ( '<script type="text/javascript">Calendar.setup({' .
69
-                   $js_options .
70
-                   '});</script>' );
71
-        return $code;
72
-    }
73
-
74
-    function make_input_field($cal_options = array(), $field_attributes = array()) {
75
-        $id = $this->_gen_id();
76
-        $attrstr = $this->_make_html_attr(array_merge($field_attributes,
77
-                                                      array('id'   => $this->_field_id($id),
78
-                                                            'type' => 'text')));
79
-        echo '<input ' . $attrstr .'/>';
80
-        echo '<a href="#" id="'. $this->_trigger_id($id) . '">' .
81
-            '<img align="middle" border="0" src="' . $this->calendar_lib_path . 'img.gif" alt="" /></a>';
82
-
83
-        $options = array_merge($cal_options,
84
-                               array('inputField' => $this->_field_id($id),
85
-                                     'button'     => $this->_trigger_id($id)));
86
-        echo $this->_make_calendar($options);
87
-    }
88
-
89
-    /// PRIVATE SECTION
90
-
91
-    function _field_id($id) { return 'f-calendar-field-' . $id; }
92
-    function _trigger_id($id) { return 'f-calendar-trigger-' . $id; }
93
-    function _gen_id() { static $id = 0; return ++$id; }
94
-
95
-    function _make_js_hash($array) {
96
-        $jstr = '';
97
-        reset($array);
98
-        while (list($key, $val) = each($array)) {
99
-            if (is_bool($val))
100
-                $val = $val ? 'true' : 'false';
101
-            else if (!is_numeric($val))
102
-                $val = '"'.$val.'"';
103
-            if ($jstr) $jstr .= ',';
104
-            $jstr .= '"' . $key . '":' . $val;
105
-        }
106
-        return $jstr;
107
-    }
108
-
109
-    function _make_html_attr($array) {
110
-        $attrstr = '';
111
-        reset($array);
112
-        while (list($key, $val) = each($array)) {
113
-            $attrstr .= $key . '="' . $val . '" ';
114
-        }
115
-        return $attrstr;
116
-    }
16
+	var $calendar_lib_path;
17
+
18
+	var $calendar_file;
19
+	var $calendar_lang_file;
20
+	var $calendar_setup_file;
21
+	var $calendar_theme_file;
22
+	var $calendar_options;
23
+
24
+	function DHTML_Calendar($calendar_lib_path = '/calendar/',
25
+							$lang              = 'en',
26
+							$theme             = 'calendar-win2k-1',
27
+							$stripped          = true) {
28
+		if ($stripped) {
29
+			$this->calendar_file = 'calendar_stripped.js';
30
+			$this->calendar_setup_file = 'calendar-setup_stripped.js';
31
+		} else {
32
+			$this->calendar_file = 'calendar.js';
33
+			$this->calendar_setup_file = 'calendar-setup.js';
34
+		}
35
+		$this->calendar_lang_file = 'lang/calendar-' . $lang . '.js';
36
+		$this->calendar_theme_file = $theme.'.css';
37
+		$this->calendar_lib_path = preg_replace('/\/+$/', '/', $calendar_lib_path);
38
+		$this->calendar_options = array('ifFormat' => '%Y/%m/%d',
39
+										'daFormat' => '%Y/%m/%d');
40
+	}
41
+
42
+	function set_option($name, $value) {
43
+		$this->calendar_options[$name] = $value;
44
+	}
45
+
46
+	function load_files() {
47
+		echo $this->get_load_files_code();
48
+	}
49
+
50
+	function get_load_files_code() {
51
+		$code  = ( '<link rel="stylesheet" type="text/css" media="all" href="' .
52
+				   $this->calendar_lib_path . $this->calendar_theme_file .
53
+				   '" />' . NEWLINE );
54
+		$code .= ( '<script type="text/javascript" src="' .
55
+				   $this->calendar_lib_path . $this->calendar_file .
56
+				   '"></script>' . NEWLINE );
57
+		$code .= ( '<script type="text/javascript" src="' .
58
+				   $this->calendar_lib_path . $this->calendar_lang_file .
59
+				   '"></script>' . NEWLINE );
60
+		$code .= ( '<script type="text/javascript" src="' .
61
+				   $this->calendar_lib_path . $this->calendar_setup_file .
62
+				   '"></script>' );
63
+		return $code;
64
+	}
65
+
66
+	function _make_calendar($other_options = array()) {
67
+		$js_options = $this->_make_js_hash(array_merge($this->calendar_options, $other_options));
68
+		$code  = ( '<script type="text/javascript">Calendar.setup({' .
69
+				   $js_options .
70
+				   '});</script>' );
71
+		return $code;
72
+	}
73
+
74
+	function make_input_field($cal_options = array(), $field_attributes = array()) {
75
+		$id = $this->_gen_id();
76
+		$attrstr = $this->_make_html_attr(array_merge($field_attributes,
77
+													  array('id'   => $this->_field_id($id),
78
+															'type' => 'text')));
79
+		echo '<input ' . $attrstr .'/>';
80
+		echo '<a href="#" id="'. $this->_trigger_id($id) . '">' .
81
+			'<img align="middle" border="0" src="' . $this->calendar_lib_path . 'img.gif" alt="" /></a>';
82
+
83
+		$options = array_merge($cal_options,
84
+							   array('inputField' => $this->_field_id($id),
85
+									 'button'     => $this->_trigger_id($id)));
86
+		echo $this->_make_calendar($options);
87
+	}
88
+
89
+	/// PRIVATE SECTION
90
+
91
+	function _field_id($id) { return 'f-calendar-field-' . $id; }
92
+	function _trigger_id($id) { return 'f-calendar-trigger-' . $id; }
93
+	function _gen_id() { static $id = 0; return ++$id; }
94
+
95
+	function _make_js_hash($array) {
96
+		$jstr = '';
97
+		reset($array);
98
+		while (list($key, $val) = each($array)) {
99
+			if (is_bool($val))
100
+				$val = $val ? 'true' : 'false';
101
+			else if (!is_numeric($val))
102
+				$val = '"'.$val.'"';
103
+			if ($jstr) $jstr .= ',';
104
+			$jstr .= '"' . $key . '":' . $val;
105
+		}
106
+		return $jstr;
107
+	}
108
+
109
+	function _make_html_attr($array) {
110
+		$attrstr = '';
111
+		reset($array);
112
+		while (list($key, $val) = each($array)) {
113
+			$attrstr .= $key . '="' . $val . '" ';
114
+		}
115
+		return $attrstr;
116
+	}
117 117
 };
118 118
 
119 119
 ?>
120 120
\ No newline at end of file
Please login to merge, or discard this patch.
phpgwapi/inc/class.accounts.inc.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -225,13 +225,13 @@
 block discarded – undo
225 225
 	 * @param int $accountId
226 226
 	 * @deprecated
227 227
 	 */
228
-    function setAccountId($accountId)
229
-    {
230
-        if($accountId && is_numeric($accountId))
231
-        {
232
-            $this->account_id = (int)$accountId;
233
-        }
234
-    }
228
+	function setAccountId($accountId)
229
+	{
230
+		if($accountId && is_numeric($accountId))
231
+		{
232
+			$this->account_id = (int)$accountId;
233
+		}
234
+	}
235 235
 
236 236
 	/**
237 237
 	 * Searches / lists accounts: users and/or groups
Please login to merge, or discard this patch.