1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Lack of Interest Create some usefull Installhelper Classes for 3rd party devs

Discussion in 'Closed Suggestions' started by ragtek, Mar 28, 2011.

  1. ragtek

    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:
    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);
    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:D
     
    Robbo likes this.
  2. Robbo

    Robbo Well-Known Member

    I agree with this. Do I have to manually write the insert queries to create my content type? Also you might be able to answer this... why is there both content_type and content_type_field tables? Looks like they both do the same thing just with a different data structure? Is one a cache?
     
  3. ragtek

    ragtek Guest

Share This Page