no make_link for forms

This commit is contained in:
Shish 2020-01-30 10:31:11 +00:00
parent 55b697c198
commit c2231432f3
16 changed files with 22 additions and 22 deletions

View file

@ -934,7 +934,7 @@ function SHM_USER_FORM(User $duser, string $target, string $title, $body, $foot)
$foot = TFOOT(TR(TD(["colspan"=>"2"], INPUT(["type"=>"submit", "value"=>$foot])))); $foot = TFOOT(TR(TD(["colspan"=>"2"], INPUT(["type"=>"submit", "value"=>$foot]))));
} }
return SHM_SIMPLE_FORM( return SHM_SIMPLE_FORM(
make_link($target), $target,
P( P(
INPUT(["type"=>'hidden', "name"=>'id', "value"=>$duser->id]), INPUT(["type"=>'hidden', "name"=>'id', "value"=>$duser->id]),
TABLE( TABLE(

View file

@ -45,7 +45,7 @@ class AdminPageTheme extends Themelet
$page->add_block(new Block("Misc Admin Tools", $html)); $page->add_block(new Block("Misc Admin Tools", $html));
$html = (string)SHM_SIMPLE_FORM( $html = (string)SHM_SIMPLE_FORM(
make_link("admin/set_tag_case"), "admin/set_tag_case",
INPUT(["type"=>'text', "name"=>'tag', "placeholder"=>'Enter tag with correct case', "class"=>'autocomplete_tags', "autocomplete"=>'off']), INPUT(["type"=>'text', "name"=>'tag', "placeholder"=>'Enter tag with correct case', "class"=>'autocomplete_tags', "autocomplete"=>'off']),
SHM_SUBMIT('Set Tag Case'), SHM_SUBMIT('Set Tag Case'),
); );

View file

@ -9,13 +9,13 @@ class ApprovalTheme extends Themelet
{ {
if ($image->approved===true) { if ($image->approved===true) {
$html = SHM_SIMPLE_FORM( $html = SHM_SIMPLE_FORM(
make_link('disapprove_image/'.$image->id), 'disapprove_image/'.$image->id,
INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image->id]), INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image->id]),
SHM_SUBMIT("Disapprove") SHM_SUBMIT("Disapprove")
); );
} else { } else {
$html = SHM_SIMPLE_FORM( $html = SHM_SIMPLE_FORM(
make_link('approve_image/'.$image->id), 'approve_image/'.$image->id,
INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image->id]), INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image->id]),
SHM_SUBMIT("Approve") SHM_SUBMIT("Approve")
); );
@ -51,7 +51,7 @@ class ApprovalTheme extends Themelet
global $page; global $page;
$html = (string)SHM_SIMPLE_FORM( $html = (string)SHM_SIMPLE_FORM(
make_link("admin/approval"), "admin/approval",
BUTTON(["name"=>'approval_action', "value"=>'approve_all'], "Approve All Images"), BUTTON(["name"=>'approval_action', "value"=>'approve_all'], "Approve All Images"),
BR(), BR(),
BUTTON(["name"=>'approval_action', "value"=>'disapprove_all'], "Disapprove All Images"), BUTTON(["name"=>'approval_action', "value"=>'disapprove_all'], "Disapprove All Images"),

View file

@ -18,7 +18,7 @@ class BlocksTheme extends Themelet
$html = TABLE(["class"=>"form", "style"=>"width: 100%;"]); $html = TABLE(["class"=>"form", "style"=>"width: 100%;"]);
foreach ($blocks as $block) { foreach ($blocks as $block) {
$html->appendChild(SHM_SIMPLE_FORM( $html->appendChild(SHM_SIMPLE_FORM(
make_link("blocks/update"), "blocks/update",
TR( TR(
INPUT(["type"=>"hidden", "name"=>"id", "value"=>$block['id']]), INPUT(["type"=>"hidden", "name"=>"id", "value"=>$block['id']]),
TH("Title"), TH("Title"),
@ -43,7 +43,7 @@ class BlocksTheme extends Themelet
} }
$html->appendChild(SHM_SIMPLE_FORM( $html->appendChild(SHM_SIMPLE_FORM(
make_link("blocks/add"), "blocks/add",
TR( TR(
TH("Title"), TH("Title"),
TD(INPUT(["type"=>"text", "name"=>"title", "value"=>""])), TD(INPUT(["type"=>"text", "name"=>"title", "value"=>""])),

View file

@ -27,7 +27,7 @@ class ExtManagerTheme extends Themelet
$tbody = TBODY(); $tbody = TBODY();
$form = SHM_SIMPLE_FORM( $form = SHM_SIMPLE_FORM(
make_link("ext_manager/set"), "ext_manager/set",
TABLE( TABLE(
["id"=>'extensions', "class"=>'zebra sortable'], ["id"=>'extensions', "class"=>'zebra sortable'],
THEAD(TR( THEAD(TR(

View file

@ -8,7 +8,7 @@ class FavoritesTheme extends Themelet
$name = $is_favorited ? "unset" : "set"; $name = $is_favorited ? "unset" : "set";
$label = $is_favorited ? "Un-Favorite" : "Favorite"; $label = $is_favorited ? "Un-Favorite" : "Favorite";
return SHM_SIMPLE_FORM( return SHM_SIMPLE_FORM(
make_link("change_favorite"), "change_favorite",
INPUT(["type"=>"hidden", "name"=>"image_id", "value"=>$image->id]), INPUT(["type"=>"hidden", "name"=>"image_id", "value"=>$image->id]),
INPUT(["type"=>"hidden", "name"=>"favorite_action", "value"=>$name]), INPUT(["type"=>"hidden", "name"=>"favorite_action", "value"=>$name]),
INPUT(["type"=>"submit", "value"=>$label]), INPUT(["type"=>"submit", "value"=>$label]),

View file

@ -11,7 +11,7 @@ class FeaturedTheme extends Themelet
public function get_buttons_html(int $image_id): string public function get_buttons_html(int $image_id): string
{ {
return (string)SHM_SIMPLE_FORM( return (string)SHM_SIMPLE_FORM(
make_link("featured_image/set"), "featured_image/set",
INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image_id]), INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image_id]),
INPUT(["type"=>'submit', "value"=>'Feature This']), INPUT(["type"=>'submit', "value"=>'Feature This']),
); );

View file

@ -10,7 +10,7 @@ class ImageIOTheme extends Themelet
public function get_deleter_html(int $image_id): string public function get_deleter_html(int $image_id): string
{ {
return (string)SHM_SIMPLE_FORM( return (string)SHM_SIMPLE_FORM(
make_link("image/delete"), "image/delete",
INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image_id]), INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image_id]),
INPUT(["type"=>'submit', "value"=>'Delete', "onclick"=>'return confirm("Delete the image?");']), INPUT(["type"=>'submit', "value"=>'Delete', "onclick"=>'return confirm("Delete the image?");']),
); );
@ -22,7 +22,7 @@ class ImageIOTheme extends Themelet
public function get_replace_html(int $image_id): string public function get_replace_html(int $image_id): string
{ {
return (string)SHM_SIMPLE_FORM( return (string)SHM_SIMPLE_FORM(
make_link("image/replace"), "image/replace",
INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image_id]), INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image_id]),
INPUT(["type"=>'submit', "value"=>'Replace']), INPUT(["type"=>'submit', "value"=>'Replace']),
); );

View file

@ -20,7 +20,7 @@ class ImageBanTheme extends Themelet
public function get_buttons_html(Image $image) public function get_buttons_html(Image $image)
{ {
return (string)SHM_SIMPLE_FORM( return (string)SHM_SIMPLE_FORM(
make_link("image_hash_ban/add"), "image_hash_ban/add",
INPUT(["type"=>'hidden', "name"=>'c_hash', "value"=>$image->hash]), INPUT(["type"=>'hidden', "name"=>'c_hash', "value"=>$image->hash]),
INPUT(["type"=>'hidden', "name"=>'c_image_id', "value"=>$image->id]), INPUT(["type"=>'hidden', "name"=>'c_image_id', "value"=>$image->id]),
INPUT(["type"=>'text', "name"=>'c_reason']), INPUT(["type"=>'text', "name"=>'c_reason']),

View file

@ -20,7 +20,7 @@ class MediaTheme extends Themelet
} }
$html = (string)SHM_SIMPLE_FORM( $html = (string)SHM_SIMPLE_FORM(
make_link("admin/media_rescan"), "admin/media_rescan",
"Use this to force scanning for media properties.", "Use this to force scanning for media properties.",
TABLE( TABLE(
["class"=>"form"], ["class"=>"form"],
@ -34,7 +34,7 @@ class MediaTheme extends Themelet
public function get_buttons_html(int $image_id): string public function get_buttons_html(int $image_id): string
{ {
return (string)SHM_SIMPLE_FORM( return (string)SHM_SIMPLE_FORM(
make_link("media_rescan/"), "media_rescan/",
INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image_id]), INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image_id]),
SHM_SUBMIT('Scan Media Properties'), SHM_SUBMIT('Scan Media Properties'),
); );

View file

@ -9,7 +9,7 @@ class RegenThumbTheme extends Themelet
public function get_buttons_html(int $image_id): string public function get_buttons_html(int $image_id): string
{ {
return (string)SHM_SIMPLE_FORM( return (string)SHM_SIMPLE_FORM(
make_link("regen_thumb/one"), "regen_thumb/one",
INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image_id]), INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image_id]),
SHM_SUBMIT('Regenerate Thumbnail') SHM_SUBMIT('Regenerate Thumbnail')
); );

View file

@ -91,7 +91,7 @@ class ReportImageTheme extends Themelet
{ {
global $page; global $page;
$html = (string)SHM_SIMPLE_FORM( $html = (string)SHM_SIMPLE_FORM(
make_link("image_report/remove_reports_by"), "image_report/remove_reports_by",
INPUT(["type"=>'hidden', "name"=>'user_id', "value"=>$duser->id]), INPUT(["type"=>'hidden', "name"=>'user_id', "value"=>$duser->id]),
SHM_SUBMIT('Delete all reports by this user') SHM_SUBMIT('Delete all reports by this user')
); );

View file

@ -9,7 +9,7 @@ class RotateImageTheme extends Themelet
public function get_rotate_html(int $image_id): string public function get_rotate_html(int $image_id): string
{ {
return (string)SHM_SIMPLE_FORM( return (string)SHM_SIMPLE_FORM(
make_link('rotate/'.$image_id), 'rotate/'.$image_id,
INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image_id]), INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image_id]),
INPUT(["type"=>'number', "name"=>'rotate_deg', "id"=>"rotate_deg", "placeholder"=>"Rotation degrees"]), INPUT(["type"=>'number', "name"=>'rotate_deg', "id"=>"rotate_deg", "placeholder"=>"Rotation degrees"]),
INPUT(["type"=>'submit', "value"=>'Rotate', "id"=>"rotatebutton"]), INPUT(["type"=>'submit', "value"=>'Rotate', "id"=>"rotatebutton"]),

View file

@ -9,7 +9,7 @@ class Rule34Theme extends Themelet
{ {
global $page; global $page;
$html = (string)SHM_SIMPLE_FORM( $html = (string)SHM_SIMPLE_FORM(
make_link("rule34/comic_admin"), "rule34/comic_admin",
INPUT(["type"=>'hidden', "name"=>'user_id', "value"=>$duser->id]), INPUT(["type"=>'hidden', "name"=>'user_id', "value"=>$duser->id]),
LABEL(INPUT(["type"=>'checkbox', "name"=>'is_admin', "checked"=>$current_state]), "Comic Admin"), LABEL(INPUT(["type"=>'checkbox', "name"=>'is_admin', "checked"=>$current_state]), "Comic Admin"),
BR(), BR(),

View file

@ -6,7 +6,7 @@ class TrashTheme extends Themelet
public function get_image_admin_html(int $image_id) public function get_image_admin_html(int $image_id)
{ {
return (string)SHM_SIMPLE_FORM( return (string)SHM_SIMPLE_FORM(
make_link('trash_restore/'.$image_id), 'trash_restore/'.$image_id,
INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image_id]), INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image_id]),
INPUT(["type"=>'submit', "value"=>'Restore From Trash']), INPUT(["type"=>'submit', "value"=>'Restore From Trash']),
); );

View file

@ -64,7 +64,7 @@ class UserPageTheme extends Themelet
} }
$form = SHM_SIMPLE_FORM( $form = SHM_SIMPLE_FORM(
make_link("user_admin/create"), "user_admin/create",
TABLE( TABLE(
["class"=>"form"], ["class"=>"form"],
TBODY( TBODY(
@ -120,7 +120,7 @@ class UserPageTheme extends Themelet
{ {
global $config, $user; global $config, $user;
$form = SHM_SIMPLE_FORM( $form = SHM_SIMPLE_FORM(
make_link("user_admin/login"), "user_admin/login",
TABLE( TABLE(
["style"=>"width: 100%", "class"=>"form"], ["style"=>"width: 100%", "class"=>"form"],
TBODY( TBODY(