Example #1
0
        echo '</div>';
        if ($plugin_exists) {
            if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['csrf']) && check_csrf($_POST['csrf'], 'plugins_csrf')) {
                if (isset($_POST['description'])) {
                    if (actions::edit_plugin($_GET['id'], array('description' => $_POST['description'], 'menu' => isset($_POST['in_menu']) ? 1 : 0, 'icon' => isset($_POST['menu_ico']) ? $_POST['menu_ico'] : 1, 'publish' => isset($_POST['publish']) ? 1 : 0))) {
                        $info = admin_query::plugin_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'], 'plugins_csrf')) {
                    if ($_GET['type'] == 'delete_image') {
                        if (isset($_GET['id'])) {
                            if (actions::delete_plugin_image($_GET['id'])) {
                                $info->image = '';
                                echo '<div class="a-success">' . $LANG['msg_deleted'] . '</div>';
                            } else {
                                echo '<div class="a-error">' . $LANG['msg_error'] . '</div>';
                            }
                        }
                    }
                }
            }
            $_SESSION['plugins_csrf'] = $csrf;
            echo '<div class="form-table">

<form action="#" method="POST" enctype="multipart/form-data">

<div class="row"><span>' . $LANG['form_publish'] . ':</span>