Difference between revisions of "Copy.php"
(Combine move functionality and allow proper moves (current way is called "alias")) |
m |
||
Line 29: | Line 29: | ||
<td>Copy/Move properties as well, if applicable. | <td>Copy/Move properties as well, if applicable. | ||
<tr><td align=right><input type=checkbox checked=checked value=1 name=\"xpath:/properties/copy:talk\"> | <tr><td align=right><input type=checkbox checked=checked value=1 name=\"xpath:/properties/copy:talk\"> | ||
− | <td>Move "talk" page as well, if applicable. | + | <td>Move \"talk\" page as well, if applicable. |
<tr><td align=right><input type=checkbox checked=checked value=1 name=\"xpath:/properties/copy:talk\"> | <tr><td align=right><input type=checkbox checked=checked value=1 name=\"xpath:/properties/copy:talk\"> | ||
<tr><td align=right>Action:<td><input type=radio name=action value=move checked>Move | <tr><td align=right>Action:<td><input type=radio name=action value=move checked>Move |
Revision as of 08:00, 10 March 2006
<?
- Get copy-target and summary-text from form
xwGetProperty( $properties, 'copy/target', $target ); xwGetProperty( $properties, 'copy/summary', $summary ); xwGetProperty( $properties, 'copy/xml', $xml ); xwGetProperty( $properties, 'copy/talk', $talk ); xwGetProperty( $properties, 'copy/action', $action ); xwGetProperty( $properties, 'copy/redir', $redir );
if ( $target ) { # Do the copy if target defined if ( $summary ) $summary = ": $summary"; $target = ucfirst( eregi_replace( '[^a-z0-9_]+', '_', $target ) ); $a = new Article( $t = Title::newFromText( $target ) ); if ( $t->getArticleID() ) xwMessage( "Copy failed! \"$target\" already exists!", 'red' ); else $a->insertNewArticle( $article, "Copied from $title$summary", false, false ); } else { # No target defined, render the copy form
$article = "
Copy article:
<form action=\"/wiki/index.php\">
<input type=hidden name=title value=\"$title\"> <input type=hidden name=\"xpath:/properties:data\" value=\"$tTitle\"> <input type=hidden name=\"xpath:/properties:copy\">
New title: | <input type=text name=\"xpath:/properties/copy:target\"> |
Summary: | <input type=text name=\"xpath:/properties/copy:summary\"> |
<input type=checkbox checked=checked value=1 name=\"xpath:/properties/copy:xml\"> | Copy/Move properties as well, if applicable. |
<input type=checkbox checked=checked value=1 name=\"xpath:/properties/copy:talk\"> | Move \"talk\" page as well, if applicable. |
<input type=checkbox checked=checked value=1 name=\"xpath:/properties/copy:talk\"> | |
Action: | <input type=radio name=action value=move checked>Move
<input type=radio name=action value=alias>Alias <input type=radio name=action value=copy>Copy |
<input type=submit value=\" Copy \"> |
</form>";
}
?>