  def start
    Log.add_info(request, params.inspect)

    return unless request.post?

    tmpl_folder, tmpl_q_folder = TemplatesHelper.get_tmpl_subfolder(TemplatesHelper::TMPL_RESEARCH)

    if tmpl_q_folder.nil?
      ary = TemplatesHelper.setup_tmpl_folder
      tmpl_q_folder = ary[4]
    end

    items = Folder.get_items_admin(tmpl_q_folder.id, 'xorder ASC')
 
    if items.nil? or items.empty?

      render(:text => t('research.create_page_first'))
      return
    else

      ApplicationHelper.delete_file_safe(Research.get_pages)

      items.each_with_index do |item, idx|
        desc = item.description
        if desc.nil? or desc.empty?
          render(:text => t('research.specify_page_content') + item.title.to_s)
          return
        end

        q_hash = Research.find_q_codes(desc)
        q_hash.each do |q_code, q_param|
          desc = Research.replaceCtrl(desc, q_code, q_param)
        end

        FileUtils.mkdir_p(Research.page_dir)

        file_name = sprintf('_q%02d.html.erb', idx+1)
        path = File.join(Research.page_dir, file_name)

        ApplicationHelper.f_ensure_exist(path)
        mode = ApplicationHelper.f_chmod(0666, path)

        begin
          f = File.open(path, 'w')
          f.write(desc)
          f.close
        rescue => evar
          logger.fatal(evar.to_s)
        end

        ApplicationHelper.f_chmod(mode, path)
      end
    end

    render(:text => '')

  rescue => evar
    Log.add_error(request, evar)
    render(:text => evar.to_s)
  end
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.