R
ragtek
Guest
Once the coders start creating add-ons with own content & node types, it gets really tricky, when it comes to creating the install & deinstall code.
IMHO it would be much cooler(and easier), if the xf framework would handle all this stuff.
You could provide a class, where we would only need to give the params and xf would do the work.
for example the install code could look like:
The same could be done with node types
With this, also the deinstallation would be much easier.
While the deinstallation, xf have the add-on id, so it could query all the content types for this add-on =>(for deleting of the attachments, likes, alerts,moderation center items, report center items, etc...)
(see also this thread http://xenforo.com/community/threads/delete-specific-contenttype-attachments.12940/ )
The best solution would be, to give us also a nice UI in the admincenter to manage all this stuff, so we wouldn't need to take care of anything.
Create content/node type, associate the classes and save the form
IMHO it would be much cooler(and easier), if the xf framework would handle all this stuff.
You could provide a class, where we would only need to give the params and xf would do the work.
for example the install code could look like:
PHP:
/*
array containing the content type and the fields
*/
$contentTypeArray = array(
'ragtek_article' => array
(
array('news_feed_handler_class','Ragtek_AS_NewsFeedHandler_Article'),
array('attachment_handler_class','Ragtek_AS_AttachmentHandler_Article')
)
);
XenForo_Install_ContentTypes::insert($contentTypeArray);
With this, also the deinstallation would be much easier.
While the deinstallation, xf have the add-on id, so it could query all the content types for this add-on =>(for deleting of the attachments, likes, alerts,moderation center items, report center items, etc...)
(see also this thread http://xenforo.com/community/threads/delete-specific-contenttype-attachments.12940/ )
The best solution would be, to give us also a nice UI in the admincenter to manage all this stuff, so we wouldn't need to take care of anything.
Create content/node type, associate the classes and save the form
Upvote
1