# HG changeset patch # User Dan # Date 1199339710 18000 # Node ID cdf24ba5f11465dd3a3676e8e8ce82dd0088ef5b # Parent 4ccdfeee9a117608a42a8a1f7d811e2c60dfcc33 Oops, forgot to add in the rewritten Admin:PageEditor diff -r 4ccdfeee9a11 -r cdf24ba5f114 plugins/admin/PageEditor.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/admin/PageEditor.php Thu Jan 03 00:55:10 2008 -0500 @@ -0,0 +1,177 @@ +auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) + { + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '
' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '
'; + return; + } + + echo '' . $lang->get('acped_msg_results_ambiguous_body') . '
'; + echo '' . $lang->get('acped_err_ambig_absolute') . '
'; + break; + } + } + + // From this point on we can assume that exactly one matching page was found. + $dataset = $db->fetchrow(); + $page_id = $dataset['urlname']; + $namespace = $dataset['namespace']; + $url = makeUrlNS($namespace, $page_id, false, true) . '#do:edit'; + $url = addslashes($url); + echo ''; + + $show_select = false; + break; + } + } + + if ( $show_select ) + { + echo '' . $lang->get('acped_hint') . '
'; + + // Show the search form + + $form_action = makeUrlNS('Special', 'Administration', "module={$paths->nslist['Admin']}PageEditor", true); + echo ""; + + // Grab all pages from the database and show a list of pages on the site + + echo '' . $lang->get('acped_hint_select_page_from_list') . '
'; + + $q = $db->sql_query('SELECT COUNT(name) AS num_pages FROM ' . table_prefix . 'pages;'); + if ( !$q ) + $db->_die('PageManager doing initial page count'); + list($num_pages) = $db->fetchrow_num(); + $db->free_result(); + + $pg_start = ( isset($_GET['offset']) ) ? intval($_GET['offset']) : 0; + + $q = $db->sql_unbuffered_query('SELECT urlname, name, namespace, ' . $num_pages . ' AS num_pages, ' . $pg_start . ' AS offset, \'edit\' AS mode FROM ' . table_prefix . 'pages ORDER BY name ASC;'); + if ( !$q ) + $db->_die('PageManager doing main select query for page list'); + + // Paginate results + $html = paginate( + $q, + '{urlname}', + $num_pages, + makeUrlNS('Special', 'Administration', "module={$paths->nslist['Admin']}PageEditor&offset=%s", false), + $pg_start, + 99, + array('urlname' => 'admin_pagemanager_format_listing'), + '