} } } } } } } } # The access level check is done in the APIs if (isset($f_page_id)) { $c_page_id = stripslashes(urldecode($f_page_id)); if ('unindex' === $f_action) { page_delete($c_page_id); } if ('index' === $f_action) { page_add($c_page_id); } $t_url = $HTTP_REFERER; } if (isset($f_wait)) { print_html_top(); print_head_top(); print_title($g_window_title); print_css($g_css_inc_file); print_head_bottom(); print_body_top(); print_header($g_page_title); print_top_page($g_top_page_inc); print_admin_menu(); echo "<br /><div align=\"center\">Operation Successful<br /><a href=\"{$t_url}\">[ Click here to proceed ]</a></div><br />"; print_footer(__FILE__);
function page_add_dir($p_path = '', $p_recursive = true) { $dirs = array(); $files = array(); $handle = opendir($p_path); while ($file = readdir($handle)) { if ($file == '.' || $file == '..') { continue; } if (is_dir($p_path . $file)) { $dirs[] = $file; } else { $files[] = $file; } } closedir($handle); sort($dirs); sort($files); foreach ($files as $file) { $t_filename = $p_path . $file; page_add($t_filename); } # if not recursive return before processing sub-directories if (!$p_recursive) { return; } foreach ($dirs as $dir) { page_add_dir($p_path . $dir . DIRECTORY_SEPARATOR); } }