if ($continue) {
    $output .= "\n<a href='index.php?p=content-editgallery&amp;id=" . $g . "' class='backlink'>&lt; návrat zpět</a>\n<h1>" . $_lang['admin.content.manageimgs.title'] . "</h1>\n<p class='bborder'>" . str_replace("*galtitle*", $galdata['title'], $_lang['admin.content.manageimgs.p']) . "</p>\n\n" . $message . "\n\n<script type='text/javascript'>\n/* <![CDATA[ */\n\$(document).ready(function(){\n    \$('.hs_fieldset').each(function(){\n        var fieldset = this;\n        var link = \$(fieldset).find('legend > a').get(0);\n        var form = \$(fieldset).children('form');\n        \$(form).hide();\n        \$(link).click(function(){\n            \$(form).slideToggle('fast');\n\n            return false;\n        });\n    });\n});\n/* ]]> */\n</script>\n\n<fieldset>\n<legend>" . $_lang['admin.content.manageimgs.upload'] . "</legend>\n<form action='index.php?p=content-manageimgs&amp;g=" . $g . "' method='post' enctype='multipart/form-data'>\n    <p>" . sprintf($_lang['admin.content.manageimgs.upload.text'], _galuploadresize_w, _galuploadresize_h) . "</p>\n    <input type='hidden' name='xaction' value='7' />\n    <div id='fmanFiles'><input type='file' name='uf0[]' multiple='multiple' />&nbsp;&nbsp;<a href='#' onclick='return _sysFmanAddFile();'>" . $_lang['admin.fman.upload.addfile'] . "</a></div>\n    <div class='hr'><hr /></div>\n    <p>\n        <input type='submit' value='" . $_lang['admin.content.manageimgs.upload.submit'] . "' />" . (($uplimit = _getUploadLimit(true)) !== null ? " &nbsp;<small>" . $_lang['global.uploadlimit'] . ": <em>" . _getUploadLimit() . "MB</em>, " . $_lang['global.uploadext'] . ": <em>" . implode(', ', SL::$imageExt) . "</em></small>" : '') . "<br />\n        <label><input type='checkbox' value='1' name='moveords' checked='checked' /> " . $_lang['admin.content.manageimgs.moveords'] . "</label>\n    </p>\n" . _xsrfProtect() . "</form>\n</fieldset>\n\n<fieldset class='hs_fieldset'>\n<legend><a href='#'>" . $_lang['admin.content.manageimgs.insert'] . "</a> &nbsp;<small>(" . $_lang['admin.content.manageimgs.insert.tip'] . ")</small></legend>\n<form action='index.php?p=content-manageimgs&amp;g=" . $g . "' method='post' name='addform' onsubmit='_sysGalTransferPath(this);'>\n<input type='hidden' name='xaction' value='1' />\n\n<table>\n<tr class='valign-top'>\n\n<td>\n    <table>\n    <tr>\n    <td class='rpad'><strong>" . $_lang['admin.content.form.title'] . "</strong></td>\n    <td><input type='text' name='title' class='inputmedium' maxlength='64' /></td>\n    </tr>\n\n    <tr>\n    <td class='rpad'><strong>" . $_lang['admin.content.form.ord'] . "</strong></td>\n    <td><input type='text' name='ord' class='inputsmall' disabled='disabled' />&nbsp;&nbsp;<label><input type='checkbox' name='moveords' value='1' checked='checked' onclick=\"_sysDisableField(this.checked, 'addform', 'ord');\" /> " . $_lang['admin.content.manageimgs.moveords'] . "</label></td>\n    </tr>\n\n    <tr>\n    <td class='rpad'><strong>" . $_lang['admin.content.manageimgs.prev'] . "</strong></td>\n    <td><input type='text' name='prev' class='inputsmall' disabled='disabled' />&nbsp;&nbsp;<label><input type='checkbox' name='autoprev' value='1' checked='checked' onclick=\"_sysDisableField(this.checked, 'addform', 'prev');\" /> " . $_lang['admin.content.manageimgs.autoprev'] . "</label></td>\n    </tr>\n\n    <tr>\n    <td class='rpad'><strong>" . $_lang['admin.content.manageimgs.full'] . "</strong></td>\n    <td><input type='text' name='full' class='inputmedium' /></td>\n    </tr>\n\n    <tr>\n    <td></td>\n    <td><input type='submit' value='" . $_lang['global.insert'] . "' /></td>\n    </tr>\n\n    </table>\n</td>\n\n<td>\n" . (_loginright_adminfman ? "<div id='gallery-browser'>\n    " . (!isset($_GET['browserpath']) ? "<a href='#' onclick=\"return _sysGalBrowse('" . urlencode(_upload_dir) . (_loginright_adminfmanlimit ? _loginname . '%2F' : '') . "');\"><img src='images/icons/loupe.png' alt='browse' class='icon' />" . $_lang['admin.content.manageimgs.insert.browser.link'] . "</a>" : "<script type='text/javascript'>_sysGalBrowse('" . _htmlStr($_GET['browserpath']) . "');</script>") . "\n</div>" : '') . "\n</td>\n\n</tr>\n</table>\n\n" . _xsrfProtect() . "</form>\n</fieldset>\n\n";
    // strankovani
    $paging = _resultPaging("index.php?p=content-manageimgs&amp;g=" . $g, $galdata['var2'], "images", "home=" . $g);
    $s = $paging[2];
    $output .= "\n<fieldset>\n<legend>" . $_lang['admin.content.manageimgs.current'] . "</legend>\n<form action='index.php?p=content-manageimgs&amp;g=" . $g . "&amp;page=" . $s . "' method='post' name='editform'>\n<input type='hidden' name='xaction' value='4' />\n\n<input type='submit' value='" . $_lang['admin.content.manageimgs.savechanges'] . "' class='gallery-savebutton' />\n" . $paging[0] . "\n<div class='cleaner'></div>";
    // vypis obrazku
    $images = DB::query("SELECT * FROM `" . _mysql_prefix . "-images` WHERE home=" . $g . " ORDER BY ord " . $paging[1]);
    $images_forms = array();
    if (DB::size($images) != 0) {
        // sestaveni formularu
        while ($image = DB::row($images)) {
            // kod nahledu
            $preview = _galleryImage($image, "1", $galdata['var4'], $galdata['var3']);
            // kod formulare
            $images_forms[] .= "\n<table>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['admin.content.form.title'] . "</strong></td>\n<td><input type='text' name='i" . $image['id'] . "_title' class='inputmedium' value='" . $image['title'] . "' maxlength='64' /></td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['admin.content.form.ord'] . "</strong></td>\n<td><input type='text' name='i" . $image['id'] . "_ord' class='inputmedium' value='" . $image['ord'] . "' /></td>\n</tr>\n\n" . (!$image['in_storage'] ? "<tr>\n<td class='rpad'><strong>" . $_lang['admin.content.manageimgs.prev'] . "</strong></td>\n<td><input type='hidden' name='i" . $image['id'] . "_prevtrigger' value='1' /><input type='text' name='i" . $image['id'] . "_prev' class='inputsmall' value='" . $image['prev'] . "'" . _inputDisable($image['prev'] != "") . " />&nbsp;&nbsp;<label><input type='checkbox' name='i" . $image['id'] . "_autoprev' value='1' onclick=\"_sysDisableField(checked, 'editform', 'i" . $image['id'] . "_prev');\"" . _checkboxActivate($image['prev'] == "") . " /> " . $_lang['admin.content.manageimgs.autoprev'] . "</label></td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['admin.content.manageimgs.full'] . "</strong></td>\n<td><input type='text' name='i" . $image['id'] . "_full' class='inputmedium' value='" . $image['full'] . "' /></td>\n</tr>" : '') . "\n\n<tr class='valign-top'>\n<td class='rpad'><strong>" . $_lang['global.preview'] . "</strong></td>\n<td>" . $preview . "<br /><br /><a href='" . _xsrfLink("index.php?p=content-manageimgs&amp;g=" . $g . "&amp;page=" . $s . "&amp;del=" . $image['id']) . "' onclick='return _sysConfirm();'><img src='images/icons/delete.png' alt='del' class='icon' />" . $_lang['admin.content.manageimgs.delete'] . "</a></td>\n</tr>\n\n</table>\n    ";
        }
        // sestaveni tabulky formularu po dvou
        $output .= "\n<table id='gallery-edittable'>";
        $count = count($images_forms);
        for ($i = 0; $i < $count; $i += 2) {
            if (isset($images_forms[$i])) {
                $output .= "<tr><td" . (0 === $i % 2 && !isset($images_forms[$i + 1]) && 1 !== $count ? ' colspan="2"' : '') . " class='gallery-edittable-td'>\n" . $images_forms[$i] . "\n</td>\n";
                if (isset($images_forms[$i + 1])) {
                    $output .= "<td class='gallery-edittable-td'>\n" . $images_forms[$i + 1] . "\n</td></tr>\n";
                } else {
                    $output .= '</tr>' . _nl;
                }
            }
        }
        $output .= '</table>';
                if ($id == 2 and !in_array($item, $unregistered_useable) or _userHasNotRight($item)) {
                    continue;
                }
                $newdata[$item] = _checkboxLoad($item);
            }
        }
        // ulozeni
        $sql = '';
        $last = sizeof($newdata) - 1;
        $counter = 0;
        foreach ($newdata as $col => $val) {
            $sql .= '`' . $col . '`=\'' . $val . '\'';
            if ($counter !== $last) {
                $sql .= ',';
            }
            ++$counter;
        }
        DB::query('UPDATE `' . _mysql_prefix . '-groups` SET ' . $sql . ' WHERE id=' . $id);
        // reload stranky
        define('_redirect_to', 'index.php?p=users-editgroup&id=' . $id . '&saved');
        return;
    }
    /* ---  vystup  --- */
    $output .= "\n  <p class='bborder'>" . $_lang['admin.users.groups.editp'] . "</p>\n  " . (isset($_GET['saved']) ? _formMessage(1, $_lang['global.saved']) : '') . "\n  " . ($systemitem ? _admin_smallNote($_lang['admin.users.groups.specialgroup.editnotice']) : '') . "\n  <form action='index.php?p=users-editgroup&amp;id=" . $id . "' method='post'>\n  <table>\n\n  <tr>\n  <td><strong>" . $_lang['global.name'] . "</strong></td>\n  <td><input type='text' name='title' class='inputmedium' value='" . $query['title'] . "' maxlength='32' /></td>\n  </tr>\n\n  <tr>\n  <td><strong>" . $_lang['global.descr'] . "</strong></td>\n  <td><input type='text' name='descr' class='inputmedium' value='" . $query['descr'] . "' maxlength='128' /></td>\n  </tr>\n\n  <tr>\n  <td class='rpad'><strong>" . $_lang['admin.users.groups.level'] . "</strong></td>\n  <td><input type='text' name='level' class='inputmedium' value='" . $query['level'] . "'" . _inputDisable(!$systemitem) . " /></td>\n  </tr>\n\n  " . ($id != 2 ? "\n  <tr><td><strong>" . $_lang['admin.users.groups.icon'] . "</strong></td><td><input type='text' name='icon' class='inputsmall' value='" . $query['icon'] . "' maxlength='16' /></td></tr>\n  <tr><td><strong>" . $_lang['admin.users.groups.color'] . "</strong></td><td><input type='text' name='color' class='inputsmall' value='" . $query['color'] . "' maxlength='16' /></td></tr>\n  <tr><td class='rpad'><strong>" . $_lang['admin.users.groups.reglist'] . "</strong></td><td><input type='checkbox' name='reglist' value='1'" . _checkboxActivate($query['reglist']) . " /></td></tr>\n  " : '') . "\n\n  <tr>\n  <td class='rpad'><strong>" . $_lang['admin.users.groups.blocked'] . "</strong></td>\n  <td><input type='checkbox' name='blocked' value='1'" . _checkboxActivate($query['blocked']) . _inputDisable($id != 1 and $id != 2) . " /></td>\n  </tr>\n\n  </table><br />\n\n  <fieldset>\n  <legend>" . $_lang['admin.users.groups.commonrights'] . "</legend>\n  <table>\n\n  " . $rights . "\n\n\n  </table></fieldset><br />\n\n\n  <br />\n  <input type='submit' value='" . $_lang['global.save'] . "' />&nbsp;&nbsp;<small>" . $_lang['admin.content.form.thisid'] . " " . $id . "</small>\n\n  " . _xsrfProtect() . "</form>\n  ";
} else {
    if ($levelconflict == false) {
        $output .= _formMessage(3, $_lang['global.badinput']);
    } else {
        $output .= _formMessage(3, $_lang['global.disallowed']);
    }
}
示例#3
0
  <td class="lpad">' . $_lang['admin.settings.admin.adminscheme_mode.help'] . '</td>
  </tr>

  </table>
  </fieldset>


  <!-- *************** MOD_REWRITE *************** -->
  <fieldset id="settings_rewrite">
  <legend>' . $_lang['admin.settings.rewrite'] . '</legend>

  <table>

  <tr>
  <td class="rpad"><strong>' . $_lang['admin.settings.mods.modrewrite'] . '</strong></td>
  <td><input type="checkbox" name="modrewrite" value="1"' . _checkboxActivate(_modrewrite) . _inputDisable(@file_exists(_indexroot . ".htaccess")) . ' /></td>
  <td class="lpad">' . $_lang['admin.settings.mods.modrewrite.help'] . '</td>
  </tr>

  <tr>
  <td></td><td></td>
  <td class="lpad"><p>' . $_lang['admin.settings.mods.modrewrite.help2'] . '</p></td>
  </tr>

  </table>
  </fieldset>


  <!-- *************** USERS *************** -->
  <fieldset id="settings_users">
  <legend>' . $_lang['admin.settings.users'] . '</legend>
        if (isset($raw_sizes[$key])) {
            $sizes[$key] = $size_formatted;
        } else {
            $sizes[$key] = '<code class="text-' . $class . '">' . $size_formatted . '</code>';
        }
    }
    // vygenerovat vyberu slozek
    $dir_items = '';
    if ($type !== _backup_db) {
        $dirs_optional = array('upload' => 0);
        foreach ($dirs as $dir_name) {
            $dir_items .= '<label><input type="checkbox" name="dir_' . $dir_name . '" value="1" checked="checked"' . _inputDisable(isset($dirs_optional[$dir_name])) . ' /> ' . $_lang['admin.other.backup.backup.items.dir'] . ' <code>' . $dir_name . '</code> - ' . $sizes[$dir_name] . '</label><br />' . _nl;
        }
    }
    // formular
    $output .= "\n<form method='post' action='remote/backup.php' target='_blank' onsubmit=\"setTimeout(function(){window.location = 'index.php?p=other-backup';}, 1000);\">\n<input type='hidden' name='type' value='" . $type . "' />\n\n<p class='bborder'>" . $_lang['admin.other.backup.backup.' . $type_name . '.info'] . "</p>\n\n<table class='formtable'>\n\n<tr>\n    <td><strong>" . $_lang['admin.other.backup.backup.type'] . "</strong></td>\n    <td>" . $_lang['admin.other.backup.backup.' . $type_name] . "&nbsp; <small class='note'>(" . $_lang['admin.other.backup.backup.' . $type_name . '.hint'] . ")</small></td>\n</tr>\n\n<tr>\n    <td><strong>" . $_lang['admin.other.backup.backup.fname'] . "</strong></td>\n    <td><input type='text' name='fname' class='inputmedium' value='{$fname}' /><em>.{$type_ext}</em></td>\n</tr>\n\n<tr>\n    <td><strong>" . $_lang['global.note'] . "</strong></td>\n    <td><input type='text' name='note' class='inputmedium' maxlength='48' /></td>\n</tr>\n\n<tr>\n    <td><strong>" . $_lang['admin.other.backup.backup.compress'] . "</strong></td>\n    <td><select class='inputmedium' name='compress'>\n        <option value='0'>" . $_lang['admin.other.backup.backup.compress.0'] . "</option>\n        <option value='1'" . ($can_compress && $should_compress ? " selected='selected'" : '') . _inputDisable($can_compress) . ">" . $_lang['admin.other.backup.backup.compress.1'] . (!$should_compress ? ' (' . $_lang['global.notrecommended'] . ')' : '') . "</option>\n        <option value='2'" . _inputDisable($can_compress) . ">" . $_lang['admin.other.backup.backup.compress.2'] . (!$should_compress ? ' (' . $_lang['global.notrecommended'] . ')' : '') . "</option>\n    </select></td>\n</tr>\n\n<tr class='valign-top'>\n    <td><strong>" . $_lang['admin.other.backup.backup.items'] . "</strong></td>\n    <td>\n        <label><input type='checkbox' name='item_database' disabled='disabled' checked='checked' /> " . $_lang['admin.other.backup.backup.items.db'] . ' - ' . $sizes['db'] . "</label><br />\n        " . $dir_items . "\n    </td>\n</tr>\n\n<tr>\n    <td><strong>" . $_lang['admin.other.backup.backup.sizesum'] . "</strong></td>\n    <td><code class='text-" . $sizes_sum_class . "'>" . $sizes['sum'] . '</code>' . ($can_compress ? ' <small class="note">(' . $_lang['admin.other.backup.backup.sizesum.note'] . ')</small>' : '') . "</td>\n</tr>\n\n<tr>\n    <td></td>\n    <td>\n        <br />\n        <input type='submit' name='target_down' value='" . $_lang['admin.other.backup.backup.submit.down'] . "' />\n        " . ($type !== _backup_full ? "<input type='submit' name='target_store' value='" . $_lang['admin.other.backup.backup.submit.store'] . "' />" : '') . "\n        &nbsp;&nbsp;<a href='index.php?p=other-backup'><img src='images/icons/delete2.png' alt='cancel' class='icon' />" . $_lang['global.cancel'] . "</a>\n    </td>\n</tr>\n\n</table>\n" . _xsrfProtect() . "</form>\n";
} elseif (isset($_POST['do_restore']) && _loginright_adminrestore) {
    /* ----- obnova zalohy ----- */
    $msg = '';
    // akce
    if (isset($_POST['action'])) {
        switch ($_POST['action']) {
            // upload
            case 1:
                // kontrola nahrani
                if (!isset($_FILES['backup']) || !is_uploaded_file($_FILES['backup']['tmp_name'])) {
                    $msg = _formMessage(2, $_lang['global.noupload']);
                    break;
                }
                // nazev souboru
                $fname = _anchorStr($_FILES['backup']['name']);
    // zpravy
    $messages_code = "";
    if (isset($_GET['r'])) {
        switch ($_GET['r']) {
            case 1:
                $messages_code .= _formMessage(1, $_lang['global.saved']);
                break;
            case 2:
                $messages_code .= _formMessage(1, $_lang['global.created']);
                break;
        }
    }
    if ($message != "") {
        $messages_code .= _formMessage(2, $message);
    }
    $output .= "\n<p class='bborder'>" . $_lang['admin.users.edit.p'] . "</p>\n" . $messages_code . "\n<form autocomplete='off' action='index.php?p=users-edit" . ($id != null ? "&amp;id=" . $id : '') . "' method='post' name='userform'" . _jsCheckForm("userform", $id != null ? array("username", "email") : array("username", "email", "password")) . ">\n<table class='formtable'>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['login.username'] . "</strong></td>\n<td><input type='text' name='username' class='inputsmall'" . _restorePostValue('username', $query['username']) . " maxlength='24' /></td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['mod.settings.publicname'] . "</strong></td>\n<td><input type='text' name='publicname' class='inputsmall'" . _restorePostValue('publicname', $query['publicname'], false, true, false) . " maxlength='24' /></td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang[$id == null ? 'login.password' : 'mod.settings.password.new'] . "</strong></td>\n<td><input type='password' name='password' class='inputsmall' /></td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['global.group'] . "</strong></td>\n<td>" . $group_select . "</td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['login.blocked'] . "</strong></td>\n<td><input type='checkbox' name='blocked' value='1'" . _checkboxActivate($query['blocked'] || isset($_POST['blocked'])) . " /></td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['global.levelshift'] . "</strong></td>\n<td><input type='checkbox' name='levelshift' value='1'" . _checkboxActivate($query['levelshift'] || isset($_POST['levelshift'])) . _inputDisable(_loginid == 0) . " /></td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['global.email'] . "</strong></td>\n<td><input type='text' name='email' class='inputsmall'" . _restorePostValue('email', $query['email']) . " /></td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['global.icq'] . "</strong></td>\n<td><input type='text' name='icq' class='inputsmall' value='" . (($val = _restorePostValue('icq', $query['icq'], true)) != 0 ? $val : '') . "' /></td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['global.skype'] . "</strong></td>\n<td><input type='text' name='skype' class='inputsmall'" . _restorePostValue('skype', $query['skype']) . " /></td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['global.msn'] . "</strong></td>\n<td><input type='text' name='msn' class='inputsmall'" . _restorePostValue('msn', $query['msn']) . " /></td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['global.jabber'] . "</strong></td>\n<td><input type='text' name='jabber' class='inputsmall' value='" . $query['jabber'] . "' /></td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['global.web'] . "</strong></td>\n<td><input type='text' name='web' class='inputsmall'" . _restorePostValue('web', $query['web'], false, true, false) . " /> <small>" . $_lang['mod.settings.web.hint'] . "</small></td>\n</tr>\n\n<tr>\n<td class='rpad'><strong>" . $_lang['global.avatar'] . "</strong></td>\n<td><label><input type='checkbox' name='removeavatar' value='1' /> " . $_lang['mod.settings.avatar.remove'] . "</label></td>\n</tr>\n\n<tr class='valign-top'>\n<td class='rpad'><strong>" . $_lang['global.note'] . "</strong></td>\n<td><textarea name='note' class='areasmall' rows='9' cols='33'>" . _restorePostValue('note', $query['note'], true, true, false) . "</textarea></td>\n</tr>\n\n<tr><td></td>\n<td><input type='submit' value='" . $_lang[isset($_GET['id']) ? 'global.save' : 'global.create'] . "' />" . ($id != null ? "&nbsp;&nbsp;<small>" . $_lang['admin.content.form.thisid'] . " " . $query['id'] . "</small>" : '') . "</td>\n</tr>\n\n</table>\n" . _xsrfProtect() . "</form>\n";
    // odkaz na profil a zjisteni ip
    if ($id != null) {
        $output .= "\n  <p>\n  <a href='" . _indexroot . "index.php?m=profile&amp;id=" . $query['username'] . "' target='_blank'>" . $_lang['mod.settings.profilelink'] . " &gt;</a>\n  " . (_loginright_adminbans ? "<br /><a href='index.php?p=other-bans&amp;getip=" . $query['username'] . "'>" . $_lang['admin.other.bans.getuserip'] . " &gt;</a>" : '') . "\n  </p>\n  ";
    }
} else {
    switch ($errno) {
        case 1:
            $output .= _formMessage(2, $_lang['global.baduser']);
            break;
        case 2:
            $output .= _formMessage(2, $_lang['global.rootnote']);
            break;
        default:
            $output .= _formMessage(3, $_lang['global.disallowed']);
            break;