Changeset 9505
- Timestamp:
- 04/14/10 11:49:52 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.8/companydirectory/functions.inc.php
r9432 r9505 6 6 7 7 $dir=companydirectory_get_dir_details($_REQUEST['id']); 8 //delete link, dont show if we dont have an id (i.e. directory wasnt created yet 8 //delete link, dont show if we dont have an id (i.e. directory wasnt created yet) 9 9 if($dir['id']){ 10 10 $label=sprintf(_("Delete Company Directory %s"),$dir['dirname']?$dir['dirname']:$dir['id']); … … 38 38 $currentcomponent->addguielem($section, new gui_hidden('id', $dir['id'])); 39 39 $currentcomponent->addguielem($section, new gui_hidden('action', 'edit')); 40 40 41 //draw the entries part of the table. A bit hacky perhaps, but hey - it works! 41 $currentcomponent->addguielem('Directory Entries', new guielement('rawhtml', companydirectory_draw_entires($_REQUEST['id']), '')); 42 $currentcomponent->addguielem('Directory_Entries', new guielement('rawhtml', companydirectory_draw_entires($_REQUEST['id']), '')); 43 42 44 } 43 45 } … … 46 48 global $currentcomponent; 47 49 if($pagename=='companydirectory'){ 48 $currentcomponent->addprocessfunc('companydirectory_configprocess',1); 49 $currentcomponent->addprocessfunc('companydirectory_configpageload',1); 50 } 51 //$currentcomponent->addprocessfunc('companydirectory_shpwpage',5); 50 $currentcomponent->addprocessfunc('companydirectory_configprocess'); 51 $currentcomponent->addguifunc('companydirectory_configpageload'); 52 } 52 53 } 53 54 … … 69 70 70 71 switch($action){ 71 case 'edit': 72 //get real dest 73 $vars['invalid_destination']=$_REQUEST[$_REQUEST[$_REQUEST['invalid_destination']].str_replace('goto','',$_REQUEST['invalid_destination'])]; 74 companydirectory_save_dir_details($vars); 75 //if there was no id set, get the latest one that was saved 76 if($vars['id']==''){ 77 $sql=(($amp_conf["AMPDBENGINE"]=="sqlite3")?'SELECT last_insert_rowid()':'SELECT LAST_INSERT_ID()'); 78 $vars['id']=$db->getOne($sql); 79 } 80 companydirectory_save_dir_entries($vars['id'],$entries); 81 break; 82 case 'delete': 83 companydirectory_delete($vars['id']); 84 break; 72 case 'edit': 73 //get real dest 74 $vars['invalid_destination']=$_REQUEST[$_REQUEST[$_REQUEST['invalid_destination']].str_replace('goto','',$_REQUEST['invalid_destination'])]; 75 companydirectory_save_dir_details($vars); 76 //if there was no id set, get the latest one that was saved 77 if($vars['id']==''){ 78 $sql=(($amp_conf["AMPDBENGINE"]=="sqlite3")?'SELECT last_insert_rowid()':'SELECT LAST_INSERT_ID()'); 79 $vars['id']=$db->getOne($sql); 80 } 81 companydirectory_save_dir_entries($vars['id'],$entries); 82 redirect_standard('id'); 83 break; 84 case 'delete': 85 companydirectory_delete($vars['id']); 86 redirect_standard(); 87 break; 85 88 } 86 89 }
