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

Lack of Interest Importer Improvement: stepValidation option

Discussion in 'Closed Suggestions' started by Jeremy, Oct 11, 2011.

  1. Jeremy

    Jeremy XenForo Moderator Staff Member

    When creating steps for an importer, you have the following items in the options:
    - title
    - depends

    I think it would be beneficial to have the option to include a third option of "stepValidation" so that we can define a call back within the importer class to do a more advanced verification of step availability.
    My theory for this is that I'm working on an importer, and want to support importing of custom BBCodes, but I don't want to have the option available unless BBCM is installed. If I had this third option, I could create a _validateBBCMInstalled() function that returns true or false on whether or not the system should be available or not.

    As a side note: Here's how I accomplished it without this:
    PHP:
    if(XenForo_Application::autoload('KingK_BbCodeManager_BbCodeManager'))
    {
    $steps['bbcodes'] = array('title' => 'Import Custom BBCodes');
    }
    Worked like a charm.
     
    Onimua likes this.

Share This Page