while ($filename = readdir($dir_handle)) { if (!is_dir($dir . $filename)) { unlink($dir . $filename); } } closedir($dir_handle); } // save if (i18n_navigation_structure_save($pages)) { $msg = i18n_r('i18n_navigation/SAVE_SUCCESS') . ' <a href="load.php?id=i18n_navigation&undo">' . i18n_r('UNDO') . '</a>'; $success = true; i18n_clear_cache(); } else { $msg = i18n_r('i18n_navigation/SAVE_FAILURE'); if (!i18n_navigation_structure_undo()) { i18n_clear_cache(); } i18n_navigation_structure_load($pages, $languages); } } // sort pages if (count($pages) > 0) { foreach ($pages as &$page) { if ($page['parent'] && !isset($pages[$page['parent']])) { $page['parent'] = null; } $level = -1; $sort = ''; for ($p = $page; $p && $level < 20; $p = $p['parent'] ? $pages[$p['parent']] : null) { $sort = sprintf('%03d', $p['menuOrder']) . $p['title'] . ' ' . $sort; $level++;
function i18n_navigation_save() { include GSPLUGINPATH . 'i18n_navigation/save.php'; i18n_clear_cache(); }