Page 1 of 1
[SOLVED] News Module Field Definition
Posted: Thu Nov 22, 2007 6:21 am
by giggler
Is there a way to delete a field definition. I created one to test and now I can't delete. Also if you click on edit, it will not give you the option to edit the Type.
I can see that there is a action.admin_deletefielddef.php in the new module directory, but where is the icon to allow you to delete.
Re: News Module Field Definition
Posted: Thu Nov 22, 2007 6:31 am
by giggler
Ok, I figured out how to add the delete icon. in function.admin_customfieldstab.php
find
$onerow->editlink = $this->CreateLink($id, 'admin_editfielddef', $returnid, $gCms->variables['admintheme']->DisplayImage('icons/system/edit.gif', $this->Lang('edit'),'','','systemicon'), array('fdid'=>$row['id']));
add above that (or below):
$onerow->deletelink = $this->CreateLink($id, 'admin_deletefielddef', $returnid, $gCms->variables['admintheme']->DisplayImage('icons/system/delete.gif', $this->Lang('delete'),'','','systemicon'), array('fdid'=>$row['id']));
To add the type dropdown:
find:
$smarty->assign('showinputtype', false);
$smarty->assign('inputtype', $this->CreateInputHidden($id, 'type', $type));
replace with:
$smarty->assign('showinputtype', true);
$smarty->assign('inputtype', $this->GetTypesDropdown($id, 'type', $type));
Was there a reason why that was hidden by default? It would be nice if there's field definition for pages.
Re: [SOLVED] News Module Field Definition
Posted: Thu Nov 22, 2007 1:58 pm
by calguy1000
Because deleting field definitions should go through and delete that field from all news articles, and if it is a file type field remove the file, otherwise the data is orphaned. Similarly with changing the type there is a potential to orphan the data.
This functionality wasn't complete yet, so thererfore the edit and delete field definition options were left out.
Re: [SOLVED] News Module Field Definition
Posted: Thu Nov 22, 2007 9:30 pm
by giggler
Good to know - this Field Definition option will be great for Pages also.