| @@ -131,7 +131,10 @@ discard block | ||
| 131 | 131 | ($content['mounts']['enable'] || self::$is_setup && $content['mounts']['mount'])) | 
| 132 | 132 |  				{ | 
| 133 | 133 |  					$url = str_replace('$path',$path,$content['mounts']['url']); | 
| 134 | - if (empty($url) && $this->versioning) $url = Versioning\StreamWrapper::PREFIX.$path; | |
| 134 | + if (empty($url) && $this->versioning) | |
| 135 | +					{ | |
| 136 | + $url = Versioning\StreamWrapper::PREFIX.$path; | |
| 137 | + } | |
| 135 | 138 | |
| 136 | 139 | if ($content['mounts']['enable'] && !$this->versioning) | 
| 137 | 140 |  					{ | 
| @@ -227,16 +230,25 @@ discard block | ||
| 227 | 230 | $content['versionedpath'] = '/'; | 
| 228 | 231 | $content['mtime'] = 100; | 
| 229 | 232 | } | 
| 230 | - if (true) $content = array( | |
| 233 | + if (true) | |
| 234 | +		{ | |
| 235 | + $content = array( | |
| 231 | 236 | 'versionedpath' => $content['versionedpath'], | 
| 232 | 237 | 'mtime' => $content['mtime'], | 
| 233 | 238 | ); | 
| 239 | + } | |
| 234 | 240 | if ($this->versioning) | 
| 235 | 241 |  		{ | 
| 236 | 242 | // statistical information | 
| 237 | 243 | $content += Versioning\StreamWrapper::summary(); | 
| 238 | - if ($content['total_files']) $content['percent_files'] = number_format(100.0*$content['version_files']/$content['total_files'],1).'%'; | |
| 239 | - if ($content['total_size']) $content['percent_size'] = number_format(100.0*$content['version_size']/$content['total_size'],1).'%'; | |
| 244 | + if ($content['total_files']) | |
| 245 | +			{ | |
| 246 | + $content['percent_files'] = number_format(100.0*$content['version_files']/$content['total_files'],1).'%'; | |
| 247 | + } | |
| 248 | + if ($content['total_size']) | |
| 249 | +			{ | |
| 250 | + $content['percent_size'] = number_format(100.0*$content['version_size']/$content['total_size'],1).'%'; | |
| 251 | + } | |
| 240 | 252 | } | 
| 241 | 253 | if (!($content['is_root']=Vfs::$is_root)) | 
| 242 | 254 |  		{ | 
| @@ -101,7 +101,10 @@ | ||
| 101 | 101 | $row['type'] = $row['share_writable'] ? Sharing::WRITABLE : Sharing::READONLY; | 
| 102 | 102 | } | 
| 103 | 103 | $row['share_passwd'] = (boolean)$row['share_passwd']; | 
| 104 | -			if ($row['share_with']) $row['share_with'] = preg_replace('/,([^ ])/', ', $1', $row['share_with']); | |
| 104 | + if ($row['share_with']) | |
| 105 | +			{ | |
| 106 | +				$row['share_with'] = preg_replace('/,([^ ])/', ', $1', $row['share_with']); | |
| 107 | + } | |
| 105 | 108 | } | 
| 106 | 109 | return $total; | 
| 107 | 110 | } | 
| @@ -104,7 +104,10 @@ | ||
| 104 | 104 | if ($content['nm']['action']) | 
| 105 | 105 |  		{ | 
| 106 | 106 | $msg = filemanager_ui::action($content['nm']['action'],$content['nm']['selected'],$content['nm']['path']); | 
| 107 | -			if($msg) Api\Json\Response::get()->apply('egw.message',array($msg)); | |
| 107 | + if($msg) | |
| 108 | +			{ | |
| 109 | +				Api\Json\Response::get()->apply('egw.message',array($msg)); | |
| 110 | + } | |
| 108 | 111 | foreach($content['nm']['selected'] as &$id) | 
| 109 | 112 |  			{ | 
| 110 | 113 | $id = 'filemanager::'.$id; | 
| @@ -22,7 +22,10 @@ discard block | ||
| 22 | 22 |  { | 
| 23 | 23 | $path = '/home/'.$GLOBALS['egw_info']['user']['account_lid']; | 
| 24 | 24 | } | 
| 25 | -if (isset($_REQUEST['path'])) $path = $_REQUEST['path']; | |
| 25 | +if (isset($_REQUEST['path'])) | |
| 26 | +{ | |
| 27 | + $path = $_REQUEST['path']; | |
| 28 | +} | |
| 26 | 29 |  echo Api\Html::form("<p>Path: ".Api\Html::input('path',$path,'text','size="40"'). | 
| 27 | 30 |  	Api\Html::submit_button('',lang('Submit'))."</p>\n",array(),'','','','','GET'); | 
| 28 | 31 | |
| @@ -53,9 +56,12 @@ discard block | ||
| 53 | 56 | $stime = number_format(1000*(microtime(true)-$time),1); | 
| 54 | 57 | |
| 55 | 58 | $time2 = microtime(true); | 
| 56 | - if ($is_dir)// && ($d = Vfs::opendir($path))) | |
| 59 | + if ($is_dir) | |
| 60 | +	{ | |
| 61 | + // && ($d = Vfs::opendir($path))) | |
| 57 | 62 |  	{ | 
| 58 | 63 | $files = array(); | 
| 64 | + } | |
| 59 | 65 | //while(($file = readdir($d))) | 
| 60 | 66 | foreach(Vfs::scandir($path) as $file) | 
| 61 | 67 |  		{ | 
| @@ -69,7 +75,10 @@ discard block | ||
| 69 | 75 | //closedir($d); | 
| 70 | 76 | $time2f = number_format(1000*(microtime(true)-$time2),1); | 
| 71 | 77 | echo "<p>".($files ? 'Directory' : 'Empty directory')." took $time2f ms</p>\n"; | 
| 72 | -		if($files) echo '<ol><li>'.implode("</li>\n<li>",$files).'</ol>'."\n"; | |
| 78 | + if($files) | |
| 79 | +		{ | |
| 80 | +			echo '<ol><li>'.implode("</li>\n<li>",$files).'</ol>'."\n"; | |
| 81 | + } | |
| 73 | 82 | } | 
| 74 | 83 | |
| 75 | 84 |  	echo "<p><b>stat('$path')</b> took $stime ms (mode = ".(isset($stat['mode'])?sprintf('%o',$stat['mode']).' = '.Vfs::int2mode($stat['mode']):'NULL').')'; | 
| @@ -13,7 +13,10 @@ discard block | ||
| 13 | 13 | use EGroupware\Api\Framework; | 
| 14 | 14 | use EGroupware\Api\Framework\Bundle; | 
| 15 | 15 | |
| 16 | -if (php_sapi_name() !== 'cli') die("This is a commandline ONLY tool!\n"); | |
| 16 | +if (php_sapi_name() !== 'cli') | |
| 17 | +{ | |
| 18 | +	die("This is a commandline ONLY tool!\n"); | |
| 19 | +} | |
| 17 | 20 | |
| 18 | 21 | $GLOBALS['egw_info'] = array( | 
| 19 | 22 | 'flags' => array( | 
| @@ -40,12 +43,19 @@ discard block | ||
| 40 | 43 | |
| 41 | 44 | foreach(Bundle::all() as $name => $files) | 
| 42 | 45 |  { | 
| 43 | - if ($name == '.ts') continue; // ignore timestamp | |
| 46 | + if ($name == '.ts') | |
| 47 | +	{ | |
| 48 | + continue; | |
| 49 | + } | |
| 50 | + // ignore timestamp | |
| 44 | 51 | |
| 45 | 52 | // remove leading / from file-names | 
| 46 | 53 | array_walk($files, function(&$path) | 
| 47 | 54 |  	{ | 
| 48 | - if ($path[0] == '/') $path = substr($path, 1); | |
| 55 | + if ($path[0] == '/') | |
| 56 | +		{ | |
| 57 | + $path = substr($path, 1); | |
| 58 | + } | |
| 49 | 59 | }); | 
| 50 | 60 | |
| 51 | 61 | // api/js/jsapi/egw.js loaded via own tag, and we must not load it twice! | 
| @@ -87,11 +97,18 @@ discard block | ||
| 87 | 97 | $GLOBALS['egw_info']['server']['template_set'] = $template; | 
| 88 | 98 | $tpl = Framework::factory(); | 
| 89 | 99 | $themes = $tpl->list_themes(); | 
| 90 | - if ($template == 'pixelegg') $themes[] = 'fw_mobile'; // this is for mobile devices | |
| 100 | + if ($template == 'pixelegg') | |
| 101 | +	{ | |
| 102 | + $themes[] = 'fw_mobile'; | |
| 103 | + } | |
| 104 | + // this is for mobile devices | |
| 91 | 105 | foreach($themes as $theme) | 
| 92 | 106 |  	{ | 
| 93 | 107 | // skip not working cssmin of pixelegg/traditional: Broken @import declaration of "../../etemplate/templates/default/etemplate2.css" | 
| 94 | - if ($template == 'pixelegg' && $theme == 'traditional') continue; | |
| 108 | + if ($template == 'pixelegg' && $theme == 'traditional') | |
| 109 | +		{ | |
| 110 | + continue; | |
| 111 | + } | |
| 95 | 112 | $GLOBALS['egw_info']['user']['preferences']['common']['theme'] = $theme; | 
| 96 | 113 | // empty include list by not-existing file plus last true | 
| 97 | 114 |  		Framework\CssIncludes::add('*grunt*', null, true, true); | 
| @@ -178,15 +178,17 @@ discard block | ||
| 178 | 178 | $acl = new Acl($anon_user); | 
| 179 | 179 | $acl->read_repository(); | 
| 180 | 180 | foreach ($calendar_bo->resources as $type => $data) | 
| 181 | -		{ | |
| 181 | + 		{ | |
| 182 | 182 | // Check anon user's permissions - must have at least run for the hook to be available | 
| 183 | 183 |  			if($acl->check('run',EGW_ACL_READ, $data['app']) && | 
| 184 | 184 | $type != '' && $data['app'] && Link::get_registry($data['app'], 'query') | 
| 185 | - ) | |
| 186 | -			{ | |
| 185 | +			) { | |
| 187 | 186 | $_results = Link::query($data['app'], $query,$options); | 
| 188 | 187 | } | 
| 189 | - if(!$_results) continue; | |
| 188 | + if(!$_results) | |
| 189 | +			{ | |
| 190 | + continue; | |
| 191 | + } | |
| 190 | 192 | $_results = array_unique($_results); | 
| 191 | 193 | foreach ($_results as $key => $value) | 
| 192 | 194 |  			{ | 
| @@ -223,8 +225,14 @@ discard block | ||
| 223 | 225 | $arguments['sortby'] = 'month'; | 
| 224 | 226 | $arguments['date'] = substr($arguments['date'],0,4).'0101'; | 
| 225 | 227 | } | 
| 226 | - if (isset($_GET['date'])) $arguments['date'] = $_GET['date']; | |
| 227 | - if (empty($arguments['cat_id'])) $arguments['cat_id'] = ''; | |
| 228 | + if (isset($_GET['date'])) | |
| 229 | +		{ | |
| 230 | + $arguments['date'] = $_GET['date']; | |
| 231 | + } | |
| 232 | + if (empty($arguments['cat_id'])) | |
| 233 | +		{ | |
| 234 | + $arguments['cat_id'] = ''; | |
| 235 | + } | |
| 228 | 236 |  		if(isset($arguments['resources']) && in_array('r0', $arguments['resources'])) | 
| 229 | 237 |  		{ | 
| 230 | 238 | foreach($arguments['resources'] as $index => $value) | 
| @@ -259,7 +267,8 @@ discard block | ||
| 259 | 267 | if (is_array($params['owner'])) | 
| 260 | 268 |  		{ | 
| 261 | 269 | // Buffer, and add anything that gets cleared to the content | 
| 262 | -			ob_start(function($buffer) use(&$html) { | |
| 270 | + ob_start(function($buffer) use(&$html) | |
| 271 | +			{ | |
| 263 | 272 | $html .= $buffer; | 
| 264 | 273 | return ''; | 
| 265 | 274 | }); | 
| @@ -268,20 +277,26 @@ discard block | ||
| 268 | 277 | $ui->sortby = $arguments['sortby']; | 
| 269 | 278 | $ui->owner = $params['owner']; | 
| 270 | 279 | |
| 271 | - if (!$ui->planner_view || $ui->planner_view == 'month') // planner monthview | |
| 280 | + if (!$ui->planner_view || $ui->planner_view == 'month') | |
| 281 | +			{ | |
| 282 | + // planner monthview | |
| 272 | 283 |  			{ | 
| 273 | 284 | if ($ui->day < 15) // show one complete month | 
| 274 | 285 |  				{ | 
| 275 | 286 | $ui->_week_align_month($ui->first,$ui->last); | 
| 287 | + } | |
| 276 | 288 | } | 
| 277 | 289 | else // show 2 half month | 
| 278 | 290 |  				{ | 
| 279 | 291 | $ui->_week_align_month($ui->first,$ui->last,15); | 
| 280 | 292 | } | 
| 281 | 293 | } | 
| 282 | - elseif ($ui->planner_view == 'week' || $ui->planner_view == 'weekN') // weeekview | |
| 294 | + elseif ($ui->planner_view == 'week' || $ui->planner_view == 'weekN') | |
| 295 | +			{ | |
| 296 | + // weeekview | |
| 283 | 297 |  			{ | 
| 284 | 298 | $start = new Api\DateTime($ui->date); | 
| 299 | + } | |
| 285 | 300 | $start->setWeekstart(); | 
| 286 | 301 |  				$ui->first = $start->format('ts'); | 
| 287 | 302 | $ui->last = $ui->bo->date2array($this->first); | 
| @@ -115,7 +115,8 @@ | ||
| 115 | 115 | $cat_ids[$category['id']] = $GLOBALS['egw']->strip_html($category['name']); | 
| 116 | 116 | } | 
| 117 | 117 | $this->arguments['category']['options'] = $cat_ids; | 
| 118 | -		if (count($cat_ids) > 5) { | |
| 118 | + if (count($cat_ids) > 5) | |
| 119 | +		{ | |
| 119 | 120 | $this->arguments['category']['multiple'] = 5; | 
| 120 | 121 | } | 
| 121 | 122 | |
| @@ -165,7 +165,8 @@ discard block | ||
| 165 | 165 | $cat_ids[$category['id']] = $GLOBALS['egw']->strip_html($category['name']); | 
| 166 | 166 | } | 
| 167 | 167 | $this->arguments['category']['options'] = $cat_ids; | 
| 168 | -		if (count($cat_ids) > 5) { | |
| 168 | + if (count($cat_ids) > 5) | |
| 169 | +		{ | |
| 169 | 170 | $this->arguments['category']['multiple'] = 5; | 
| 170 | 171 | } | 
| 171 | 172 | |
| @@ -310,8 +311,16 @@ discard block | ||
| 310 | 311 | foreach((array) $this->bo->search($search_params) as $event) | 
| 311 | 312 |  		{ | 
| 312 | 313 | $event['date'] = $this->bo->date2string($event['start']); | 
| 313 | - if (empty($event['description'])) $event['description'] = ' '; // no description screws the titles horz. alignment | |
| 314 | - if (empty($event['location'])) $event['location'] = ' '; // no location screws the owner horz. alignment | |
| 314 | + if (empty($event['description'])) | |
| 315 | +			{ | |
| 316 | + $event['description'] = ' '; | |
| 317 | + } | |
| 318 | + // no description screws the titles horz. alignment | |
| 319 | + if (empty($event['location'])) | |
| 320 | +			{ | |
| 321 | + $event['location'] = ' '; | |
| 322 | + } | |
| 323 | + // no location screws the owner horz. alignment | |
| 315 | 324 | $rows[] = $event; | 
| 316 | 325 | } | 
| 317 | 326 | if (($arguments['showWeeks']) && ((int)$arguments['offset'] == 0)) | 
| @@ -337,7 +346,8 @@ discard block | ||
| 337 | 346 | } | 
| 338 | 347 |  				$last_week = adodb_date('W-Y',$event['start']); | 
| 339 | 348 | $html .= " <!-- Event -->\n"; | 
| 340 | -				if ($event_count % 2 == 0) { | |
| 349 | + if ($event_count % 2 == 0) | |
| 350 | +				{ | |
| 341 | 351 | $html .= ' <div class="cal_list_event cal_event_even">'."\n"; | 
| 342 | 352 | } | 
| 343 | 353 | else | 
| @@ -353,7 +363,8 @@ discard block | ||
| 353 | 363 |  				$html .= '<span class="cal_list_weekday">'.lang(adodb_date('D',$event['end'])).".".($this->bo->common_prefs['dateformat'][0] != 'd' ? ' ' : ', ')."</span>"; | 
| 354 | 364 | $html .= $this->bo->format_date($event['end'])."</span></div>\n"; | 
| 355 | 365 | $descr = trim($event['description']); | 
| 356 | -				if (! empty($descr)) { | |
| 366 | + if (! empty($descr)) | |
| 367 | +				{ | |
| 357 | 368 |  					$html .= "    <div class=\"cal_list_descr\">\n".preg_replace('/\\n/',"<br>\n",$event['description'])."</div>\n"; | 
| 358 | 369 | } | 
| 359 | 370 | $html .= " </div><!-- cal_list_event -->\n"; | 
| @@ -44,15 +44,23 @@ | ||
| 44 | 44 | if (strpos($_SERVER['QUERY_STRING'],'=3D') !== false && substr($_GET['user'],0,2) == '3D') | 
| 45 | 45 |  { | 
| 46 | 46 | $_GET['user'] = substr($_GET['user'],2); | 
| 47 | - if (isset($_GET['password'])) $_GET['password'] = substr($_GET['password'],2); | |
| 48 | - if (isset($_GET['cred'])) $_GET['cred'] = substr($_GET['cred'],2); | |
| 49 | -} | |
| 47 | + if (isset($_GET['password'])) | |
| 48 | +	{ | |
| 49 | + $_GET['password'] = substr($_GET['password'],2); | |
| 50 | + } | |
| 51 | + if (isset($_GET['cred'])) | |
| 52 | +	{ | |
| 53 | + $_GET['cred'] = substr($_GET['cred'],2); | |
| 54 | + } | |
| 55 | + } | |
| 50 | 56 | if (!is_numeric($user = $_GET['user'])) | 
| 51 | 57 |  { | 
| 52 | 58 | // check if user contains the current domain --> remove it | 
| 53 | 59 |  	list(,$domain) = explode('@',$user); | 
| 54 | 60 | if ($domain === $GLOBALS['egw_info']['user']['domain']) | 
| 55 | -	list($user) = explode('@',$user); | |
| 61 | +	{ | |
| 62 | +		list($user) = explode('@',$user); | |
| 63 | + } | |
| 56 | 64 | $user = $GLOBALS['egw']->accounts->name2id($user,'account_lid','u'); | 
| 57 | 65 | } | 
| 58 | 66 | if ($user === false || !($username = $GLOBALS['egw']->accounts->id2name($user))) |