/** * this function we need to first unzip the zipped file, then * process the files withing the zipeed file, then we'll need * to create our custom post types, etc. */ public static function process_mini_audit_entry($entry) { self::$keyword = $entry[1]; self::$location = $entry[2]; $zipfile = $entry[3]; $auditdir = self::unzip_file($zipfile); if ($ret === false) { LPOP_Logger::logit("FAIL: Prospector can not unzip {$zipfile}"); return; } // Save these variables for posterity self::$zipfile = $zipfile; self::$dirs[] = $auditdir; LPOP_Logger::logit("Unzipped {$zipfile} ===> {$auditdir} "); /* * Process all the files in the directory and create a set * of records that we'll then use to create our mini audit * posts */ self::process_audit_dirs(); /* * Now march throuh all the records */ foreach (self::$all_records as $k => $record) { /* * now we need to create our custom post.. */ $ma = new LPOP_Mini_Audit(); $id = $ma->create_post($record); if ($id === null || $id < 1) { LPOP_Logger::logit(" Failed to create mini audit for {$k} "); } } }
function lpop_gform_get_entry($attrs) { /* Parse the id */ $entry = RGFormsModel::get_lead(1); $form = GFFormsModel::get_form_meta($entry['form_id']); LPOP_Logger::logit("Loading Mini Audits: Form = " . $form['title'] . ", Entry = " . $entry['id']); LPOP_Mini_Audits::process_mini_audit_entry($entry); LPOP_Logger::flush(); }