Changeset 5978
- Timestamp:
- 07/09/08 21:36:58 (5 years ago)
- Files:
-
- modules/branches/2.5/timeconditions/functions.inc.php (modified) (2 diffs)
- modules/branches/2.5/timeconditions/images (added)
- modules/branches/2.5/timeconditions/images/time_edit.png (added)
- modules/branches/2.5/timeconditions/images/time_link.png (copied) (copied from modules/branches/2.5/daynight/images/clock_link.png)
- modules/branches/2.5/timeconditions/page.timeconditions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.5/timeconditions/functions.inc.php
r5957 r5978 256 256 } 257 257 258 258 function timeconditions_timegroups_usage($group_id) { 259 260 $results = sql("SELECT timeconditions_id, displayname FROM timeconditions WHERE time = '$group_id'","getAll",DB_FETCHMODE_ASSOC); 261 if (empty($results)) { 262 return array(); 263 } else { 264 foreach ($results as $result) { 265 $usage_arr[] = array( 266 "url_query" => "display=timeconditions&itemid=".$result['timeconditions_id'], 267 "description" => $result['displayname'], 268 ) 269 } 270 return $usage_arr; 271 } 272 } 273 274 function timeconditions_timegroups_list_usage($timegroup_id) { 275 global $active_modules; 276 $full_usage_arr = array(); 277 278 foreach(array_keys($active_modules) as $mod) { 279 $function = $mod."_timegroups_usage"; 280 if (function_exists($function)) { 281 $timegroup_usage = $function($timegroup_id); 282 if (!empty($timegroup_usage)) { 283 $full_usage_arr = array_merge($full_usage_arr, $timegroup_usage); 284 } 285 } 286 } 287 return $full_usage_arr; 288 } 259 289 260 290 /* … … 343 373 $label = '<span><img width="16" height="16" border="0" title="'.$tlabel.'" alt="" src="images/core_delete.png"/> '.$tlabel.'</span>'; 344 374 $currentcomponent->addguielem('_top', new gui_link('del', $label, $delURL, true, false), 0); 375 376 $usage_list = timeconditions_timegroups_list_usage($extdisplay); 377 $count = 0; 378 foreach ($usage_list as $link) { 379 $label = '<span><img width="16" height="16" border="0" title="'.$link['description'].'" alt="" src="images/time_link.png"/> '.$link['description'].'</span>'; 380 $timegroup_link = $_SERVER['PHP_SELF'].'?'.$link['url_query']; 381 $currentcomponent->addguielem('Used By', new gui_link('link'.$count++, $label, $timegroup_link, true, false), 4); 382 } 383 384 345 385 $currentcomponent->addguielem('Time Group', new gui_textbox('description', $description, 'Description', 'This will display as the name of this Time Group.', '', '', false), 3); 346 386 $timelist = timeconditions_timegroups_get_times($extdisplay); modules/branches/2.5/timeconditions/page.timeconditions.php
r5957 r5978 102 102 </tr> 103 103 <?php 104 if (isset($thisItem['time']) && $thisItem['time'] != '') { 105 106 $grpURL = $_SERVER['PHP_SELF'].'?display=timegroups&extdisplay='.$thisItem['time']; 107 $tlabel = _("Goto Current Time Group"); 108 $label = '<span><img width="16" height="16" border="0" title="'.$tlabel.'" alt="" src="images/time_edit.png"/> '.$tlabel.'</span>'; 109 ?> 110 <tr> 111 <td> <a href="<?php echo $grpURL ?>"><?php echo " ".$label; ?></a></td> 112 <tr> 113 <?php 114 } 104 115 // implementation of module hook 105 116 // object was initialized in config.php
