Difference between revisions of "Copy.php"
(Add copy properties link) |
m |
||
Line 21: | Line 21: | ||
<input type=hidden name=\"xpath:/properties:copy\"> | <input type=hidden name=\"xpath:/properties:copy\"> | ||
<table border=0> | <table border=0> | ||
− | <tr><td>New title:<td><input type=text name=\"xpath:/properties/copy:target\"> | + | <tr><td align=right>New title:<td><input type=text name=\"xpath:/properties/copy:target\"> |
− | <tr><td>Summary:<td><input type=text name=\"xpath:/properties/copy:summary\"> | + | <tr><td align=right>Summary:<td><input type=text name=\"xpath:/properties/copy:summary\"> |
− | <tr><td><input type=checkbox checked=checked value=1 name=\"xpath:/properties/copy:xml\"> | + | <tr><td align=right><input type=checkbox checked=checked value=1 name=\"xpath:/properties/copy:xml\"> |
<td>Copy properties as well, if applicable. | <td>Copy properties as well, if applicable. | ||
<tr><td><input type=submit value=\" Copy \"> | <tr><td><input type=submit value=\" Copy \"> |
Revision as of 18:03, 9 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 );
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 properties as well, if applicable. |
<input type=submit value=\" Copy \"> |
</form>";
}
?>