[SOLVED] News Module Field Definition

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
giggler
Forum Members
Forum Members
Posts: 197
Joined: Tue Oct 09, 2007 7:08 am

[SOLVED] News Module Field Definition

Post 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.
Last edited by giggler on Thu Nov 22, 2007 6:38 am, edited 1 time in total.
giggler
Forum Members
Forum Members
Posts: 197
Joined: Tue Oct 09, 2007 7:08 am

Re: News Module Field Definition

Post 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.
Last edited by giggler on Thu Nov 22, 2007 6:39 am, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: [SOLVED] News Module Field Definition

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
giggler
Forum Members
Forum Members
Posts: 197
Joined: Tue Oct 09, 2007 7:08 am

Re: [SOLVED] News Module Field Definition

Post by giggler »

Good to know - this Field Definition option will be great for Pages also.
Post Reply

Return to “CMSMS Core”