コード例 #1
0
ファイル: buildings.php プロジェクト: Gritch69/XG-Project
 /**
  * method do_command
  * param $have_fields
  * param $full_queue
  * param $building
  * param $queue
  * return (string) $action
  */
 private function set_action_button($have_fields, $full_queue, $building, $queue)
 {
     // all field occupied
     $action = Format_Lib::color_red($this->_lang['bd_no_more_fields']);
     // with fields
     if ($have_fields && !$full_queue) {
         if ($queue['lenght'] == 0) {
             if (Developments_Lib::is_development_payable($this->_current_user, $this->_current_planet, $building, TRUE, FALSE) && !parent::$users->is_on_vacations($this->_current_user)) {
                 $action = Functions_Lib::set_url('game.php?page=' . $this->_current_page . '&cmd=insert&building=' . $building, '', Format_Lib::color_green($this->_lang['bd_build']));
             } else {
                 $action = Format_Lib::color_red($this->_lang['bd_build']);
             }
         } else {
             $action = Functions_Lib::set_url('game.php?page=' . $this->_current_page . '&cmd=insert&building=' . $building, '', Format_Lib::color_green($this->_lang['bd_add_to_list']));
         }
     }
     if ($have_fields && $full_queue) {
         $action = Format_Lib::color_red($this->_lang['bd_build']);
     }
     if ($building == 31 && Developments_Lib::is_lab_working($this->_current_user) or ($building == 21 or $building == 14 or $building == 15) && Developments_Lib::is_shipyard_working($this->_current_planet)) {
         $action = Format_Lib::color_red($this->_lang['bd_working']);
     }
     return $action;
 }