plugins/admin/PageManager.php
author Dan
Sun, 04 May 2008 21:57:48 -0400
changeset 541 acb7e23b6ffa
parent 536 218a627eb53e
child 635 b3a33b661681
permissions -rw-r--r--
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
343
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
     1
<?php
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
     2
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
     3
/*
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
     4
 * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
536
218a627eb53e Rebrand as 1.1.4 (Caoineag alpha 4)
Dan
parents: 504
diff changeset
     5
 * Version 1.1.4 (Caoineag alpha 4)
218a627eb53e Rebrand as 1.1.4 (Caoineag alpha 4)
Dan
parents: 504
diff changeset
     6
 * Copyright (C) 2006-2008 Dan Fuhry
343
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
     7
 *
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
     8
 * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
     9
 * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    10
 *
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    11
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    12
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    13
 */
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    14
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    15
// Page management smart form
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    16
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    17
function page_Admin_PageManager()
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    18
{
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    19
  global $db, $session, $paths, $template, $plugins; // Common objects
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    20
  global $lang;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    21
  if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    22
  {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    23
    $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    24
    echo '<h3>' . $lang->get('adm_err_not_auth_title') . '</h3>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    25
    echo '<p>' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    26
    return;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    27
  }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    28
  
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    29
  echo '<h3>' . $lang->get('acppm_heading_main') . '</h3>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    30
  $show_select = true;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    31
  
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    32
  if ( isset($_REQUEST['action']) || isset($_REQUEST['source']) )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    33
  {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    34
    if ( isset($_REQUEST['action']) )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    35
    {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    36
      $act =& $_REQUEST['action'];
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    37
      $act = strtolower($act);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    38
    }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    39
    else if ( isset($_REQUEST['source']) && $_REQUEST['source'] == 'ajax' )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    40
    {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    41
      $act = 'select';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    42
    }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    43
    switch ( $act )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    44
    {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    45
      case 'save':
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    46
      case 'select':
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    47
        // First step is to determine the page ID and namespace
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    48
        
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    49
        if ( isset($_REQUEST['pid_search']) )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    50
        {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    51
          list($page_id, $namespace) = RenderMan::strToPageID($_REQUEST['page_id']);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    52
          $name = $db->escape(dirtify_page_id($page_id));
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    53
          $page_id = $db->escape(sanitize_page_id($page_id));
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    54
          $namespace = $db->escape($namespace);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    55
          $name = strtolower($name);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    56
          $page_id = strtolower($page_id);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    57
          $sql = "SELECT * FROM " . table_prefix . "pages WHERE ( " . ENANO_SQLFUNC_LOWERCASE . "(urlname) LIKE '%$page_id%' OR " . ENANO_SQLFUNC_LOWERCASE . "(name) LIKE '%$name%' ) ORDER BY name ASC;";
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    58
        }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    59
        else
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    60
        {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    61
          // pid_search was not set, assume absolute page ID
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    62
          list($page_id, $namespace) = RenderMan::strToPageID($_REQUEST['page_id']);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    63
          $page_id = $db->escape(sanitize_page_id($page_id));
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    64
          $namespace = $db->escape($namespace);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    65
          
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    66
          $sql = "SELECT * FROM " . table_prefix . "pages WHERE urlname = '$page_id' AND namespace = '$namespace';";
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    67
        }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    68
        
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    69
        if ( !($q = $db->sql_query($sql)) )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    70
        {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    71
          $db->_die('PageManager selecting dataset for page');
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    72
        }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    73
        
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    74
        if ( $db->numrows() < 1 )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    75
        {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    76
          echo '<div class="error-box">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    77
                  ' . $lang->get('acppm_err_page_not_found') . '
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    78
                </div>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    79
          break;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    80
        }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    81
        
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    82
        if ( $db->numrows() > 1 )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    83
        {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    84
          // Ambiguous results
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    85
          if ( isset($_REQUEST['pid_search']) )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    86
          {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    87
            echo '<h3>' . $lang->get('acppm_msg_results_ambiguous_title') . '</h3>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    88
            echo '<p>' . $lang->get('acppm_msg_results_ambiguous_body') . '</p>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    89
            echo '<ul>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    90
            while ( $row = $db->fetchrow($q) )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    91
            {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    92
              echo '<li>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    93
              $pathskey = $paths->nslist[$row['namespace']] . $row['urlname'];
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    94
              $edit_url = makeUrlNS('Special', 'Administration', "module={$paths->nslist['Admin']}PageManager&action=select&page_id=$pathskey", true);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    95
              $view_url = makeUrlNS($row['namespace'], $row['urlname']);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    96
              $page_name = htmlspecialchars(get_page_title_ns( $row['urlname'], $row['namespace'] ));
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    97
              $view_link = $lang->get('acppm_ambig_btn_viewpage');
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    98
              echo "<a href=\"$edit_url\">$page_name</a> (<a onclick=\"window.open(this.href); return false;\" href=\"$view_url\">$view_link</a>)";
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
    99
              echo '</li>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   100
            }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   101
            echo '</ul>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   102
            $show_select = false;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   103
            break;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   104
          }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   105
          else
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   106
          {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   107
            echo '<p>' . $lang->get('acppm_err_ambig_absolute') . '</p>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   108
            break;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   109
          }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   110
        }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   111
        
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   112
        // From this point on we can assume that exactly one matching page was found.
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   113
        $dataset = $db->fetchrow();
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   114
        $page_id = $dataset['urlname'];
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   115
        $namespace = $dataset['namespace'];
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   116
        
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   117
        // This is used to re-determine the page ID after submit.
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   118
        $pathskey = $paths->nslist[$namespace] . sanitize_page_id($page_id);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   119
        
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   120
        // The extra switch allows us to break out of the save routine if needed
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   121
        switch ( $act )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   122
        {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   123
          case 'save':
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   124
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   125
            $errors = array();
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   126
            $page_id_changed = false;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   127
            $namespace_changed = false;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   128
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   129
            // Backup the dataset to avoid redundantly updating values
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   130
            $dataset_backup = $dataset;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   131
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   132
            // We've elected to save the page. The angle of attack here is to validate each form field,
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   133
            // and if the field validates successfully, change the value in $dataset accordingly.
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   134
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   135
            // Field: page name
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   136
            $page_name = $_POST['page_name'];
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   137
            $page_name = trim($page_name);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   138
            if ( empty($page_name) )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   139
            {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   140
              $errors[] = $lang->get('acppm_err_invalid_page_name');
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   141
            }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   142
            else
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   143
            {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   144
              $dataset['name'] = $page_name;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   145
            }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   146
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   147
            // Field: page URL string
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   148
            $page_urlname = $_POST['page_urlname'];
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   149
            $page_urlname = trim($_POST['page_urlname']);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   150
            if ( empty($page_urlname) && getConfig('main_page') !== '' )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   151
            {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   152
              $errors[] = $lang->get('acppm_err_invalid_url_string');
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   153
            }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   154
            else
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   155
            {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   156
              $page_id_changed = ( $_POST['page_urlname'] !== $dataset['urlname'] );
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   157
              $dataset['urlname'] = sanitize_page_id($page_urlname);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   158
            }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   159
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   160
            // Field: namespace
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   161
            $namespace = $_POST['page_namespace'];
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   162
            if ( !isset($paths->nslist[ $namespace ]) )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   163
            {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   164
              $errors[] = $lang->get('acppm_err_invalid_namespace');
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   165
            }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   166
            else
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   167
            {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   168
              $namespace_changed = ( $_POST['page_namespace'] !== $dataset['namespace'] );
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   169
              $dataset['namespace'] = $namespace;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   170
            }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   171
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   172
            // Field: comments enabled
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   173
            $dataset['comments_on'] = ( isset($_POST['comments_on']) ) ? 1 : 0;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   174
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   175
            // Field: page visible
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   176
            $dataset['visible'] = ( isset($_POST['visible']) ) ? 1 : 0;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   177
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   178
            // Field: standalone page
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   179
            $dataset['special'] = ( isset($_POST['special']) ) ? 1 : 0;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   180
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   181
            // Field: page protection
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   182
            $protect_level = $_POST['protected'];
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   183
            if ( !in_array($protect_level, array('0', '1', '2')) )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   184
            {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   185
              $errors[] = $lang->get('acppm_err_invalid_protection');
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   186
            }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   187
            else
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   188
            {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   189
              $dataset['protected'] = intval($protect_level);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   190
            }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   191
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   192
            // Field: wiki mode
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   193
            $wiki_mode = $_POST['wikimode'];
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   194
            if ( !in_array($wiki_mode, array('0', '1', '2')) )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   195
            {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   196
              $errors[] = $lang->get('acppm_err_invalid_wiki_mode');
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   197
            }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   198
            else
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   199
            {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   200
              $dataset['wiki_mode'] = intval($wiki_mode);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   201
            }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   202
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   203
            if ( count($errors) < 1 )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   204
            {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   205
              // We're free of errors. Build a SQL query to update the page table.
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   206
              $particles = array();
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   207
              
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   208
              foreach ( $dataset as $key => $value )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   209
              {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   210
                if ( $value === $dataset_backup[$key] || ( is_int($value) && $value === intval($dataset_backup[$key]) ) )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   211
                  continue;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   212
                if ( is_int($value) )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   213
                {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   214
                  $particle = "$key = $value";
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   215
                }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   216
                else
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   217
                {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   218
                  $value = $db->escape($value);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   219
                  $particle = "$key = '$value'";
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   220
                }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   221
                $particles[] = $particle;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   222
                unset($particle);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   223
              }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   224
              
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   225
              $page_id_new = $db->escape($dataset['urlname']);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   226
              $namespace_new = $db->escape($dataset['namespace']);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   227
              
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   228
              // Only run the update query if at least one field was changed.
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   229
              if ( count($particles) > 0 )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   230
              {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   231
                $particles = implode(', ', $particles);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   232
                $page_id_db = $db->escape($page_id);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   233
                $namespace_db = $db->escape($namespace);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   234
                $sql = 'UPDATE ' . table_prefix . "pages SET $particles WHERE urlname = '$page_id_db' AND namespace = '$namespace_db';";
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   235
                
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   236
                if ( !$db->sql_query($sql) )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   237
                  $db->_die('PageManager running primary update query');
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   238
                
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   239
                // Did we change the page ID or namespace? If so we need to also change logs, comments, tags, etc.
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   240
                if ( $page_id_changed || $namespace_changed )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   241
                {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   242
                  $sql = array(
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   243
                      'UPDATE ' . table_prefix . "logs SET page_id = '$page_id_new', namespace = '$namespace_new' WHERE page_id = '$page_id_db' AND namespace = '$namespace_db';",
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   244
                      'UPDATE ' . table_prefix . "tags SET page_id = '$page_id_new', namespace = '$namespace_new' WHERE page_id = '$page_id_db' AND namespace = '$namespace_db';",
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   245
                      'UPDATE ' . table_prefix . "comments SET page_id = '$page_id_new', namespace = '$namespace_new' WHERE page_id = '$page_id_db' AND namespace = '$namespace_db';",
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   246
                      'UPDATE ' . table_prefix . "page_text SET page_id = '$page_id_new', namespace = '$namespace_new' WHERE page_id = '$page_id_db' AND namespace = '$namespace_db';",
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   247
                      'UPDATE ' . table_prefix . "categories SET page_id = '$page_id_new', namespace = '$namespace_new' WHERE page_id = '$page_id_db' AND namespace = '$namespace_db';"
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   248
                    );
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   249
                  foreach ( $sql as $q )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   250
                  {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   251
                    if ( !$db->sql_query($q) )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   252
                      $db->_die('PageManager running slave update query after page ID/namespace change');
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   253
                  }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   254
                }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   255
                
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   256
                // Did we change the name of the page? If so, make PageUtils log it
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   257
                if ( $dataset_backup['name'] != $dataset['name'] )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   258
                {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   259
                  PageUtils::rename($page_id_new, $namespace_new, $dataset['name']);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   260
                }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   261
              }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   262
              
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   263
              // Did the user ask to delete the page?
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   264
              if ( isset($_POST['delete']) )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   265
              {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   266
                PageUtils::deletepage($page_id_new, $namespace_new, $lang->get('acppm_delete_reason'));
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   267
              }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   268
              
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   269
              echo '<div class="info-box">' . $lang->get('acppm_msg_save_success', array( 'viewpage_url' => makeUrlNS($dataset['namespace'], $dataset['urlname']) )) . '</div>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   270
              break 2;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   271
            }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   272
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   273
            break;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   274
        }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   275
        $tpl_code = <<<TPLCODE
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   276
        <div class="tblholder">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   277
          <table border="0" cellspacing="1" cellpadding="4">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   278
            <tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   279
              <th colspan="2">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   280
                {lang:acppm_heading_editing} "{PAGE_NAME}"
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   281
              </th>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   282
            </tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   283
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   284
            <tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   285
              <td class="row2">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   286
                {lang:acppm_lbl_page_name}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   287
              </td>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   288
              <td class="row1">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   289
                <input type="text" name="page_name" value="{PAGE_NAME}" size="40" />
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   290
              </td>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   291
            </tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   292
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   293
            <tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   294
              <td class="row2">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   295
                {lang:acppm_lbl_page_urlname}<br />
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   296
                <small>{lang:acppm_lbl_page_urlname_hint}</small>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   297
              </td>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   298
              <td class="row1">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   299
                <input type="text" name="page_urlname" value="{PAGE_URLNAME}" size="40" />
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   300
              </td>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   301
            </tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   302
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   303
            <tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   304
              <td class="row2">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   305
                {lang:acppm_lbl_namespace}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   306
              </td>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   307
              <td class="row1">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   308
                <select name="page_namespace">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   309
                {NAMESPACE_LIST}</select>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   310
              </td>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   311
            </tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   312
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   313
            <tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   314
              <th colspan="2" class="subhead">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   315
                {lang:acppm_heading_advanced}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   316
              </th>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   317
            </tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   318
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   319
            <tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   320
              <td class="row2">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   321
                {lang:acppm_lbl_enable_comments_title}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   322
              </td>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   323
              <td class="row1">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   324
                <label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   325
                  <input type="checkbox" name="comments_on" <!-- BEGIN comments_enabled -->checked="checked" <!-- END comments_enabled -->/>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   326
                  {lang:acppm_lbl_enable_comments}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   327
                </label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   328
                <br />
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   329
                <small>{lang:acppm_lbl_enable_comments_hint}</small>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   330
              </td>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   331
            </tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   332
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   333
            <tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   334
              <td class="row2">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   335
                {lang:acppm_lbl_special_title}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   336
              </td>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   337
              <td class="row1">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   338
                <label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   339
                  <input type="checkbox" name="special" <!-- BEGIN special -->checked="checked" <!-- END special -->/>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   340
                  {lang:acppm_lbl_special}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   341
                </label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   342
                <br />
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   343
                <small>{lang:acppm_lbl_special_hint}</small>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   344
              </td>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   345
            </tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   346
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   347
            <tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   348
              <td class="row2">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   349
                {lang:acppm_lbl_visible_title}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   350
              </td>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   351
              <td class="row1">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   352
                <label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   353
                  <input type="checkbox" name="visible" <!-- BEGIN visible -->checked="checked" <!-- END visible -->/>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   354
                  {lang:acppm_lbl_visible}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   355
                </label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   356
                <br />
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   357
                <small>{lang:acppm_lbl_visible_hint}</small>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   358
              </td>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   359
            </tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   360
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   361
            <tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   362
              <td class="row2">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   363
                {lang:acppm_lbl_protected_title}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   364
              </td>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   365
              <td class="row1">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   366
                <label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   367
                  <input type="radio" name="protected" value="0" <!-- BEGIN protected_off -->checked="checked" <!-- END protected_off -->/>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   368
                  {lang:acppm_lbl_protected_off}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   369
                </label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   370
                <br />
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   371
                <label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   372
                  <input type="radio" name="protected" value="1" <!-- BEGIN protected_on -->checked="checked" <!-- END protected_on -->/>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   373
                  {lang:acppm_lbl_protected_on}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   374
                </label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   375
                <br />
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   376
                <label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   377
                  <input type="radio" name="protected" value="2" <!-- BEGIN protected_semi -->checked="checked" <!-- END protected_semi -->/>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   378
                  {lang:acppm_lbl_protected_semi}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   379
                </label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   380
                <br />
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   381
                <small>{lang:acppm_lbl_protected_hint}</small>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   382
              </td>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   383
            </tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   384
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   385
            <tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   386
              <td class="row2">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   387
                {lang:acppm_lbl_wikimode_title}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   388
              </td>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   389
              <td class="row1">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   390
                <label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   391
                  <input type="radio" name="wikimode" value="0" <!-- BEGIN wikimode_off -->checked="checked" <!-- END wikimode_off -->/>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   392
                  {lang:acppm_lbl_wikimode_off}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   393
                </label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   394
                <br />
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   395
                <label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   396
                  <input type="radio" name="wikimode" value="1" <!-- BEGIN wikimode_on -->checked="checked" <!-- END wikimode_on -->/>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   397
                  {lang:acppm_lbl_wikimode_on}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   398
                </label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   399
                <br />
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   400
                <label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   401
                  <input type="radio" name="wikimode" value="2" <!-- BEGIN wikimode_global -->checked="checked" <!-- END wikimode_global -->/>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   402
                  {lang:acppm_lbl_wikimode_global}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   403
                </label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   404
                <br />
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   405
                <small>{lang:acppm_lbl_wikimode_hint}</small>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   406
              </td>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   407
            </tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   408
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   409
            <tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   410
              <td class="row2">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   411
                {lang:acppm_lbl_delete_title}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   412
              </td>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   413
              <td class="row1">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   414
                <label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   415
                  <input type="checkbox" name="delete" />
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   416
                  {lang:acppm_lbl_delete}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   417
                </label>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   418
                <br />
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   419
                <small>{lang:acppm_lbl_delete_hint}</small>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   420
              </td>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   421
            </tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   422
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   423
            <tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   424
              <th colspan="2" class="subhead">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   425
                <button name="action" value="save">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   426
                  <b>{lang:etc_save_changes}</b>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   427
                </button>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   428
                <button name="action" value="nil">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   429
                  <b>{lang:etc_cancel}</b>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   430
                </button>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   431
              </th>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   432
            </tr>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   433
            
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   434
          </table>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   435
        </div>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   436
        
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   437
        <input type="hidden" name="page_id" value="{PATHS_KEY}" />
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   438
TPLCODE;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   439
        $parser = $template->makeParserText($tpl_code);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   440
        
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   441
        $ns_list = '';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   442
        foreach ( $paths->nslist as $ns => $prefix ) 
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   443
        {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   444
          // FIXME: Plugins need to specify whether they want Enano's regular PageProcessor
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   445
          // to handle these pages, and whether such pages from namespaces created by plugins
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   446
          // can be stored in the database or not.
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   447
          if ( $ns == 'Special' || $ns == 'Admin' || $ns == 'Anonymous' )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   448
            continue;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   449
          $ns = htmlspecialchars($ns);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   450
          $prefix = htmlspecialchars($prefix);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   451
          if ( empty($prefix) )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   452
            $prefix = $lang->get('acppm_ns_article');
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   453
          $sel = ( $dataset['namespace'] == $ns ) ? ' selected="selected"' : '';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   454
          $ns_list .= "  <option value=\"$ns\"$sel>$prefix</option>\n                ";
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   455
        }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   456
        
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   457
        $parser->assign_vars(array(
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   458
            'PAGE_NAME' => htmlspecialchars($dataset['name']),
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   459
            'PAGE_URLNAME' => htmlspecialchars($dataset['urlname']),
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   460
            'NAMESPACE_LIST' => $ns_list,
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   461
            'PATHS_KEY' => $pathskey
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   462
          ));
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   463
        
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   464
        $parser->assign_bool(array(
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   465
            'comments_enabled' => ( $dataset['comments_on'] == 1 ),
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   466
            'special' => ( $dataset['special'] == 1 ),
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   467
            'visible' => ( $dataset['visible'] == 1 ),
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   468
            'protected_off'   => ( $dataset['protected'] == 0 ),
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   469
            'protected_on'    => ( $dataset['protected'] == 1 ),
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   470
            'protected_semi'  => ( $dataset['protected'] == 2 ),
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   471
            'wikimode_off'    => ( $dataset['wiki_mode'] == 0 ),
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   472
            'wikimode_on'     => ( $dataset['wiki_mode'] == 1 ),
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   473
            'wikimode_global' => ( $dataset['wiki_mode'] == 2 )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   474
          ));
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   475
        
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   476
        if ( isset($errors) )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   477
        {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   478
          echo '<div class="error-box">';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   479
          echo $lang->get('acppm_err_header');
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   480
          echo '<ul>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   481
          echo '<li>' . implode('</li><li>', $errors) . '</li>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   482
          echo '</ul>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   483
          echo '</div>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   484
        }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   485
        
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   486
        $form_action = makeUrlNS('Special', 'Administration', "module={$paths->nslist['Admin']}PageManager", true);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   487
        
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   488
        echo "<form action=\"$form_action\" method=\"post\">";
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   489
        echo $parser->run();
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   490
        echo "</form>";
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   491
        
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   492
        $show_select = false;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   493
        break;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   494
    }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   495
  }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   496
  
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   497
  if ( $show_select )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   498
  {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   499
    echo '<p>' . $lang->get('acppm_hint') . '</p>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   500
    
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   501
    // Show the search form
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   502
    
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   503
    $form_action = makeUrlNS('Special', 'Administration', "module={$paths->nslist['Admin']}PageManager", true);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   504
    echo "<form action=\"$form_action\" method=\"post\">";
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   505
    echo $lang->get('acppm_lbl_field_search') . ' ';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   506
    echo $template->pagename_field('page_id') . ' ';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   507
    echo '<input type="hidden" name="action" value="select" />';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   508
    echo '<input type="submit" name="pid_search" value="' . $lang->get('search_btn_search') . '" />';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   509
    echo "</form>";
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   510
    
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   511
    // Grab all pages from the database and show a list of pages on the site
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   512
    
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   513
    echo '<h3>' . $lang->get('acppm_heading_select_page_from_list') . '</h3>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   514
    echo '<p>' . $lang->get('acppm_hint_select_page_from_list') . '</p>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   515
    
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   516
    $q = $db->sql_query('SELECT COUNT(name) AS num_pages FROM ' . table_prefix . 'pages;');
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   517
    if ( !$q )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   518
      $db->_die('PageManager doing initial page count');
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   519
    list($num_pages) = $db->fetchrow_num();
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   520
    $db->free_result();
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   521
    
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   522
    $pg_start = ( isset($_GET['offset']) ) ? intval($_GET['offset']) : 0;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   523
    
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   524
    $q = $db->sql_unbuffered_query('SELECT urlname, name, namespace, ' . $num_pages . ' AS num_pages, ' . $pg_start . ' AS offset FROM ' . table_prefix . 'pages ORDER BY name ASC;');
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   525
    if ( !$q )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   526
      $db->_die('PageManager doing main select query for page list');
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   527
    
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   528
    // Paginate results
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   529
    $html = paginate(
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   530
        $q,
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   531
        '{urlname}',
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   532
        $num_pages,
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   533
        makeUrlNS('Special', 'Administration', "module={$paths->nslist['Admin']}PageManager&offset=%s", false),
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   534
        $pg_start,
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   535
        99,
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   536
        array('urlname' => 'admin_pagemanager_format_listing'),
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   537
        '<div class="tblholder" style="height: 300px; clip: rect(0px, auto, auto, 0px); overflow: auto;">
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   538
        <table border="0" cellspacing="1" cellpadding="4">',
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   539
        '  </table>
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   540
         </div>'
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   541
      );
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   542
    echo $html;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   543
  }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   544
  
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   545
}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   546
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   547
function admin_pagemanager_format_listing($_, $row)
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   548
{
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   549
  global $db, $session, $paths, $template, $plugins; // Common objects
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   550
  
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   551
  static $cell_count = 0;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   552
  static $td_class = 'row1';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   553
  static $run_count = 0;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   554
  static $num_pages_floor = false;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   555
  if ( !$num_pages_floor )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   556
  {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   557
    $num_pages_floor = $row['num_pages'];
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   558
    while ( $num_pages_floor % 99 > 0 )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   559
      $num_pages_floor--;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   560
  }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   561
  $return = '';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   562
  $run_count++;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   563
  
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   564
  $last_page = ( $row['offset'] == $num_pages_floor );
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   565
  $last_run = ( ( $last_page && $run_count == $row['num_pages'] % 99 ) || $run_count == 99 );
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   566
  if ( $cell_count == 0 )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   567
  {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   568
    $return .= "<tr>\n";
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   569
  }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   570
  $title = get_page_title_ns($row['urlname'], $row['namespace']);
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   571
  $pathskey = $paths->nslist[$row['namespace']] . $row['urlname'];
345
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 343
diff changeset
   572
  if ( isset($row['mode']) && $row['mode'] == 'edit' )
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 343
diff changeset
   573
  {
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 343
diff changeset
   574
    $url = makeUrlNS($row['namespace'], $row['urlname'], false, true) . '#do:edit';
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 343
diff changeset
   575
  }
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 343
diff changeset
   576
  else
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 343
diff changeset
   577
  {
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 343
diff changeset
   578
    $url = makeUrlNS('Special', 'Administration', "module={$paths->nslist['Admin']}PageManager&action=select&page_id=$pathskey", true);
4ccdfeee9a11 WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents: 343
diff changeset
   579
  }
343
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   580
  $url = '<a href="' . $url . '">' . htmlspecialchars($title) . '</a>';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   581
  $return .= '  <td class="' . $td_class . '" style="width: 33%;">' . $url . '</td>' . "\n";
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   582
  $cell_count++;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   583
  if ( $cell_count == 3 && !$last_run )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   584
  {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   585
    $cell_count = 0;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   586
    $td_class = ( $td_class == 'row2' ) ? 'row1' : 'row2';
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   587
    $return .= "</tr>\n";
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   588
  }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   589
  else if ( $last_run )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   590
  {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   591
    while ( $cell_count < 3 )
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   592
    {
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   593
      $return .= "  <td class=\"{$td_class}\"></td>\n";
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   594
      $cell_count++;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   595
    }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   596
    $return .= "</tr>\n";
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   597
  }
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   598
  return $return;
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   599
}
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   600
eefe9ab7fe7c Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
diff changeset
   601
?>