Changeset 12330
- Timestamp:
- 09/17/07 16:14:10 (1 year ago)
- Files:
-
- trunk/midcom/net.nemein.teams/config/config.inc (modified) (1 diff)
- trunk/midcom/net.nemein.teams/handler/admin.php (modified) (5 diffs)
- trunk/midcom/net.nemein.teams/handler/team.php (modified) (5 diffs)
- trunk/midcom/net.nemein.teams/locale/default.en.txt (modified) (1 diff)
- trunk/midcom/net.nemein.teams/plugins/midgard_admin_sitewizard_plugin.php (modified) (2 diffs)
- trunk/midcom/net.nemein.teams/style/manage_system.php (added)
- trunk/midcom/net.nemein.teams/style/teams_pending_list_end.php (modified) (1 diff)
- trunk/midcom/net.nemein.teams/style/teams_pending_list_item.php (modified) (1 diff)
- trunk/midcom/net.nemein.teams/style/teams_pending_list_start.php (modified) (1 diff)
- trunk/midcom/net.nemein.teams/viewer.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/net.nemein.teams/config/config.inc
r12065 r12330 20 20 'display_teams_per_page' => 1, 21 21 'display_pages' => 10, 22 'max_players_per_team' => 10, 22 23 24 25 // Are these used for anything...=) 23 26 'private_pendings_url' => '/leet_teams/pending', 24 27 'private_pendings_link' => 'approve/decline', trunk/midcom/net.nemein.teams/handler/admin.php
r12327 r12330 77 77 function _handler_manage_delete($handler_id, $args, &$data) 78 78 { 79 $_MIDCOM->auth->require_admin_user(); 80 79 81 if (isset($_POST['remove'])) 80 82 { … … 88 90 // TODO: handle this 89 91 } 90 91 print_r($args);92 print_r($teams);93 92 94 93 if (count($teams) > 0) … … 114 113 // We might need to delete this for real 115 114 $team_topic->navnoentry = true; 115 //$team_topic->update(); 116 116 117 117 $team->delete(); … … 135 135 function _handler_manage_team($handler_id, $args, &$data) 136 136 { 137 $_MIDCOM->auth->require_admin_user(); 137 138 138 139 $qb = net_nemein_teams_team_dba::new_query_builder(); … … 147 148 148 149 return true; 150 } 151 152 function _handler_manage_system($handler_id, $args, &$data) 153 { 154 $_MIDCOM->auth->require_admin_user(); 155 156 return true; 157 } 158 159 function _show_manage_system($handler_id, &$data) 160 { 161 midcom_show_style('manage_system'); 149 162 } 150 163 trunk/midcom/net.nemein.teams/handler/team.php
r12327 r12330 421 421 $qb = net_nemein_teams_team_dba::new_query_builder(); 422 422 $qb->add_constraint('managerguid', '=', $_MIDCOM->auth->user->guid); 423 423 424 $teams = $qb->execute(); 425 426 $max_players = $this->_config->get('max_players_per_team'); 427 428 $qb = midcom_db_member::new_query_builder(); 429 $qb->add_constraint('gid.guid', '=', $teams[0]->groupguid); 430 431 $member_count = $qb->count(); 432 433 if ($member_count < $max_players) 434 { 424 435 if (isset($_POST['approve_pending'])) 425 436 { 426 $teams = $qb->execute();427 428 437 foreach($_POST as $key => $value) 429 438 { … … 454 463 } 455 464 } 465 } 466 else 467 { 468 $this->_request_data['team_full'] = true; 469 } 456 470 457 471 if ($qb->count() > 0) … … 491 505 if (!$members = $qb->execute()) 492 506 { 493 507 return false; 494 508 } 495 509 else … … 519 533 function _show_error($handler_id, &$data) 520 534 { 521 echo "Error creating net team_creation_form";535 echo "Error creating team"; 522 536 } 523 537 … … 542 556 midcom_show_style('teams_pending_list_start'); 543 557 544 foreach($this->_pending as $pending) 545 { 546 $player = new midcom_db_person($pending->playerguid); 547 548 $this->_request_data['pending'] = $pending; 549 $this->_request_data['player_username'] = $player->username; 550 midcom_show_style('teams_pending_list_item'); 558 if (isset($this->_request_data['team_full']) && $this->_request_data['team_full']) 559 { 560 echo $this->_l10n->get('team is full'); 561 } 562 else 563 { 564 foreach($this->_pending as $pending) 565 { 566 $player = new midcom_db_person($pending->playerguid); 567 568 $this->_request_data['pending'] = $pending; 569 $this->_request_data['player_username'] = $player->username; 570 midcom_show_style('teams_pending_list_item'); 571 } 551 572 } 552 573 trunk/midcom/net.nemein.teams/locale/default.en.txt
r12327 r12330 58 58 Approve 59 59 ---STRINGEND 60 61 ---STRING team is full 62 Team is full at the moment 63 ---STRINGEND trunk/midcom/net.nemein.teams/plugins/midgard_admin_sitewizard_plugin.php
r12300 r12330 168 168 $this->_logger->log("Team home folder created by " . $_MIDCOM->auth->user->_storage->username, $this->_team_guid); 169 169 170 //$_MIDCOM->relocate($my_way_home);170 $_MIDCOM->relocate($this->_home_name); 171 171 172 172 } … … 178 178 $e->error(); 179 179 echo "</p>"; 180 $_MIDCOM->relocate('error'); 180 181 } 181 182 echo "</pre>"; trunk/midcom/net.nemein.teams/style/teams_pending_list_end.php
r12062 r12330 2 2 //$data =& $_MIDCOM->get_custom_context_data('request_data'); 3 3 ?> 4 4 </ul> 5 5 <br/> 6 6 <input type="submit" name="approve_pending" value="<?php echo $data['l10n']->get('approve'); ?>"/> trunk/midcom/net.nemein.teams/style/teams_pending_list_item.php
r12062 r12330 5 5 6 6 <?php 7 7 echo "<li>"; 8 8 echo $data['player_username']; 9 9 echo " <input type=\"checkbox\" name=\"{$data['pending']->playerguid}\"/>"; 10 10 echo "</li>"; 11 11 ?> 12 12 trunk/midcom/net.nemein.teams/style/teams_pending_list_start.php
r12062 r12330 6 6 7 7 <form method="post" name="net_nemein_teams_pending"> 8 <ul> trunk/midcom/net.nemein.teams/viewer.php
r12327 r12330 73 73 ); 74 74 75 // Manage / System 76 $this->_request_switch['manage_system'] = array 77 ( 78 'handler' => Array('net_nemein_teams_handler_admin', 'manage_system'), 79 'fixed_args' => Array('manage_system'), 80 ); 81 75 82 // Error / 76 83 $this->_request_switch['error'] = array … … 317 324 function _populate_node_toolbar() 318 325 { 319 /*326 /* 320 327 if ($this->_content_topic->can_do('midgard:create')) 321 328 { … … 334 341 } 335 342 */ 343 344 if ($_MIDCOM->auth->require_admin_user()) 345 { 346 $this->_node_toolbar->add_item 347 ( 348 array 349 ( 350 MIDCOM_TOOLBAR_URL => 'manage', 351 MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('manage teams'), 352 MIDCOM_TOOLBAR_HELPTEXT => $this->_l10n_midcom->get('manage teams'), 353 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_folder-properties.png', 354 ) 355 ); 356 $this->_node_toolbar->add_item 357 ( 358 array 359 ( 360 MIDCOM_TOOLBAR_URL => 'manage_system', 361 MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('manage system'), 362 MIDCOM_TOOLBAR_HELPTEXT => $this->_l10n_midcom->get('manage system'), 363 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_folder-properties.png', 364 ) 365 ); 366 } 367 336 368 if ( $this->_topic->can_do('midgard:update') 337 369 && $this->_topic->can_do('midcom:component_config'))
