Skip to content

Commit

Permalink
add delete button
Browse files Browse the repository at this point in the history
  • Loading branch information
leotsarev committed Apr 2, 2024
1 parent 3177707 commit a555b48
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions public_html/appcode/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ function __construct ($games_array)
{
$this -> games_array = $games_array;
$this -> use_checkbox = FALSE;
$this -> show_delete_link = FALSE;
$this -> show_reviews = TRUE;
$this -> show_only_future = FALSE;
$this -> show_status = TRUE;
Expand Down Expand Up @@ -359,6 +360,13 @@ function write_editor_box($id)
{
echo "<input type=\"checkbox\" name=\"mark[]\" value=\"$id\" />";
echo "&nbsp;";
} else if ($this -> show_delete_link)
{
echo "<form action=\"/edit/game/?id=$id\" method=post style=\"display:inline\">";

submit("Удалить", 'delete', $id, '', TRUE);
echo "</form> &nbsp;";

}
$edit_link = get_game_edit_link($id);
echo "<a href=\"$edit_link\">Изменить</a>";
Expand Down
8 changes: 8 additions & 0 deletions public_html/edit/game/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,14 @@ function action_resolve_no_add($id)
}
else
{
if (array_key_exists('HTTP_REFERER', $_SERVER))
{
$parsed= parse_url($_SERVER['HTTP_REFERER']);
if ($parsed['path'] == '/edit/')
{
redirect_to('/edit/');
}
}
redirect_to(get_game_edit_link($id));
}
break;
Expand Down
1 change: 1 addition & 0 deletions public_html/edit/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function show_count_link($link, $text, $count)
{
echo '<h2>Модерация игр</h2>';
$calendar = new Calendar($list);
$calendar -> show_delete_link = TRUE;
$calendar -> write_calendar();
}

Expand Down

0 comments on commit a555b48

Please sign in to comment.