<form> -> make_form(), or add auth token manually
This commit is contained in:
parent
18403a3fa6
commit
1e04df7765
@ -20,8 +20,7 @@ class AdminPageTheme extends Themelet {
|
||||
global $user;
|
||||
|
||||
$html = "
|
||||
<p><form action='".make_link("admin_utils")."' method='POST'>
|
||||
".$user->get_auth_html()."
|
||||
".make_form(make_link("admin_utils"))."
|
||||
<select name='action'>
|
||||
<option value='lowercase all tags'>All tags to lowercase</option>
|
||||
<option value='recount tag use'>Recount tag use</option>
|
||||
|
@ -21,38 +21,45 @@ class ArtistsTheme extends Themelet {
|
||||
|
||||
if($mode == "neutral"){
|
||||
$html = "<form method='post' action='".make_link("artist/new_artist")."'>
|
||||
".$user->get_auth_html()."
|
||||
<input type='submit' name='edit' id='edit' value='New Artist'/>
|
||||
</form>";
|
||||
}
|
||||
|
||||
if($mode == "editor"){
|
||||
$html = "<form method='post' action='".make_link("artist/new_artist")."'>
|
||||
".$user->get_auth_html()."
|
||||
<input type='submit' name='edit' id='edit' value='New Artist'/>
|
||||
</form>
|
||||
|
||||
<form method='post' action='".make_link("artist/edit_artist")."'>
|
||||
".$user->get_auth_html()."
|
||||
<input type='submit' name='edit' id='edit' value='Edit Artist'/>
|
||||
<input type='hidden' name='artist_id' value='".$artistID."'>
|
||||
</form>";
|
||||
|
||||
if($is_admin){
|
||||
$html .= "<form method='post' action='".make_link("artist/nuke_artist")."'>
|
||||
".$user->get_auth_html()."
|
||||
<input type='submit' name='edit' id='edit' value='Delete Artist'/>
|
||||
<input type='hidden' name='artist_id' value='".$artistID."'>
|
||||
</form>";
|
||||
}
|
||||
|
||||
$html .= "<form method='post' action='".make_link("artist/add_alias")."'>
|
||||
".$user->get_auth_html()."
|
||||
<input type='submit' name='edit' id='edit' value='Add Alias'/>
|
||||
<input type='hidden' name='artist_id' value='".$artistID."'>
|
||||
</form>
|
||||
|
||||
<form method='post' action='".make_link("artist/add_member")."'>
|
||||
".$user->get_auth_html()."
|
||||
<input type='submit' name='edit' id='edit' value='Add Member'/>
|
||||
<input type='hidden' name='artist_id' value='".$artistID."'>
|
||||
</form>
|
||||
|
||||
<form method='post' action='".make_link("artist/add_url")."'>
|
||||
".$user->get_auth_html()."
|
||||
<input type='submit' name='edit' id='edit' value='Add Url'/>
|
||||
<input type='hidden' name='artist_id' value='".$artistID."'>
|
||||
</form>";
|
||||
@ -102,6 +109,7 @@ class ArtistsTheme extends Themelet {
|
||||
$html =
|
||||
'
|
||||
<form method="POST" action="'.make_link("artist/edited/".$artist['id']).'">
|
||||
'.$user->get_auth_html().'
|
||||
<table>
|
||||
<tr><td>Name:</td><td><input type="text" name="name" value="'.$artistName.'" />
|
||||
<input type="hidden" name="id" value="'.$artistID.'" /></td></tr>
|
||||
@ -127,6 +135,7 @@ class ArtistsTheme extends Themelet {
|
||||
global $page;
|
||||
|
||||
$html = "<form action=".make_link("artist/create")." method='POST'>
|
||||
".$user->get_auth_html()."
|
||||
<table>
|
||||
<tr><td>Name:</td><td><input type='text' name='name' /></td></tr>
|
||||
<tr><td>Aliases:</td><td><input type='text' name='aliases' /></td></tr>
|
||||
@ -223,6 +232,7 @@ class ArtistsTheme extends Themelet {
|
||||
{
|
||||
$html =
|
||||
'<form method="POST" action='.make_link("artist/alias/add").'>
|
||||
'.$user->get_auth_html().'
|
||||
<table>
|
||||
<tr><td>Alias:</td><td><input type="text" name="aliases" />
|
||||
<input type="hidden" name="artistID" value='.$artistID.' /></td></tr>
|
||||
@ -238,6 +248,7 @@ class ArtistsTheme extends Themelet {
|
||||
{
|
||||
$html =
|
||||
' <form method="POST" action='.make_link("artist/member/add").'>
|
||||
'.$user->get_auth_html().'
|
||||
<table>
|
||||
<tr><td>Members:</td><td><input type="text" name="members" />
|
||||
<input type="hidden" name="artistID" value='.$artistID.' /></td></tr>
|
||||
@ -254,6 +265,7 @@ class ArtistsTheme extends Themelet {
|
||||
{
|
||||
$html =
|
||||
' <form method="POST" action='.make_link("artist/url/add").'>
|
||||
'.$user->get_auth_html().'
|
||||
<table>
|
||||
<tr><td>URL:</td><td><textarea name="urls"></textarea>
|
||||
<input type="hidden" name="artistID" value='.$artistID.' /></td></tr>
|
||||
@ -271,6 +283,7 @@ class ArtistsTheme extends Themelet {
|
||||
$html =
|
||||
'
|
||||
<form method="POST" action="'.make_link("artist/alias/edited/".$alias['id']).'">
|
||||
'.$user->get_auth_html().'
|
||||
<label for="alias">Alias:</label>
|
||||
<input type="text" name="alias" value="'.$alias['alias'].'" />
|
||||
<input type="hidden" name="aliasID" value="'.$alias['id'].'" />
|
||||
@ -287,6 +300,7 @@ class ArtistsTheme extends Themelet {
|
||||
$html =
|
||||
'
|
||||
<form method="POST" action="'.make_link("artist/url/edited/".$url['id']).'">
|
||||
'.$user->get_auth_html().'
|
||||
<label for="url">URL:</label>
|
||||
<input type="text" name="url" value="'.$url['url'].'" />
|
||||
<input type="hidden" name="urlID" value="'.$url['id'].'" />
|
||||
@ -303,6 +317,7 @@ class ArtistsTheme extends Themelet {
|
||||
$html =
|
||||
'
|
||||
<form method="POST" action="'.make_link("artist/member/edited/".$member['id']).'">
|
||||
'.$user->get_auth_html().'
|
||||
<label for="member">Member name:</label>
|
||||
<input type="text" name="name" value="'.$member['name'].'" />
|
||||
<input type="hidden" name="memberID" value="'.$member['id'].'" />
|
||||
|
@ -45,8 +45,7 @@ class BlotterTheme extends Themelet {
|
||||
</tr>";
|
||||
$add_new = "
|
||||
<tr class='even'>
|
||||
<form action='".make_link("blotter/add")."' method='POST'>
|
||||
".$user->get_auth_html()."
|
||||
".make_form(make_link("blotter/add"))."
|
||||
<td colspan='2'><textarea style='text-align:left;' name='entry_text' rows='2' /></textarea></td>
|
||||
<td><input type='checkbox' name='important' /></td>
|
||||
<td><input type='submit' value='Add'></td>
|
||||
|
@ -28,8 +28,7 @@ class BulkAddTheme extends Themelet {
|
||||
<br>Note: this is the folder as seen by the server -- you need to
|
||||
upload via FTP or something first.
|
||||
|
||||
<p><form action='".make_link("bulk_add")."' method='POST'>
|
||||
".$user->get_auth_html()."
|
||||
<p>".make_form(make_link("bulk_add"))."
|
||||
Directory to add: <input type='text' name='dir' size='40'>
|
||||
<input type='submit' value='Add'>
|
||||
</form>
|
||||
|
@ -19,6 +19,7 @@ class DowntimeTheme extends Themelet {
|
||||
$login_link = make_link("user_admin/login");
|
||||
header("HTTP/1.0 503 Service Temporarily Unavailable");
|
||||
|
||||
$auth = $user->get_auth_html();
|
||||
print <<<EOD
|
||||
<html>
|
||||
<head>
|
||||
@ -34,6 +35,7 @@ class DowntimeTheme extends Themelet {
|
||||
<h3>Admin Login</h3>
|
||||
<div id="login">
|
||||
<form action="$login_link" method="POST">
|
||||
$auth
|
||||
<table id="login_table" summary="Login Form">
|
||||
<tr>
|
||||
<td width="70"><label for="user">Name</label></td>
|
||||
|
@ -38,8 +38,10 @@ Tags: {$info['stat_tags']}
|
||||
Applications: {$info['stat_image_tags']}
|
||||
Extensions: {$info['sys_extensions']}
|
||||
EOD;
|
||||
$auth = $user->get_auth_html();
|
||||
$html = <<<EOD
|
||||
<form action='http://shimmie.shishnet.org/register.php' method='POST'>
|
||||
$auth
|
||||
<input type='hidden' name='registration_api' value='1'>
|
||||
<textarea name='data' rows='20' cols='80'>$data</textarea>
|
||||
<br><input type='submit' value='Click to send to Shish'>
|
||||
|
@ -7,8 +7,8 @@ class FavoritesTheme extends Themelet {
|
||||
$i_image_id = int_escape($image->id);
|
||||
$name = $is_favorited ? "unset" : "set";
|
||||
$label = $is_favorited ? "Un-Favorite" : "Favorite";
|
||||
$html = "<form action='".make_link("change_favorite")."' method='POST'>
|
||||
".$user->get_auth_html()."
|
||||
$html = "
|
||||
".make_form(make_link("change_favorite"))."
|
||||
<input type='hidden' name='image_id' value='$i_image_id'>
|
||||
<input type='hidden' name='favorite_action' value='$name'>
|
||||
<input type='submit' value='$label'>
|
||||
|
@ -11,8 +11,7 @@ class FeaturedTheme extends Themelet {
|
||||
public function get_buttons_html($image_id) {
|
||||
global $user;
|
||||
return "
|
||||
<form action='".make_link("featured_image/set")."' method='POST'>
|
||||
".$user->get_auth_html()."
|
||||
".make_form(make_link("featured_image/set"))."
|
||||
<input type='hidden' name='image_id' value='$image_id'>
|
||||
<input type='submit' value='Feature This'>
|
||||
</form>
|
||||
|
@ -21,8 +21,7 @@ class ForumTheme extends Themelet {
|
||||
{
|
||||
global $config, $user;
|
||||
$max_characters = $config->get_int('forumMaxCharsPerPost');
|
||||
$postUrl = make_link("forum/create");
|
||||
$html = '<form action="'.$postUrl.'" method="POST">';
|
||||
$html = make_form(make_link("forum/create"));
|
||||
|
||||
|
||||
if (!is_null($threadTitle))
|
||||
@ -58,8 +57,7 @@ class ForumTheme extends Themelet {
|
||||
|
||||
$max_characters = $config->get_int('forumMaxCharsPerPost');
|
||||
|
||||
$postUrl = make_link("forum/answer");
|
||||
$html = '<form action="'.$postUrl.'" method="POST">';
|
||||
$html = make_form(make_link("forum/answer"));
|
||||
|
||||
$html .= '<input type="hidden" name="threadID" value="'.$threadID.'" />';
|
||||
|
||||
|
@ -30,7 +30,7 @@ class ImageBanTheme extends Themelet {
|
||||
<td width='30%'>{$ban['hash']}</td>
|
||||
<td>{$ban['reason']}</td>
|
||||
<td width='10%'>
|
||||
<form action='".make_link("image_hash_ban/remove")."' method='POST'>
|
||||
".make_form(make_link("image_hash_ban/remove"))."
|
||||
<input type='hidden' name='hash' value='{$ban['hash']}'>
|
||||
<input type='submit' value='Remove'>
|
||||
</form>
|
||||
@ -48,7 +48,7 @@ class ImageBanTheme extends Themelet {
|
||||
<thead><th>Hash</th><th>Reason</th><th>Action</th></thead>
|
||||
$h_bans
|
||||
<tfoot><tr>
|
||||
<form action='".make_link("image_hash_ban/add")."' method='POST'>
|
||||
".make_form(make_link("image_hash_ban/add"))."
|
||||
<td><input type='text' name='hash'></td>
|
||||
<td><input type='text' name='reason'></td>
|
||||
<td><input type='submit' value='Ban'></td>
|
||||
@ -80,7 +80,7 @@ class ImageBanTheme extends Themelet {
|
||||
*/
|
||||
public function get_buttons_html(Image $image) {
|
||||
$html = "
|
||||
<form action='".make_link("image_hash_ban/add")."' method='POST'>
|
||||
".make_form(make_link("image_hash_ban/add"))."
|
||||
<input type='hidden' name='hash' value='{$image->hash}'>
|
||||
<input type='hidden' name='image_id' value='{$image->id}'>
|
||||
<input type='text' name='reason'>
|
||||
|
@ -27,8 +27,7 @@ class IPBanTheme extends Themelet {
|
||||
<td width='10%'>{$ban['banner_name']}</td>
|
||||
<td width='15%'>{$end_human}</td>
|
||||
<td width='10%'>
|
||||
<form action='".make_link("ip_ban/remove")."' method='POST'>
|
||||
".$user->get_auth_html()."
|
||||
".make_form(make_link("ip_ban/remove"))."
|
||||
<input type='hidden' name='id' value='{$ban[$prefix.'id']}'>
|
||||
<input type='submit' value='Remove'>
|
||||
</form>
|
||||
@ -47,8 +46,7 @@ class IPBanTheme extends Themelet {
|
||||
<thead><tr><th>IP</th><th>Reason</th><th>By</th><th>Until</th><th>Action</th></tr></thead>
|
||||
$h_bans
|
||||
<tfoot><tr>
|
||||
<form action='".make_link("ip_ban/add")."' method='POST'>
|
||||
".$user->get_auth_html()."
|
||||
".make_form(make_link("ip_ban/add"))."
|
||||
<td><input type='text' name='ip'></td>
|
||||
<td><input type='text' name='reason'></td>
|
||||
<td>{$user->name}</td>
|
||||
|
@ -23,26 +23,21 @@ class NotesTheme extends Themelet {
|
||||
';
|
||||
}
|
||||
public function request_button($image_id) {
|
||||
return '
|
||||
|
||||
<form action="'.make_link("note/add_request").'" method="POST">
|
||||
return make_form(make_link("note/add_request")) . '
|
||||
<input id="noterequest" type="submit" value="Add Note Request">
|
||||
<input type="hidden" name="image_id" value="'.$image_id.'">
|
||||
</form>
|
||||
';
|
||||
}
|
||||
public function nuke_notes_button($image_id) {
|
||||
return '
|
||||
<form action="'.make_link("note/nuke_notes").'" method="POST" ">
|
||||
return make_form(make_link("note/nuke_notes")) . '
|
||||
<input id="noterequest" type="submit" value="Nuke Notes" onclick="return confirm_action()">
|
||||
<input type="hidden" name="image_id" value="'.$image_id.'">
|
||||
</form>
|
||||
';
|
||||
}
|
||||
public function nuke_requests_button($image_id) {
|
||||
return '
|
||||
|
||||
<form action="'.make_link("note/nuke_requests").'" method="POST">
|
||||
return make_form(make_link("note/nuke_requests")) . '
|
||||
<input id="noterequest" type="submit" value="Nuke Requests" onclick="return confirm_action()">
|
||||
<input type="hidden" name="image_id" value="'.$image_id.'">
|
||||
</form>
|
||||
@ -167,7 +162,7 @@ class NotesTheme extends Themelet {
|
||||
</script>
|
||||
|
||||
<div id='noteform'>
|
||||
<form id='NoteAddForm' action='".make_link("note/add_note")."' method='POST'>
|
||||
".make_form(make_link("note/add_note"))."
|
||||
<input type='hidden' name='image_id' value='".$image_id."' />
|
||||
<input name='note_x1' type='hidden' value='' id='NoteX1' />
|
||||
<input name='note_y1' type='hidden' value='' id='NoteY1' />
|
||||
@ -189,7 +184,7 @@ class NotesTheme extends Themelet {
|
||||
</form>
|
||||
</div>
|
||||
<div id='noteEditForm'>
|
||||
<form id='NoteEditForm' action='".make_link("note/edit_note")."' method='POST'>
|
||||
".make_form(make_link("note/edit_note"))."
|
||||
<input type='hidden' name='image_id' value='".$image_id."' />
|
||||
<input type='hidden' name='note_id' id='EditNoteID' value='' />
|
||||
<input name='note_x1' type='hidden' value='' id='EditNoteX1' />
|
||||
@ -211,7 +206,7 @@ class NotesTheme extends Themelet {
|
||||
|
||||
if($adminOptions)
|
||||
$html .= "
|
||||
<form id='NoteDeleteForm' action='".make_link("note/delete_note")."' method='POST'>
|
||||
".make_form(make_link("note/delete_note"))."
|
||||
<input type='hidden' name='image_id' value='".$image_id."' />
|
||||
<input type='hidden' name='note_id' value='' id='DeleteNoteNoteID' />
|
||||
<table>
|
||||
|
@ -17,7 +17,7 @@ class PoolsTheme extends Themelet {
|
||||
$h .= "<option value='".$pool['id']."'>".html_escape($pool['title'])."</option>";
|
||||
}
|
||||
$editor = "
|
||||
<form method='POST' action='".make_link("pool/add_post")."'>
|
||||
".make_form(make_link("pool/add_post"))."
|
||||
<select name='pool_id'>
|
||||
$h
|
||||
</select>
|
||||
@ -81,13 +81,15 @@ class PoolsTheme extends Themelet {
|
||||
* HERE WE DISPLAY THE NEW POOL COMPOSER
|
||||
*/
|
||||
public function new_pool_composer(Page $page) {
|
||||
$create_html = "<form action=".make_link("pool/create")." method='POST'>
|
||||
$create_html = "
|
||||
".make_form(make_link("pool/create"))."
|
||||
<table>
|
||||
<tr><td>Title:</td><td><input type='text' name='title'></td></tr>
|
||||
<tr><td>Public?</td><td><input name='public' type='checkbox' value='Y' checked='checked'/></td></tr>
|
||||
<tr><td>Description:</td><td><textarea name='description'></textarea></td></tr>
|
||||
<tr><td colspan='2'><input type='submit' value='Create' /></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
";
|
||||
|
||||
$blockTitle = "Create Pool";
|
||||
@ -168,7 +170,8 @@ class PoolsTheme extends Themelet {
|
||||
public function sidebar_options(Page $page, $pool, $check_all) {
|
||||
global $user;
|
||||
|
||||
$editor = " <form action='".make_link("pool/import")."' method='POST'>
|
||||
$editor = "
|
||||
".make_form(make_link("pool/import"))."
|
||||
<input type='text' name='pool_tag' id='edit' value='Please enter a tag' onclick='this.value=\"\";'/>
|
||||
<input type='submit' name='edit' id='edit' value='Import'/>
|
||||
<input type='hidden' name='pool_id' value='".$pool['id']."'>
|
||||
@ -191,7 +194,7 @@ class PoolsTheme extends Themelet {
|
||||
}
|
||||
</script>
|
||||
|
||||
<form action='".make_link("pool/nuke")."' method='POST'>
|
||||
".make_form(make_link("pool/nuke"))."
|
||||
<input type='submit' name='delete' id='delete' value='Delete Pool' onclick='return confirm_action()' />
|
||||
<input type='hidden' name='pool_id' value='".$pool['id']."'>
|
||||
</form>
|
||||
|
@ -22,7 +22,7 @@ class RatingsTheme extends Themelet {
|
||||
public function display_bulk_rater() {
|
||||
global $page;
|
||||
$html = "
|
||||
<form action='".make_link("admin/bulk_rate")."' method='POST'>
|
||||
".make_form(make_link("admin/bulk_rate"))."
|
||||
<table style='width: 300px'>
|
||||
<tr>
|
||||
<td>Search</td>
|
||||
|
@ -6,7 +6,7 @@ class RegenThumbTheme extends Themelet {
|
||||
*/
|
||||
public function get_buttons_html($image_id) {
|
||||
return "
|
||||
<form action='".make_link("regen_thumb")."' method='POST'>
|
||||
".make_form(make_link("regen_thumb"))."
|
||||
<input type='hidden' name='image_id' value='$image_id'>
|
||||
<input type='submit' value='Regenerate'>
|
||||
</form>
|
||||
|
@ -42,7 +42,7 @@ class ReportImageTheme extends Themelet {
|
||||
<td>{$image_link}</td>
|
||||
<td>Report by $userlink: $h_reason</td>
|
||||
<td class='formstretch'>
|
||||
<form action='".make_link("image_report/remove")."' method='POST'>
|
||||
".make_form(make_link("image_report/remove"))."
|
||||
<input type='hidden' name='id' value='{$report['id']}'>
|
||||
<input type='submit' value='Remove Report'>
|
||||
</form>
|
||||
@ -73,7 +73,7 @@ class ReportImageTheme extends Themelet {
|
||||
|
||||
$i_image = int_escape($image->id);
|
||||
$html = "
|
||||
<form action='".make_link("image_report/add")."' method='POST'>
|
||||
".make_form(make_link("image_report/add"))."
|
||||
<input type='hidden' name='image_id' value='$i_image'>
|
||||
<input type='text' name='reason' value='Please enter a reason' onclick='this.value=\"\";'>
|
||||
<input type='submit' value='Report'>
|
||||
|
@ -5,7 +5,7 @@ class Tag_HistoryTheme extends Themelet {
|
||||
global $user;
|
||||
$start_string = "
|
||||
<div style='text-align: left'>
|
||||
<form enctype='multipart/form-data' action='".make_link("tag_history/revert")."' method='POST'>
|
||||
".make_form(make_link("tag_history/revert"))."
|
||||
<ul style='list-style-type:none;'>
|
||||
";
|
||||
|
||||
@ -46,7 +46,7 @@ class Tag_HistoryTheme extends Themelet {
|
||||
public function display_global_page(Page $page, $history) {
|
||||
$start_string = "
|
||||
<div style='text-align: left'>
|
||||
<form enctype='multipart/form-data' action='".make_link("tag_history/revert")."' method='POST'>
|
||||
".make_form(make_link("tag_history/revert"))."
|
||||
<ul style='list-style-type:none;'>
|
||||
";
|
||||
$end_string = "
|
||||
|
@ -11,8 +11,7 @@ class TipsTheme extends Themelet {
|
||||
$select .= "</select>";
|
||||
|
||||
$html = "
|
||||
<form action='".make_link("tips/save")."' method='POST'>
|
||||
".$user->get_auth_html()."
|
||||
".make_form(make_link("tips/save"))."
|
||||
<table>
|
||||
<tr>
|
||||
<td>Enable:</td>
|
||||
|
@ -51,7 +51,7 @@ class WikiTheme extends Themelet {
|
||||
$lock = "";
|
||||
}
|
||||
return "
|
||||
<form action='".make_link("wiki_admin/save")."' method='POST'>
|
||||
".make_form(make_link("wiki_admin/save"))."
|
||||
<input type='hidden' name='title' value='$h_title'>
|
||||
<input type='hidden' name='revision' value='$i_revision'>
|
||||
<textarea name='body' style='width: 100%' rows='20'>".html_escape($page->body)."</textarea>
|
||||
@ -71,7 +71,7 @@ class WikiTheme extends Themelet {
|
||||
$edit = "<table><tr>";
|
||||
$edit .= Wiki::can_edit($user, $page) ?
|
||||
"
|
||||
<td><form action='".make_link("wiki_admin/edit")."' method='POST'>
|
||||
<td>".make_form(make_link("wiki_admin/edit"))."
|
||||
<input type='hidden' name='title' value='".html_escape($page->title)."'>
|
||||
<input type='hidden' name='revision' value='".int_escape($page->revision)."'>
|
||||
<input type='submit' value='Edit'>
|
||||
@ -80,12 +80,12 @@ class WikiTheme extends Themelet {
|
||||
"";
|
||||
if($user->is_admin()) {
|
||||
$edit .= "
|
||||
<td><form action='".make_link("wiki_admin/delete_revision")."' method='POST'>
|
||||
<td>".make_form(make_link("wiki_admin/delete_revision"))."
|
||||
<input type='hidden' name='title' value='".html_escape($page->title)."'>
|
||||
<input type='hidden' name='revision' value='".int_escape($page->revision)."'>
|
||||
<input type='submit' value='Delete This Version'>
|
||||
</form></td>
|
||||
<td><form action='".make_link("wiki_admin/delete_all")."' method='POST'>
|
||||
<td>".make_form(make_link("wiki_admin/delete_all"))."
|
||||
<input type='hidden' name='title' value='".html_escape($page->title)."'>
|
||||
<input type='submit' value='Delete All'>
|
||||
</form></td>
|
||||
|
@ -216,6 +216,21 @@ function make_http($link) {
|
||||
return $link;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a form tag with relevant auth token and stuff
|
||||
*
|
||||
* @retval string
|
||||
*/
|
||||
function make_form($target, $method="POST", $multipart=False) {
|
||||
global $user;
|
||||
$auth = $user->get_auth_html();
|
||||
$extra = "";
|
||||
if($multipart) {
|
||||
$extra .= " enctype='multipart/form-data'"
|
||||
}
|
||||
return "<form action='$target' method='$method'$extra>$auth";
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a link to a static file in the current theme's
|
||||
* directory
|
||||
|
@ -12,7 +12,7 @@ class AliasEditorTheme extends Themelet {
|
||||
$action = "<th width='10%'>Action</th>";
|
||||
$add = "
|
||||
<tr>
|
||||
<form action='".make_link("alias/add")."' method='POST'>
|
||||
".make_form(make_link("alias/add"))."
|
||||
<td><input type='text' name='oldtag'></td>
|
||||
<td><input type='text' name='newtag'></td>
|
||||
<td><input type='submit' value='Add'></td>
|
||||
@ -36,7 +36,7 @@ class AliasEditorTheme extends Themelet {
|
||||
if($is_admin) {
|
||||
$h_aliases .= "
|
||||
<td>
|
||||
<form action='".make_link("alias/remove")."' method='POST'>
|
||||
".make_form(make_link("alias/remove"))."
|
||||
<input type='hidden' name='oldtag' value='$h_old'>
|
||||
<input type='submit' value='Remove'>
|
||||
</form>
|
||||
@ -60,7 +60,7 @@ class AliasEditorTheme extends Themelet {
|
||||
";
|
||||
|
||||
$bulk_html = "
|
||||
<form enctype='multipart/form-data' action='".make_link("alias/import")."' method='POST'>
|
||||
".make_form(make_link("alias/import"), multipart=True)."
|
||||
<input type='file' name='alias_file'>
|
||||
<input type='submit' value='Upload List'>
|
||||
</form>
|
||||
|
@ -173,7 +173,7 @@ class CommentListTheme extends Themelet {
|
||||
$captcha = $config->get_bool("comment_captcha") ? captcha_get_html() : "";
|
||||
|
||||
return "
|
||||
<form name='comment_form' action='".make_link("comment/add")."' method='POST'>
|
||||
".make_form(make_link("comment/add"))."
|
||||
<input type='hidden' name='image_id' value='$i_image_id' />
|
||||
<input type='hidden' name='hash' value='$hash' />
|
||||
<textarea name='comment' rows='5' cols='50'></textarea>
|
||||
|
@ -5,8 +5,7 @@ class ExtManagerTheme extends Themelet {
|
||||
global $user;
|
||||
$en = $editable ? "<th>Enabled</th>" : "";
|
||||
$html = "
|
||||
<form action='".make_link("ext_manager/set")."' method='POST'>
|
||||
".$user->get_auth_html()."
|
||||
".make_form(make_link("ext_manager/set"))."
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(\"#extensions\").tablesorter();
|
||||
@ -96,7 +95,7 @@ class ExtManagerTheme extends Themelet {
|
||||
}
|
||||
}
|
||||
$html = "
|
||||
<form action='".make_link("ext_manager/set")."' method='POST'>
|
||||
".make_form(make_link("ext_manager/set"))."
|
||||
".$user->get_auth_html()."
|
||||
<table border='0'>
|
||||
<tr><td width='50%'>$col_1</td><td>$col_2</td></tr>
|
||||
|
@ -10,9 +10,8 @@ class ImageIOTheme {
|
||||
|
||||
$i_image_id = int_escape($image_id);
|
||||
$html = "
|
||||
<form action='".make_link("image_admin/delete")."' method='POST'>
|
||||
".make_form(make_link("image_admin/delete"))."
|
||||
<input type='hidden' name='image_id' value='$i_image_id'>
|
||||
".$user->get_auth_html()."
|
||||
<input type='submit' value='Delete'>
|
||||
</form>
|
||||
";
|
||||
|
@ -42,11 +42,12 @@ class SetupTheme extends Themelet {
|
||||
}
|
||||
|
||||
$table = "
|
||||
<form action='".make_link("setup/save")."' method='POST'><table>
|
||||
".$user->get_auth_html()."
|
||||
".make_form(make_link("setup/save"))."
|
||||
<table>
|
||||
<tr><td>$setupblock_html1</td><td>$setupblock_html2</td></tr>
|
||||
<tr><td colspan='2'><input type='submit' value='Save Settings'></td></tr>
|
||||
</table></form>
|
||||
</table>
|
||||
</form>
|
||||
";
|
||||
|
||||
$page->set_title("Shimmie Setup");
|
||||
@ -83,12 +84,13 @@ class SetupTheme extends Themelet {
|
||||
$(\"#settings\").tablesorter();
|
||||
});
|
||||
</script>
|
||||
<form action='".make_link("setup/save")."' method='POST'><table id='settings' class='zebra'>
|
||||
".$user->get_auth_html()."
|
||||
".make_form(make_link("setup/save"))."
|
||||
<table id='settings' class='zebra'>
|
||||
<thead><tr><th width='25%'>Name</th><th>Value</th></tr></thead>
|
||||
<tbody>$rows</tbody>
|
||||
<tfoot><tr><td colspan='2'><input type='submit' value='Save Settings'></td></tr></tfoot>
|
||||
</table></form>
|
||||
</table>
|
||||
</form>
|
||||
";
|
||||
|
||||
$page->set_title("Shimmie Setup");
|
||||
|
@ -7,7 +7,7 @@ class TagEditTheme extends Themelet {
|
||||
*/
|
||||
public function display_mass_editor(Page $page) {
|
||||
$html = "
|
||||
<form action='".make_link("tag_edit/replace")."' method='POST'>
|
||||
".make_form(make_link("tag_edit/replace"))."
|
||||
<table style='width: 300px;'>
|
||||
<tr><td>Search</td><td><input type='text' name='search'></tr>
|
||||
<tr><td>Replace</td><td><input type='text' name='replace'></td></tr>
|
||||
|
@ -50,7 +50,7 @@ class UploadTheme extends Themelet {
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<form enctype='multipart/form-data' action='".make_link("upload")."' method='POST'>
|
||||
".make_form(make_link("upload"), multipart=True)."
|
||||
<table id='large_upload_form'>
|
||||
$upload_list
|
||||
<tr><td>Tags</td><td colspan='3'><input id='tag_box' name='tags' type='text'></td></tr>
|
||||
@ -120,7 +120,7 @@ class UploadTheme extends Themelet {
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<form enctype='multipart/form-data' action='".make_link("upload")."' method='POST'>
|
||||
".make_form(make_link("upload"), multipart=True)."
|
||||
$upload_list
|
||||
<input id='tag_input' name='tags' type='text' autocomplete='off'>
|
||||
<input type='submit' value='Post'>
|
||||
|
@ -53,7 +53,7 @@ class UserPageTheme extends Themelet {
|
||||
$reca = "<tr><td colspan='2'>".captcha_get_html()."</td></tr>";
|
||||
|
||||
$html .= "
|
||||
<form action='".make_link("user_admin/create")."' method='POST'>
|
||||
".make_form(make_link("user_admin/create"))."
|
||||
<table style='width: 300px;'>
|
||||
<tr><td>Name</td><td><input type='text' name='name'></td></tr>
|
||||
<tr><td>Password</td><td><input type='password' name='pass1'></td></tr>
|
||||
@ -82,7 +82,7 @@ class UserPageTheme extends Themelet {
|
||||
public function display_login_block(Page $page) {
|
||||
global $config;
|
||||
$html = "
|
||||
<form action='".make_link("user_admin/login")."' method='POST'>
|
||||
".make_form(make_link("user_admin/login"))."
|
||||
<table summary='Login Form'>
|
||||
<tr>
|
||||
<td width='70'><label for='user'>Name</label></td>
|
||||
@ -150,10 +150,8 @@ class UserPageTheme extends Themelet {
|
||||
protected function build_options(User $duser) {
|
||||
global $config, $database, $user;
|
||||
|
||||
$html = "";
|
||||
|
||||
$html .= "
|
||||
<form action='".make_link("user_admin/change_pass")."' method='POST'>
|
||||
$html = "
|
||||
".make_form(make_link("user_admin/change_pass"))."
|
||||
<input type='hidden' name='id' value='{$duser->id}'>
|
||||
<table style='width: 300px;'>
|
||||
<tr><th colspan='2'>Change Password</th></tr>
|
||||
@ -163,7 +161,7 @@ class UserPageTheme extends Themelet {
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<p><form action='".make_link("user_admin/change_email")."' method='POST'>
|
||||
<p>".make_form(make_link("user_admin/change_email"))."
|
||||
<input type='hidden' name='id' value='{$duser->id}'>
|
||||
<table style='width: 300px;'>
|
||||
<tr><th colspan='2'>Change Email</th></tr>
|
||||
@ -177,7 +175,7 @@ class UserPageTheme extends Themelet {
|
||||
$i_user_id = int_escape($duser->id);
|
||||
$h_is_admin = $duser->is_admin() ? " checked" : "";
|
||||
$html .= "
|
||||
<p><form action='".make_link("user_admin/set_more")."' method='POST'>
|
||||
<p>".make_form(make_link("user_admin/set_more"))."
|
||||
<input type='hidden' name='id' value='$i_user_id'>
|
||||
Admin: <input name='admin' type='checkbox'$h_is_admin>
|
||||
<input type='submit' value='Set'>
|
||||
|
@ -112,7 +112,7 @@ class ViewImageTheme extends Themelet {
|
||||
$html = " (<a href=\"javascript: toggle('imgdata')\">edit info</a>)";
|
||||
$html .= "
|
||||
<div id='imgdata'>
|
||||
<form action='".make_link("post/set")."' method='POST'>
|
||||
".make_form(make_link("post/set"))."
|
||||
<input type='hidden' name='image_id' value='{$image->id}'>
|
||||
<input type='hidden' name='query' value='$h_query'>
|
||||
<table style='width: 500px;'>
|
||||
|
Loading…
x
Reference in New Issue
Block a user