Changeset 342 for trunk/app/views/groups/admin_edit.ctp
- Timestamp:
- 03/25/08 01:03:27 (10 months ago)
- Files:
-
- 1 modified
-
trunk/app/views/groups/admin_edit.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/views/groups/admin_edit.ctp
r264 r342 1 1 <?php 2 //die( var_dump( $this->data ) );3 if ( $othAuth->group('id') != 1 && $this->data["User"]["id"] != $othAuth->user('id'))2 //die( debug( $this->data ) ); 3 if ( $cU['User']['group_id'] != 1 ) 4 4 { 5 exit('Error, you are not allowed to be here');5 $this->flash('Error, you are not allowed to be here'); 6 6 } 7 7 8 echo $ html->formTag('/admin/groups/edit/','post',array("onsubmit"=>"return validateData()"));9 echo $ html->hiddenTag('Group/id');8 echo $form->create('Group',array("onsubmit"=>"return validateData()")); 9 echo $form->hidden('Group.id'); 10 10 ?> 11 11 <fieldset> 12 12 <legend><?php echo $this->data['Group']['name']; ?> group</legend> 13 14 <?php echo $form->labelTag('Group/code', 'Access Code:' );?><br /> 15 <?php echo $html->input('Group/code', array("size"=>4, "maxlength"=>4)); ?> 16 <?php echo $html->tagErrorMsg('Group/code', 'Code is required.'); ?> 17 <br /> 18 19 <p><?php echo $html->submit('Save') ?></p> 20 </fieldset> 21 </form> 22 </div> 13 14 <?php 15 echo $form->input('Group.code', array("size"=>7, "maxlength"=>7)); 16 echo $form->error('Group.code', 'Code is required.'); 17 18 if ( $this->data['Group']['id'] == 4) 19 { 20 echo $form->label('Group.active', 'Enabled: '); 21 echo $form->checkbox('Group.active', array('value'=>2)); 22 } 23 ?> 24 <br /></fieldset> 25 <?php echo $form->end('Save'); ?> 23 26 24 27 <script type="text/javascript"> 25 28 function validateData() 26 { 29 { áž 27 30 var code = document.getElementById("GroupCode"); 28 31 29 if (code.value.length !=4)32 if (code.value.length < 4) 30 33 { 31 alert('The code must have four characters');34 alert('The code must have at least four characters'); 32 35 code.focus(); 33 36 return false;
