예제 #1
0
             foreach ($colors as $color) {
                 // $COLOR_LIST[$color->getPetSpeciePetSpecieColorId()] = $color->getColorName();
                 $COLOR_LIST[$color->getColorImg()] = $color->getColorName();
             }
             if (sizeof($COLOR_LIST) == 1) {
                 $ERRORS[] = 'Since there are no available colors for this pet, you cannot adopt it!';
             }
         }
         // end try to load color
     }
     // end user has acceptable number of pets
     if (sizeof($ERRORS) > 0) {
         draw_errors($ERRORS);
     } else {
         $PET = array('id' => $specie->getPetSpecieId(), 'name' => $specie->getSpecieName(), 'description' => $specie->getSpecieDescr(), 'image' => null, 'image_dir' => $specie->getRelativeImageDir());
         $color = PetSpecie_PetSpecieColor::randomColor($specie->getPetSpecieId(), $db);
         if ($color != null) {
             $PET['image'] = "{$APP_CONFIG['public_dir']}/resources/pets/{$specie->getRelativeImageDir()}/{$color->getColorImg()}";
         }
         $renderer->assign('pet', $PET);
         $renderer->assign('colors', $COLOR_LIST);
         $renderer->display('pets/create_details.tpl');
     }
     // end pet is valid
     break;
     // end details
 // end details
 case 'spawn':
     $ERRORS = array();
     $specie_id = stripinput($_POST['pet']['specie_id']);
     $color_id = stripinput($_POST['pet']['color_id']);