[Home]OpenNewText

UseModWiki | RecentChanges | Preferences

OpenNewText

Called from OpenText only.

improvements

different text for edit / display of EmptyPageText:

 sub OpenNewText {
  my ($name, $status) = @_;  # Name of text (usually "default"); 'edit' status?
  %Text = ();
  # Later consider translation of new-page message? (per-user difference?)
  if ($NewText ne '') {
    $Text{'text'} = T($NewText);
  } elsif ( $status eq 'edit' ) {
    $Text{'text'} = T("This page doesn't exist yet.\n\nEnter text and press \"Save\" to create it. Press \"Cancel\" to abort editing without saving the page.\n\nPlease don't create new pages just for the sake of testing whether it works. It does, and it just leaves the admins with the task of having to clean up after you.\n\nIf you want to make test edits and play with the markup, go to the [[$SandboxPage?]] page instead.") . "\n";
  } else {
    $Text{'text'} = T("This page doesn't exist yet.\n\nIf you want to create it, click the \"Edit text of this page\" link at the foot of the page and type in some text.\n\nPlease don't create new pages just for the sake of testing whether it works. It does, and it just leaves the admins with the task of having to clean up after you.\n\nIf you want to make test edits and play with the markup, go to the [[$SandboxPage?]] page instead.");   
  }
  $Text{'text'} .= "\n"  if (substr($Text{'text'}, -1, 1) ne "\n");
  $Text{'minor'} = 0;      # Default as major edit
  $Text{'newauthor'} = 1;  # Default as new author
  $Text{'summary'} = '';
  &OpenNewSection("text_$name", join($FS3, %Text));
 }

UseModWiki | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited August 1, 2011 2:06 pm by JuanmaMP (diff)
Search: