- Timestamp:
- 09/01/08 22:38:27 (3 months ago)
- Location:
- trunk/app
- Files:
-
- 3 modified
-
controllers/treasures_controller.php (modified) (1 diff)
-
locale/spa/LC_MESSAGES/default.po (modified) (1 diff)
-
views/treasures/admin_edit.ctp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/treasures_controller.php
r728 r747 30 30 public function chksw() 31 31 { 32 $this->layout = 'ajax'; 33 34 if ( !empty($this->data['ResultTreasure']) ): 35 $this->Sanitize = new Sanitize; 36 37 $this->Sanitize->clean($this->data['ResultTreasure']); 38 39 $secret = $this->Treasure->field('secret', array('status'=>1,'id'=>$this->data['ResultTreasure']['treasure_id'])); 32 $this->layout = 'ajax'; 33 34 if ( !empty($this->data['ResultTreasure']) ): 35 $this->Sanitize = new Sanitize; 36 $this->Sanitize->clean($this->data['ResultTreasure']); 37 $conditions = array('ResultTreasure.treasure_id'=>$this->data['ResultTreasure']['treasure_id'],'ResultTreasure.user_id'=>$this->Auth->user('id')); 38 $answer = $this->Treasure->ResultTreasure->field('id', $conditions); 39 40 if ($answer != false): 41 $this->set('msg', __('You already answered this Scavenger Hunt', true)); 42 $this->render('chksw', 'ajax'); 43 return false; 44 endif; 45 46 $secret = $this->Treasure->field('secret', array('status'=>1,'id'=>$this->data['ResultTreasure']['treasure_id'])); 40 47 41 if ( $this->data['ResultTreasure']['secret'] == $secret ):48 if ( $this->data['ResultTreasure']['secret'] == $secret ): 42 49 $this->data['ResultTreasure']['user_id'] = $this->Auth->user('id'); 43 44 50 $this->Treasure->ResultTreasure->save($this->data['ResultTreasure']); 45 46 51 $this->set('msg', 'Cool!, the '. $this->data['ResultTreasure']['points'] .' points are yours'); 47 52 $this->render('chksw', 'ajax'); 48 53 49 else:50 $this->set('msg', 'Sorry, word is incorrect');51 $this->render('chksw', 'ajax');52 endif;54 else: 55 $this->set('msg', __('Sorry, code is incorrect', true)); 56 $this->render('chksw', 'ajax'); 57 endif; 53 58 endif; 54 59 } -
trunk/app/locale/spa/LC_MESSAGES/default.po
r733 r747 4 4 msgid "Yes" 5 5 msgstr "Si" 6 7 msgid "You already answered this Scavenger Hunt" 8 msgstr "Ya has encontrado este tesoro" 6 9 7 10 msgid "Reports" -
trunk/app/views/treasures/admin_edit.ctp
r693 r747 13 13 </td><td> 14 14 <?php 15 echo $form->label('Treasure.points', 'Points:');15 echo $form->label('Treasure.points', __('Points', true)); 16 16 echo $form->select('Treasure.points', array(1=>1,2=>2,3=>3,4=>4,5=>5,6=>6,7=>7,8=>8,9=>9,10=>10)); 17 17 ?> … … 30 30 31 31 <tr><td colspan="3"> 32 <?php echo $form->input('Treasure.secret', array('size'=>15, 'maxlength'=>15, 'between'=>': ' )); ?>32 <?php echo $form->input('Treasure.secret', array('size'=>15, 'maxlength'=>15, 'between'=>': ', 'label'=>__('Code', true))); ?> 33 33 </td> 34 34 </tr>
