![]() |
|---|
| [ Index ] |
Source Code Reference for V1.00 |
[Summary view] [Print] [Text view]
1 <?php /* $Id: addedit.php 40 2008-02-11 12:11:44Z pedroix $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/trunk/modules/resources/addedit.php $ */ 2 if (!defined('W2P_BASE_DIR')) { 3 die('You should not access this file directly.'); 4 } 5 6 // Copyright 2004 Adam Donnison <adam@saki.com.au> 7 $resource_id = intval(w2PgetParam($_GET, 'resource_id', null)); 8 $perms = &$AppUI->acl(); 9 $canDelete = $perms->checkModuleItem('resources', 'delete', $resource_id); 10 if ((!$resource_id && !$perms->checkModule('resources', 'add')) || !$canEdit) { 11 $AppUI->redirect('m=public&a=access_denied'); 12 } 13 14 $obj = &new CResource; 15 if ($resource_id && !$obj->load($resource_id)) { 16 $AppUI->setMsg('Resource'); 17 $AppUI->setMsg('invalidID', UI_MSG_ERROR, true); 18 $AppUI->redirect(); 19 } 20 21 $titleBlock = &new CTitleBlock(($resource_id ? 'Edit Resource' : 'Add Resource'), 'resources.png', $m, $m . '.' . $a); 22 $titleBlock->addCrumb('?m=resources', 'resource list'); 23 if ($resource_id) { 24 $titleBlock->addCrumb('?m=resources&a=view&resource_id=' . $resource_id, 'view this resource'); 25 } 26 $titleBlock->show(); 27 28 $typelist = $obj->typeSelect(); 29 ?> 30 <form name="editfrm" action="?m=resources" method="post"> 31 <input type="hidden" name="dosql" value="do_resource_aed" /> 32 <input type="hidden" name="resource_id" value="<?php echo w2PformSafe($resource_id); ?>" /> 33 <table cellspacing="1" cellpadding="1" border="0" width="100%" class="std"> 34 <tr> 35 <td align="center" > 36 <table> 37 <tr> 38 <td align="right"><?php echo $AppUI->_('Resource ID'); ?></td> 39 <td align="left"><input type="text" class="text" size="15" maxlength="64" name="resource_key" value="<?php echo w2PformSafe($obj->resource_key); ?>" /></td> 40 </tr> 41 <tr> 42 <td align="right"><?php echo $AppUI->_('Resource Name'); ?></td> 43 <td align="left"><input type="text" class="text" size="30" maxlength="255" name="resource_name" value="<?php echo w2PformSafe($obj->resource_name); ?>" /></td> 44 </tr> 45 <tr> 46 <td align="right"><?php echo $AppUI->_('Type'); ?></td> 47 <td align="left"><?php echo arraySelect($typelist, 'resource_type', 'class="text"', $obj->resource_type, true); ?></td> 48 </tr> 49 <tr> 50 <td align="right"><?php echo $AppUI->_('Maximum Allocation Percentage'); ?></td> 51 <td><input type="text" class="text" style="text-align:right;" size="5" maxlength="5" value="<?php 52 if ($obj->resource_max_allocation) { 53 echo w2PformSafe($obj->resource_max_allocation); 54 } else { 55 echo '100'; 56 } 57 ?>" 58 name="resource_max_allocation" /></td> 59 </tr> 60 <tr> 61 <td align="right"><?php echo $AppUI->_('Notes'); ?></td> 62 <td><textarea name="resource_note" cols="60" rows="7"><?php echo w2PformSafe($obj->resource_note); ?></textarea></td> 63 </tr> 64 </table> 65 </td> 66 </tr> 67 <tr> 68 <td> 69 <input type="button" value="<?php echo $AppUI->_('back'); ?>" class="button" onclick="javascript:history.back(-1);" /> 70 </td> 71 <td align="right"> 72 <input type="button" value="<?php echo $AppUI->_('submit'); ?>" class="button" onclick="submitIt(document.editfrm);" /> 73 </td> 74 </tr> 75 </table> 76 </form>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Jan 8 03:00:03 2009 | Cross-referenced by PHPXref 0.7 |