} else { echo '<li><a href="?route=stores.php&action=list&type=publish&id=' . $_GET['id'] . '&token=' . $csrf . '">' . $LANG['publish'] . '</a></li>'; } echo '</ul> </div>'; } echo '<a href="?route=stores.php&action=list" class="btn">' . $LANG['stores_view'] . '</a> </div>'; if (!empty($LANG['stores_edit_subtitle'])) { echo '<span>' . $LANG['stores_edit_subtitle'] . '</span>'; } echo '</div>'; if ($store_exists) { if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['csrf']) && check_csrf($_POST['csrf'], 'stores_csrf')) { if (isset($_POST['user']) && isset($_POST['category']) && isset($_POST['name']) && isset($_POST['url']) && isset($_POST['tags']) && isset($_POST['description']) && isset($_FILES['logo']) && isset($_POST['meta_title']) && isset($_POST['meta_desc'])) { if (actions::edit_store($_GET['id'], array('user' => $_POST['user'], 'category' => $_POST['category'], 'name' => $_POST['name'], 'url' => $_POST['url'], 'tags' => $_POST['tags'], 'description' => $_POST['description'], 'popular' => isset($_POST['popular']) ? 1 : 0, 'publish' => isset($_POST['publish']) ? 1 : 0, 'meta_title' => $_POST['meta_title'], 'meta_desc' => $_POST['meta_desc']))) { $info = \query\main::store_infos($_GET['id']); echo '<div class="a-success">' . $LANG['msg_saved'] . '</div>'; } else { echo '<div class="a-error">' . $LANG['msg_error'] . '</div>'; } } } else { if (isset($_GET['type']) && isset($_GET['token']) && check_csrf($_GET['token'], 'stores_csrf')) { if ($_GET['type'] == 'delete_image') { if (isset($_GET['id'])) { if (actions::delete_store_image($_GET['id'])) { $info->image = ''; echo '<div class="a-success">' . $LANG['msg_deleted'] . '</div>'; } else { echo '<div class="a-error">' . $LANG['msg_error'] . '</div>';