function se_on_save_page($strSourceText, &$oPage) { seChangeLocale(); //the lib to include $oCurrentFile = new PFile(__FILE__); require_once $oCurrentFile->getParentPath() . SLASH . 'include' . SLASH . 'lib.searchengine.php'; if (!se_get_config('ACTIVATE', $bActivate)) { return $strSourceText; } if (!$bActivate) { return $strSourceText; } $returnval = true; if (!connectBdd()) { return false; } if (exist_page_search($oPage->getUrl())) { $type = 'update'; } else { $type = 'insert'; } switch ($type) { case 'insert': $returnval = insert_info_search($oPage, $strSourceText); break; case 'update': $returnval = update_info_search($oPage, $strSourceText); break; } closeBdd(); return $returnval ? $strSourceText : false; }
function syncDir(&$pDir) { $tabList = $pDir->listDir(); foreach ($tabList as $strPath) { if (is_dir($strPath)) { if (!syncDir(getFileObject($strPath))) { return false; } } else { if (!insert_info_search(getFileObject($strPath))) { return false; } } } return true; }