| @@ -0,0 +1,18 @@ | |||
| 1 | + | # CodeFactor configuration. | |
| 2 | + | # Keep analysis on hand-written application code; skip vendored, generated, | |
| 3 | + | # minified and machine-converted files that we do not maintain by hand. | |
| 4 | + | ||
| 5 | + | exclude_paths: | |
| 6 | + | - "assets/sceditor/**" | |
| 7 | + | - "assets/fontawesome/**" | |
| 8 | + | - "**/*.min.js" | |
| 9 | + | - "**/*.min.css" | |
| 10 | + | - "**/*.map" | |
| 11 | + | - "layouts/*/_locale_update/**" | |
| 12 | + | - "layouts/*/assets/**" | |
| 13 | + | - "engine/function/itemparser/**" | |
| 14 | + | - "engine/cert/**" | |
| 15 | + | - "engine/cache/**" | |
| 16 | + | - "TO_CONVERT/**" | |
| 17 | + | - "SQL/**" | |
| 18 | + | - "install/**" |
| @@ -0,0 +1,20 @@ | |||
| 1 | + | .git | |
| 2 | + | .github | |
| 3 | + | .idea | |
| 4 | + | release | |
| 5 | + | vendor | |
| 6 | + | node_modules | |
| 7 | + | config.local.php | |
| 8 | + | config.php.bak | |
| 9 | + | install/installed.lock | |
| 10 | + | engine/cache/* | |
| 11 | + | engine/img/theme/* | |
| 12 | + | *.rar | |
| 13 | + | PULL_REQUEST.md | |
| 14 | + | upload_github | |
| 15 | + | plugins/*/ | |
| 16 | + | layouts/*/ | |
| 17 | + | !layouts/default | |
| 18 | + | !layouts/_example | |
| 19 | + | !layouts/_childexample | |
| 20 | + | !layouts/tibiacom_original |
| @@ -0,0 +1,12 @@ | |||
| 1 | + | root = true | |
| 2 | + | ||
| 3 | + | [*] | |
| 4 | + | charset = utf-8 | |
| 5 | + | end_of_line = lf | |
| 6 | + | indent_style = tab | |
| 7 | + | insert_final_newline = true | |
| 8 | + | trim_trailing_whitespace = true | |
| 9 | + | ||
| 10 | + | [*.{php,css,html,xml,lua,js}] | |
| 11 | + | indent_style = tab | |
| 12 | + | indent_size = 4 |
| @@ -0,0 +1,27 @@ | |||
| 1 | + | # Copy this file to .env and adjust as needed, then run: docker compose up -d | |
| 2 | + | ||
| 3 | + | # --- MySQL ------------------------------------------------------------- | |
| 4 | + | MYSQL_ROOT_PASSWORD=znotex_root | |
| 5 | + | MYSQL_DATABASE=znotex | |
| 6 | + | MYSQL_USER=znotex | |
| 7 | + | MYSQL_PASSWORD=znotex | |
| 8 | + | ||
| 9 | + | # --- ZnoteX -------------------------------------------------------------- | |
| 10 | + | ZNOTE_SITE_URL=http://localhost:8080 | |
| 11 | + | ZNOTE_SITE_TITLE=ZnoteX | |
| 12 | + | # One of: TFS_10 (TFS 1.1-1.4.2), TFS_16 (TFS 1.6), CANARY (Canary/OTServBR-Global), | |
| 13 | + | # TFS_03 (TFS 0.3.6+/0.4/OTX), TFS_02 (TFS 0.2.13+), OTHIRE. | |
| 14 | + | # Picks which game database schema gets imported on first boot - only TFS_10 ships | |
| 15 | + | # with demo accounts/characters, the others get the correct empty schema. | |
| 16 | + | # Changing this after the first `docker compose up -d` has no effect; wipe the db | |
| 17 | + | # volume (docker compose down -v) to switch engines. | |
| 18 | + | ZNOTE_SERVER_ENGINE=TFS_10 | |
| 19 | + | # Account name granted admin panel access - matches the TFS_10 demo data seed. | |
| 20 | + | ZNOTE_ADMIN_ACCOUNT=demo | |
| 21 | + | ||
| 22 | + | # --- Ports on your machine ------------------------------------------------ | |
| 23 | + | ZNOTEX_HTTP_PORT=8080 | |
| 24 | + | ZNOTEX_DB_PORT=3306 | |
| 25 | + | ZNOTEX_PMA_PORT=8081 | |
| 26 | + | ZNOTEX_MAILPIT_SMTP_PORT=1025 | |
| 27 | + | ZNOTEX_MAILPIT_WEB_PORT=8025 |
| @@ -0,0 +1,16 @@ | |||
| 1 | + | # Set the default behavior, in case people don't have core.autocrlf set. | |
| 2 | + | * text=auto | |
| 3 | + | ||
| 4 | + | # Declare files that will always have LF line endings on checkout. | |
| 5 | + | *.php text eol=lf | |
| 6 | + | *.lua text eol=lf | |
| 7 | + | *.html text eol=lf | |
| 8 | + | *.css text eol=lf | |
| 9 | + | *.js text eol=lf | |
| 10 | + | *.xml text eol=lf | |
| 11 | + | ||
| 12 | + | *.sql text eol=crlf | |
| 13 | + | ||
| 14 | + | # Denote all files that are truly binary and should not be modified. | |
| 15 | + | *.png binary | |
| 16 | + | *.jpg binary |
| @@ -0,0 +1,50 @@ | |||
| 1 | + | name: PHP Compatibility | |
| 2 | + | ||
| 3 | + | on: | |
| 4 | + | push: | |
| 5 | + | branches: | |
| 6 | + | - main | |
| 7 | + | pull_request: | |
| 8 | + | branches: | |
| 9 | + | - main | |
| 10 | + | workflow_dispatch: | |
| 11 | + | ||
| 12 | + | permissions: | |
| 13 | + | contents: read | |
| 14 | + | ||
| 15 | + | jobs: | |
| 16 | + | php-syntax: | |
| 17 | + | name: PHP ${{ matrix.php-version }} | |
| 18 | + | runs-on: ubuntu-latest | |
| 19 | + | ||
| 20 | + | strategy: | |
| 21 | + | fail-fast: false | |
| 22 | + | matrix: | |
| 23 | + | php-version: | |
| 24 | + | - '8.1' | |
| 25 | + | - '8.2' | |
| 26 | + | - '8.3' | |
| 27 | + | - '8.4' | |
| 28 | + | - '8.5' | |
| 29 | + | ||
| 30 | + | steps: | |
| 31 | + | - name: Checkout repository | |
| 32 | + | uses: actions/checkout@v4 | |
| 33 | + | ||
| 34 | + | - name: Setup PHP ${{ matrix.php-version }} | |
| 35 | + | uses: shivammathur/setup-php@v2 | |
| 36 | + | with: | |
| 37 | + | php-version: ${{ matrix.php-version }} | |
| 38 | + | extensions: mysqli, curl, openssl, gd | |
| 39 | + | coverage: none | |
| 40 | + | ||
| 41 | + | - name: Show PHP version | |
| 42 | + | run: php -v | |
| 43 | + | ||
| 44 | + | - name: Check PHP syntax | |
| 45 | + | run: | | |
| 46 | + | find . \ | |
| 47 | + | -type f \ | |
| 48 | + | -name "*.php" \ | |
| 49 | + | -not -path "./vendor/*" \ | |
| 50 | + | -print0 | xargs -0 -r -n1 php -l |
| @@ -0,0 +1,35 @@ | |||
| 1 | + | *.cache.php | |
| 2 | + | engine/cache/* | |
| 3 | + | .idea | |
| 4 | + | vendor/ | |
| 5 | + | /release/ | |
| 6 | + | # Theme packaging and its output. This belongs on the layouts branch, not here: | |
| 7 | + | # the code branch stays small, and cloning it does not drag the themes along. | |
| 8 | + | upload_github/ | |
| 9 | + | ||
| 10 | + | # Written by the installer: database credentials and the admin names for THIS | |
| 11 | + | # install. It must never reach a public repository. | |
| 12 | + | config.local.php | |
| 13 | + | config.php.bak | |
| 14 | + | ||
| 15 | + | # Docker environment | |
| 16 | + | .env | |
| 17 | + | ||
| 18 | + | # PHPUnit's own run-history cache. | |
| 19 | + | .phpunit.result.cache | |
| 20 | + | ||
| 21 | + | # The installer's lock, created when it finishes. | |
| 22 | + | install/installed.lock | |
| 23 | + | ||
| 24 | + | *.rar | |
| 25 | + | # The pull-request description. Written to be pasted into GitHub, not shipped. | |
| 26 | + | PULL_REQUEST.md | |
| 27 | + | ||
| 28 | + | # Theme background/logo images uploaded from the admin panel. | |
| 29 | + | engine/img/theme/ | |
| 30 | + | ||
| 31 | + | # Plugins are distributed on the plugins branch and downloaded / dropped into | |
| 32 | + | # plugins/. The code branch only ships the folder, its README and .htaccess. | |
| 33 | + | plugins/*/ | |
| 34 | + | plugins/.* | |
| 35 | + | !plugins/.htaccess |
| @@ -0,0 +1,5 @@ | |||
| 1 | + | Options +FollowSymLinks | |
| 2 | + | RewriteEngine On | |
| 3 | + | RewriteCond %{REQUEST_FILENAME} !-f | |
| 4 | + | RewriteCond %{REQUEST_FILENAME} !-d | |
| 5 | + | RewriteRule ^(.*)$ /characterprofile.php?name=$1 |
| @@ -0,0 +1,7 @@ | |||
| 1 | + | <?php | |
| 2 | + | require_once 'engine/init.php'; | |
| 3 | + | theme_open(); | |
| 4 | + | ||
| 5 | + | view('achievements'); | |
| 6 | + | ||
| 7 | + | theme_close(); |
| @@ -0,0 +1,1146 @@ | |||
| 1 | + | /* ========================================================================== | |
| 2 | + | ZnoteX Admin Control Panel | |
| 3 | + | Blue day/night panel, built to feel separate from MyAAC templates. | |
| 4 | + | ========================================================================== */ | |
| 5 | + | ||
| 6 | + | :root { | |
| 7 | + | --acp-sidebar-w: 278px; | |
| 8 | + | --acp-topbar-h: 44px; | |
| 9 | + | --acp-blue-900: #155376; | |
| 10 | + | --acp-blue-800: #1d638b; | |
| 11 | + | --acp-blue-700: #2478aa; | |
| 12 | + | --acp-blue-600: #2f94d1; | |
| 13 | + | --acp-blue-100: #e9f4fb; | |
| 14 | + | --acp-bg: #ececec; | |
| 15 | + | --acp-panel: #ffffff; | |
| 16 | + | --acp-panel-2: #f5f8fa; | |
| 17 | + | --acp-fg: #15191f; | |
| 18 | + | --acp-muted: #5d6878; | |
| 19 | + | --acp-line: #d7dce2; | |
| 20 | + | --acp-line-soft: #e8edf2; | |
| 21 | + | --acp-green: #2f9d68; | |
| 22 | + | --acp-red: #d64b4b; | |
| 23 | + | --acp-amber: #f08a00; | |
| 24 | + | --acp-purple: #8068c4; | |
| 25 | + | --acp-radius: 4px; | |
| 26 | + | --acp-shadow: 0 1px 2px rgba(0, 0, 0, .08); | |
| 27 | + | } | |
| 28 | + | ||
| 29 | + | [data-acp-theme="dark"] { | |
| 30 | + | --acp-blue-900: #0d2638; | |
| 31 | + | --acp-blue-800: #123a54; | |
| 32 | + | --acp-blue-700: #1b577d; | |
| 33 | + | --acp-blue-600: #45a7df; | |
| 34 | + | --acp-blue-100: #172736; | |
| 35 | + | --acp-bg: #12151a; | |
| 36 | + | --acp-panel: #1b2027; | |
| 37 | + | --acp-panel-2: #232a33; | |
| 38 | + | --acp-fg: #e7ebf1; | |
| 39 | + | --acp-muted: #a0a9b6; | |
| 40 | + | --acp-line: #303844; | |
| 41 | + | --acp-line-soft: #28313d; | |
| 42 | + | --acp-shadow: 0 1px 2px rgba(0, 0, 0, .32); | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | * { box-sizing: border-box; } | |
| 46 | + | html, body { margin: 0; min-height: 100%; } | |
| 47 | + | ||
| 48 | + | body.acp { | |
| 49 | + | background: var(--acp-bg); | |
| 50 | + | color: var(--acp-fg); | |
| 51 | + | font: 14px/1.55 Arial, Helvetica, sans-serif; | |
| 52 | + | } | |
| 53 | + | ||
| 54 | + | .acp a { color: #0977b8; text-decoration: none; } | |
| 55 | + | .acp a:hover { color: var(--acp-blue-600); text-decoration: underline; } | |
| 56 | + | [data-acp-theme="dark"] .acp a { color: #72c2ee; } | |
| 57 | + | .acp h1, .acp h2, .acp h3, .acp h4 { margin: 0; font-weight: 400; line-height: 1.25; } | |
| 58 | + | .acp p { margin: 0 0 10px; } | |
| 59 | + | .acp p:last-child { margin-bottom: 0; } | |
| 60 | + | .acp img { max-width: 100%; height: auto; } | |
| 61 | + | .acp code, .acp pre { font-family: Consolas, Monaco, monospace; font-size: 12.5px; } | |
| 62 | + | ||
| 63 | + | .acp-shell { | |
| 64 | + | min-height: 100vh; | |
| 65 | + | display: grid; | |
| 66 | + | grid-template-columns: var(--acp-sidebar-w) minmax(0, 1fr); | |
| 67 | + | } | |
| 68 | + | ||
| 69 | + | /* Sidebar */ | |
| 70 | + | .acp-sidebar { | |
| 71 | + | position: sticky; | |
| 72 | + | top: 0; | |
| 73 | + | height: 100vh; | |
| 74 | + | background: var(--acp-blue-800); | |
| 75 | + | color: #d9edf8; | |
| 76 | + | box-shadow: 2px 0 8px rgba(0, 0, 0, .18); | |
| 77 | + | overflow-y: auto; | |
| 78 | + | overflow-x: hidden; | |
| 79 | + | z-index: 20; | |
| 80 | + | scrollbar-gutter: stable; | |
| 81 | + | scrollbar-width: thin; | |
| 82 | + | scrollbar-color: rgba(255, 255, 255, .28) transparent; | |
| 83 | + | } | |
| 84 | + | ||
| 85 | + | .acp-sidebar::-webkit-scrollbar { | |
| 86 | + | width: 8px; | |
| 87 | + | } | |
| 88 | + | ||
| 89 | + | .acp-sidebar::-webkit-scrollbar-track { | |
| 90 | + | background: transparent; | |
| 91 | + | } | |
| 92 | + | ||
| 93 | + | .acp-sidebar::-webkit-scrollbar-thumb { | |
| 94 | + | background: rgba(255, 255, 255, .22); | |
| 95 | + | border-radius: 4px; | |
| 96 | + | border: 2px solid transparent; | |
| 97 | + | background-clip: padding-box; | |
| 98 | + | } | |
| 99 | + | ||
| 100 | + | .acp-sidebar::-webkit-scrollbar-thumb:hover { | |
| 101 | + | background: rgba(255, 255, 255, .38); | |
| 102 | + | background-clip: padding-box; | |
| 103 | + | } | |
| 104 | + | ||
| 105 | + | .acp-sidebar::-webkit-scrollbar-corner { | |
| 106 | + | background: transparent; | |
| 107 | + | } | |
| 108 | + | ||
| 109 | + | .acp .acp-side-home, | |
| 110 | + | .acp .acp-side-home:visited { | |
| 111 | + | display: flex; | |
| 112 | + | align-items: center; | |
| 113 | + | gap: 14px; | |
| 114 | + | height: var(--acp-topbar-h); | |
| 115 | + | padding: 0 14px; | |
| 116 | + | background: var(--acp-blue-900); | |
| 117 | + | color: #fff; | |
| 118 | + | font-size: 15px; | |
| 119 | + | box-shadow: 0 2px 7px rgba(0, 0, 0, .22); | |
| 120 | + | } | |
| 121 | + | .acp .acp-side-home:hover, | |
| 122 | + | .acp .acp-side-home:focus { color: #fff; text-decoration: none; background: #174f70; } | |
| 123 | + | .acp .acp-side-home .fa { | |
| 124 | + | width: 18px; | |
| 125 | + | text-align: center; | |
| 126 | + | font-size: 17px; | |
| 127 | + | color: #fff; | |
| 128 | + | } | |
| 129 | + | .acp .acp-side-home span { | |
| 130 | + | white-space: nowrap; | |
| 131 | + | overflow: hidden; | |
| 132 | + | text-overflow: ellipsis; | |
| 133 | + | color: #fff; | |
| 134 | + | } | |
| 135 | + | ||
| 136 | + | .acp-nav-filter { | |
| 137 | + | position: relative; | |
| 138 | + | padding: 12px; | |
| 139 | + | background: rgba(0, 0, 0, .08); | |
| 140 | + | border-bottom: 1px solid rgba(0, 0, 0, .12); | |
| 141 | + | } | |
| 142 | + | .acp-nav-filter .fa { | |
| 143 | + | position: absolute; | |
| 144 | + | left: 24px; | |
| 145 | + | top: 50%; | |
| 146 | + | transform: translateY(-50%); | |
| 147 | + | color: #b8d7e9; | |
| 148 | + | pointer-events: none; | |
| 149 | + | } | |
| 150 | + | .acp-nav-filter input { | |
| 151 | + | width: 100%; | |
| 152 | + | height: 36px; | |
| 153 | + | padding: 0 12px 0 34px; | |
| 154 | + | border: 1px solid rgba(255, 255, 255, .16); | |
| 155 | + | border-radius: var(--acp-radius); | |
| 156 | + | background: rgba(255, 255, 255, .12); | |
| 157 | + | color: #fff; | |
| 158 | + | font: inherit; | |
| 159 | + | outline: none; | |
| 160 | + | } | |
| 161 | + | .acp-nav-filter input::placeholder { color: #c7deec; } | |
| 162 | + | .acp-nav-filter input:focus { | |
| 163 | + | background: rgba(255, 255, 255, .18); | |
| 164 | + | border-color: rgba(255, 255, 255, .42); | |
| 165 | + | } | |
| 166 | + | ||
| 167 | + | .acp-nav-group { | |
| 168 | + | border-bottom: 1px solid rgba(0, 0, 0, .14); | |
| 169 | + | } | |
| 170 | + | .acp-nav-group-label { | |
| 171 | + | width: 100%; | |
| 172 | + | height: 69px; | |
| 173 | + | display: flex; | |
| 174 | + | align-items: center; | |
| 175 | + | justify-content: space-between; | |
| 176 | + | gap: 12px; | |
| 177 | + | padding: 0 13px; | |
| 178 | + | border: 0; | |
| 179 | + | background: transparent; | |
| 180 | + | color: #d9edf8; | |
| 181 | + | font: inherit; | |
| 182 | + | font-size: 18px; | |
| 183 | + | cursor: pointer; | |
| 184 | + | text-align: left; | |
| 185 | + | } | |
| 186 | + | .acp-nav-group-label:hover, | |
| 187 | + | .acp-nav-group.is-open > .acp-nav-group-label { | |
| 188 | + | background: rgba(0, 0, 0, .11); | |
| 189 | + | } | |
| 190 | + | .acp-nav-group-label .fa { color: #b9d9ec; } | |
| 191 | + | .acp-nav-group:not(.is-open) ul { display: none; } | |
| 192 | + | ||
| 193 | + | .acp-nav-plugin { list-style: none; } | |
| 194 | + | .acp-nav-plugin-label { | |
| 195 | + | width: 100%; | |
| 196 | + | display: flex; | |
| 197 | + | align-items: center; | |
| 198 | + | gap: 11px; | |
| 199 | + | min-height: 38px; | |
| 200 | + | padding: 0 14px 0 24px; | |
| 201 | + | border: 0; | |
| 202 | + | background: transparent; | |
| 203 | + | color: #eef8ff; | |
| 204 | + | font: inherit; | |
| 205 | + | font-size: 14px; | |
| 206 | + | cursor: pointer; | |
| 207 | + | text-align: left; | |
| 208 | + | } | |
| 209 | + | .acp-nav-plugin-label:hover { background: rgba(255, 255, 255, .08); } | |
| 210 | + | .acp-nav-plugin-label > .fa:first-child { width: 18px; text-align: center; font-size: 15px; color: #dff3ff; } | |
| 211 | + | .acp-nav-plugin-label .acp-nav-caret { margin-left: auto; font-size: 12px; color: #b9d9ec; transition: transform .15s; } | |
| 212 | + | .acp-nav-plugin.is-open > .acp-nav-plugin-label .acp-nav-caret { transform: rotate(90deg); } | |
| 213 | + | .acp-nav-plugin:not(.is-open) > ul { display: none; } | |
| 214 | + | .acp-nav-plugin > ul { background: rgba(0, 0, 0, .14); } | |
| 215 | + | .acp-nav-plugin > ul .acp-nav-link { padding-left: 40px; } | |
| 216 | + | ||
| 217 | + | .acp-nav ul { | |
| 218 | + | margin: 0; | |
| 219 | + | padding: 0 0 8px; | |
| 220 | + | list-style: none; | |
| 221 | + | background: rgba(0, 0, 0, .09); | |
| 222 | + | } | |
| 223 | + | .acp .acp-nav-link { | |
| 224 | + | display: flex; | |
| 225 | + | align-items: center; | |
| 226 | + | gap: 11px; | |
| 227 | + | min-height: 38px; | |
| 228 | + | padding: 0 14px 0 24px; | |
| 229 | + | color: #eef8ff; | |
| 230 | + | border-left: 4px solid transparent; | |
| 231 | + | font-size: 14px; | |
| 232 | + | } | |
| 233 | + | .acp .acp-nav-link:hover { | |
| 234 | + | background: rgba(255, 255, 255, .08); | |
| 235 | + | color: #fff; | |
| 236 | + | text-decoration: none; | |
| 237 | + | } | |
| 238 | + | .acp .acp-nav-link.is-active { | |
| 239 | + | background: rgba(255, 255, 255, .16); | |
| 240 | + | border-left-color: #fff; | |
| 241 | + | color: #fff; | |
| 242 | + | font-weight: 700; | |
| 243 | + | } | |
| 244 | + | .acp .acp-nav-link > .fa:first-child { | |
| 245 | + | width: 18px; | |
| 246 | + | text-align: center; | |
| 247 | + | font-size: 15px; | |
| 248 | + | color: #dff3ff; | |
| 249 | + | } | |
| 250 | + | .acp .acp-nav-link:hover > .fa:first-child, | |
| 251 | + | .acp .acp-nav-link.is-active > .fa:first-child { | |
| 252 | + | color: #fff; | |
| 253 | + | } | |
| 254 | + | .acp .acp-nav-text { | |
| 255 | + | flex: 1 1 auto; | |
| 256 | + | white-space: nowrap; | |
| 257 | + | overflow: hidden; | |
| 258 | + | text-overflow: ellipsis; | |
| 259 | + | color: inherit; | |
| 260 | + | } | |
| 261 | + | .acp .acp-nav-badge { | |
| 262 | + | min-width: 22px; | |
| 263 | + | height: 22px; | |
| 264 | + | padding: 0 7px; | |
| 265 | + | border-radius: 50px; | |
| 266 | + | background: #f05b73; | |
| 267 | + | color: #fff; | |
| 268 | + | font-size: 12px; | |
| 269 | + | font-weight: 700; | |
| 270 | + | line-height: 22px; | |
| 271 | + | text-align: center; | |
| 272 | + | } | |
| 273 | + | .acp .acp-nav-ext { font-size: 11px; opacity: .75; color: #dff3ff; } | |
| 274 | + | .acp-nav-nomatch { | |
| 275 | + | margin: 0; | |
| 276 | + | padding: 14px; | |
| 277 | + | color: #e7f5fd; | |
| 278 | + | background: rgba(0, 0, 0, .12); | |
| 279 | + | } | |
| 280 | + | .acp-backdrop { display: none; } | |
| 281 | + | ||
| 282 | + | /* Main panel */ | |
| 283 | + | .acp-panel { | |
| 284 | + | min-width: 0; | |
| 285 | + | display: flex; | |
| 286 | + | flex-direction: column; | |
| 287 | + | } | |
| 288 | + | ||
| 289 | + | .acp-topbar { | |
| 290 | + | position: sticky; | |
| 291 | + | top: 0; | |
| 292 | + | z-index: 15; | |
| 293 | + | height: var(--acp-topbar-h); | |
| 294 | + | display: flex; | |
| 295 | + | align-items: center; | |
| 296 | + | gap: 14px; | |
| 297 | + | padding: 0 16px; | |
| 298 | + | background: var(--acp-blue-900); | |
| 299 | + | color: #fff; | |
| 300 | + | box-shadow: 0 2px 8px rgba(0, 0, 0, .24); | |
| 301 | + | } | |
| 302 | + | .acp-burger { display: inline-flex; } | |
| 303 | + | .acp-top-title { | |
| 304 | + | display: flex; | |
| 305 | + | align-items: baseline; | |
| 306 | + | gap: 12px; | |
| 307 | + | min-width: 0; | |
| 308 | + | flex: 1 1 auto; | |
| 309 | + | } | |
| 310 | + | .acp-top-title strong { | |
| 311 | + | font-size: 15px; | |
| 312 | + | white-space: nowrap; | |
| 313 | + | overflow: hidden; | |
| 314 | + | text-overflow: ellipsis; | |
| 315 | + | } | |
| 316 | + | .acp-top-title span { | |
| 317 | + | color: #bdd6e6; | |
| 318 | + | font-size: 12px; | |
| 319 | + | white-space: nowrap; | |
| 320 | + | } | |
| 321 | + | .acp-top-actions { | |
| 322 | + | display: flex; | |
| 323 | + | align-items: center; | |
| 324 | + | gap: 8px; | |
| 325 | + | } | |
| 326 | + | ||
| 327 | + | .acp .acp-icon-btn, | |
| 328 | + | .acp .acp-theme-toggle, | |
| 329 | + | .acp-user { | |
| 330 | + | display: inline-flex; | |
| 331 | + | align-items: center; | |
| 332 | + | justify-content: center; | |
| 333 | + | gap: 8px; | |
| 334 | + | height: 32px; | |
| 335 | + | border: 0; | |
| 336 | + | border-radius: var(--acp-radius); | |
| 337 | + | background: rgba(255, 255, 255, .1); | |
| 338 | + | color: #fff; | |
| 339 | + | font: inherit; | |
| 340 | + | } | |
| 341 | + | .acp .acp-icon-btn { | |
| 342 | + | width: 32px; | |
| 343 | + | padding: 0; | |
| 344 | + | cursor: pointer; | |
| 345 | + | } | |
| 346 | + | .acp .acp-theme-toggle { | |
| 347 | + | padding: 0 11px; | |
| 348 | + | cursor: pointer; | |
| 349 | + | } | |
| 350 | + | .acp-user { padding: 0 11px; } | |
| 351 | + | .acp .acp-icon-btn:hover, | |
| 352 | + | .acp .acp-theme-toggle:hover { | |
| 353 | + | background: rgba(255, 255, 255, .18); | |
| 354 | + | color: #fff; | |
| 355 | + | text-decoration: none; | |
| 356 | + | } | |
| 357 | + | .acp .acp-icon-btn .fa, | |
| 358 | + | .acp .acp-theme-toggle .fa, | |
| 359 | + | .acp .acp-theme-toggle span, | |
| 360 | + | .acp .acp-user, | |
| 361 | + | .acp .acp-user .fa, | |
| 362 | + | .acp .acp-user span { | |
| 363 | + | color: #fff; | |
| 364 | + | } | |
| 365 | + | ||
| 366 | + | .acp-sidebar-closed .acp-shell { | |
| 367 | + | grid-template-columns: minmax(0, 1fr); | |
| 368 | + | } | |
| 369 | + | .acp-sidebar-closed .acp-sidebar { | |
| 370 | + | display: none; | |
| 371 | + | } | |
| 372 | + | ||
| 373 | + | .acp-content { | |
| 374 | + | flex: 1 1 auto; | |
| 375 | + | width: min(1154px, calc(100% - 42px)); | |
| 376 | + | margin: 0 auto; | |
| 377 | + | padding: 18px 0 24px; | |
| 378 | + | } | |
| 379 | + | ||
| 380 | + | .acp-page-head { | |
| 381 | + | margin-bottom: 14px; | |
| 382 | + | } | |
| 383 | + | .acp-page-head h1 { | |
| 384 | + | font-size: 26px; | |
| 385 | + | font-weight: 400; | |
| 386 | + | color: var(--acp-fg); | |
| 387 | + | } | |
| 388 | + | .acp-page-head p { | |
| 389 | + | margin-top: 4px; | |
| 390 | + | color: var(--acp-muted); | |
| 391 | + | } | |
| 392 | + | ||
| 393 | + | .acp-breadcrumb { | |
| 394 | + | display: flex; | |
| 395 | + | align-items: center; | |
| 396 | + | gap: 6px; | |
| 397 | + | margin-bottom: 6px; | |
| 398 | + | font-size: 12.5px; | |
| 399 | + | color: var(--acp-muted); | |
| 400 | + | } | |
| 401 | + | .acp-breadcrumb a { color: var(--acp-muted); text-decoration: none; } | |
| 402 | + | .acp-breadcrumb a:hover { color: var(--acp-fg); text-decoration: underline; } | |
| 403 | + | .acp-breadcrumb-sep { opacity: .6; } | |
| 404 | + | .acp-breadcrumb-current { color: var(--acp-fg); } | |
| 405 | + | ||
| 406 | + | .acp-footer { | |
| 407 | + | width: min(1154px, calc(100% - 42px)); | |
| 408 | + | margin: 0 auto; | |
| 409 | + | padding: 10px 0 20px; | |
| 410 | + | display: flex; | |
| 411 | + | justify-content: space-between; | |
| 412 | + | gap: 14px; | |
| 413 | + | color: var(--acp-muted); | |
| 414 | + | font-size: 12px; | |
| 415 | + | } | |
| 416 | + | ||
| 417 | + | /* Alerts */ | |
| 418 | + | .acp-flash { | |
| 419 | + | display: flex; | |
| 420 | + | align-items: flex-start; | |
| 421 | + | gap: 12px; | |
| 422 | + | margin-bottom: 14px; | |
| 423 | + | padding: 14px 16px; | |
| 424 | + | border: 1px solid #f3d2d2; | |
| 425 | + | border-left: 3px solid var(--acp-red); | |
| 426 | + | border-radius: var(--acp-radius); | |
| 427 | + | background: #fde8e8; | |
| 428 | + | color: #bb2f2f; | |
| 429 | + | } | |
| 430 | + | .acp-flash .fa { font-size: 22px; flex: 0 0 auto; margin-top: 1px; } | |
| 431 | + | .acp-flash span { | |
| 432 | + | flex: 1 1 auto; | |
| 433 | + | min-width: 0; | |
| 434 | + | overflow-wrap: anywhere; | |
| 435 | + | word-break: break-word; | |
| 436 | + | white-space: normal; | |
| 437 | + | } | |
| 438 | + | .acp-flash--success { | |
| 439 | + | background: #e6f5ed; | |
| 440 | + | border-color: #c0e2cf; | |
| 441 | + | border-left-color: var(--acp-green); | |
| 442 | + | color: #1f7048; | |
| 443 | + | } | |
| 444 | + | .acp-flash--info { | |
| 445 | + | background: #eaf5fc; | |
| 446 | + | border-color: #c9e3f2; | |
| 447 | + | border-left-color: var(--acp-blue-600); | |
| 448 | + | color: #216282; | |
| 449 | + | } | |
| 450 | + | ||
| 451 | + | /* Cards and grids */ | |
| 452 | + | .acp-card { | |
| 453 | + | background: var(--acp-panel); | |
| 454 | + | border: 1px solid var(--acp-line); | |
| 455 | + | border-radius: var(--acp-radius); | |
| 456 | + | box-shadow: var(--acp-shadow); | |
| 457 | + | margin-bottom: 22px; | |
| 458 | + | overflow: hidden; | |
| 459 | + | } | |
| 460 | + | .acp-card-head { | |
| 461 | + | display: flex; | |
| 462 | + | flex-wrap: wrap; | |
| 463 | + | align-items: center; | |
| 464 | + | gap: 7px 14px; | |
| 465 | + | padding: 10px 12px; | |
| 466 | + | background: var(--acp-blue-100); | |
| 467 | + | border-bottom: 1px solid var(--acp-line); | |
| 468 | + | } | |
| 469 | + | .acp-card-head h2 { | |
| 470 | + | color: #12649b; | |
| 471 | + | font-size: 21px; | |
| 472 | + | font-weight: 400; | |
| 473 | + | } | |
| 474 | + | [data-acp-theme="dark"] .acp-card-head h2 { color: #82cdf4; } | |
| 475 | + | .acp-card-head p { | |
| 476 | + | margin: 0; | |
| 477 | + | color: var(--acp-muted); | |
| 478 | + | font-size: 13px; | |
| 479 | + | } | |
| 480 | + | .acp-card-body { padding: 16px; } | |
| 481 | + | .acp-card-body.is-flush { padding: 0; } | |
| 482 | + | .acp-card-body > :last-child { margin-bottom: 0; } | |
| 483 | + | ||
| 484 | + | .acp-grid { display: grid; gap: 14px; } | |
| 485 | + | .acp-grid--2 { grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr); } | |
| 486 | + | .acp-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } | |
| 487 | + | .acp-grid > .acp-card { margin-bottom: 0; } | |
| 488 | + | ||
| 489 | + | /* Stats */ | |
| 490 | + | .acp-stats { | |
| 491 | + | display: grid; | |
| 492 | + | grid-template-columns: repeat(6, minmax(132px, 1fr)); | |
| 493 | + | gap: 8px; | |
| 494 | + | margin-bottom: 22px; | |
| 495 | + | } | |
| 496 | + | .acp-stat { | |
| 497 | + | display: grid; | |
| 498 | + | place-items: center; | |
| 499 | + | min-height: 102px; | |
| 500 | + | padding: 13px; | |
| 501 | + | border: 1px solid var(--acp-line); | |
| 502 | + | border-radius: var(--acp-radius); | |
| 503 | + | background: var(--acp-panel); | |
| 504 | + | box-shadow: var(--acp-shadow); | |
| 505 | + | color: var(--acp-fg); | |
| 506 | + | text-align: center; | |
| 507 | + | } | |
| 508 | + | a.acp-stat:hover { | |
| 509 | + | border-color: var(--acp-blue-600); | |
| 510 | + | color: var(--acp-fg); | |
| 511 | + | text-decoration: none; | |
| 512 | + | } | |
| 513 | + | .acp-stat-icon { | |
| 514 | + | display: block; | |
| 515 | + | margin-bottom: 7px; | |
| 516 | + | color: #83b7d7; | |
| 517 | + | font-size: 31px; | |
| 518 | + | } | |
| 519 | + | .acp-stat-label { | |
| 520 | + | display: block; | |
| 521 | + | color: #12649b; | |
| 522 | + | font-size: 14px; | |
| 523 | + | } | |
| 524 | + | [data-acp-theme="dark"] .acp-stat-label { color: #82cdf4; } | |
| 525 | + | .acp-stat-value { | |
| 526 | + | display: block; | |
| 527 | + | margin-top: 2px; | |
| 528 | + | font-size: 23px; | |
| 529 | + | font-weight: 700; | |
| 530 | + | line-height: 1.1; | |
| 531 | + | max-width: 100%; | |
| 532 | + | white-space: normal; | |
| 533 | + | overflow-wrap: anywhere; | |
| 534 | + | word-break: normal; | |
| 535 | + | } | |
| 536 | + | .acp-stat--red .acp-stat-icon { color: var(--acp-red); } | |
| 537 | + | .acp-stat--teal .acp-stat-icon { color: #25a7a7; } | |
| 538 | + | .acp-stat--green .acp-stat-icon { color: var(--acp-green); } | |
| 539 | + | .acp-stat--amber .acp-stat-icon { color: var(--acp-amber); } | |
| 540 | + | .acp-stat--purple .acp-stat-icon { color: var(--acp-purple); } | |
| 541 | + | ||
| 542 | + | /* Tables */ | |
| 543 | + | .acp-table-wrap { overflow-x: auto; } | |
| 544 | + | .acp-table { | |
| 545 | + | width: 100%; | |
| 546 | + | border-collapse: collapse; | |
| 547 | + | font-size: 13.5px; | |
| 548 | + | } | |
| 549 | + | .acp-table th, | |
| 550 | + | .acp-table td { | |
| 551 | + | padding: 10px 12px; | |
| 552 | + | border-bottom: 1px solid var(--acp-line); | |
| 553 | + | text-align: left; | |
| 554 | + | vertical-align: middle; | |
| 555 | + | } | |
| 556 | + | .acp-table thead th { | |
| 557 | + | background: var(--acp-panel-2); | |
| 558 | + | color: var(--acp-muted); | |
| 559 | + | font-size: 12px; | |
| 560 | + | font-weight: 700; | |
| 561 | + | letter-spacing: .05em; | |
| 562 | + | text-transform: uppercase; | |
| 563 | + | } | |
| 564 | + | .acp-table tbody tr:last-child td { border-bottom: 0; } | |
| 565 | + | .acp-table tbody tr:hover td { background: var(--acp-panel-2); } | |
| 566 | + | .acp-table .is-num { text-align: right; font-variant-numeric: tabular-nums; } | |
| 567 | + | .acp-table .is-nowrap { white-space: nowrap; } | |
| 568 | + | .acp-table .is-muted { color: var(--acp-muted); } | |
| 569 | + | ||
| 570 | + | .acp-th-sortable { | |
| 571 | + | cursor: pointer; | |
| 572 | + | user-select: none; | |
| 573 | + | position: relative; | |
| 574 | + | padding-right: 20px !important; | |
| 575 | + | } | |
| 576 | + | .acp-th-sortable:hover { color: var(--acp-fg); } | |
| 577 | + | .acp-th-sortable::after { | |
| 578 | + | content: '\2195'; | |
| 579 | + | position: absolute; | |
| 580 | + | right: 7px; | |
| 581 | + | opacity: .35; | |
| 582 | + | font-weight: 400; | |
| 583 | + | } | |
| 584 | + | .acp-th-sortable.is-sorted-asc::after { content: '\2191'; opacity: 1; color: var(--acp-blue-600); } | |
| 585 | + | .acp-th-sortable.is-sorted-desc::after { content: '\2193'; opacity: 1; color: var(--acp-blue-600); } | |
| 586 | + | ||
| 587 | + | /* Forms */ | |
| 588 | + | .acp-field { margin-bottom: 14px; } | |
| 589 | + | .acp-field:last-child { margin-bottom: 0; } | |
| 590 | + | .acp-label { | |
| 591 | + | display: block; | |
| 592 | + | margin-bottom: 5px; | |
| 593 | + | color: var(--acp-fg); | |
| 594 | + | font-size: 13px; | |
| 595 | + | font-weight: 700; | |
| 596 | + | } | |
| 597 | + | .acp-hint { | |
| 598 | + | margin: 5px 0 0; | |
| 599 | + | color: var(--acp-muted); | |
| 600 | + | font-size: 12px; | |
| 601 | + | } | |
| 602 | + | .acp-input, | |
| 603 | + | .acp-select, | |
| 604 | + | .acp-textarea { | |
| 605 | + | width: 100%; | |
| 606 | + | padding: 8px 10px; | |
| 607 | + | border: 1px solid #c8d2da; | |
| 608 | + | border-radius: var(--acp-radius); | |
| 609 | + | background: var(--acp-panel); | |
| 610 | + | color: var(--acp-fg); | |
| 611 | + | font: inherit; | |
| 612 | + | outline: none; | |
| 613 | + | } | |
| 614 | + | [data-acp-theme="dark"] .acp-input, | |
| 615 | + | [data-acp-theme="dark"] .acp-select, | |
| 616 | + | [data-acp-theme="dark"] .acp-textarea { | |
| 617 | + | border-color: var(--acp-line); | |
| 618 | + | } | |
| 619 | + | .acp-input:focus, | |
| 620 | + | .acp-select:focus, | |
| 621 | + | .acp-textarea:focus { | |
| 622 | + | border-color: var(--acp-blue-600); | |
| 623 | + | box-shadow: 0 0 0 2px rgba(47, 148, 209, .15); | |
| 624 | + | } | |
| 625 | + | .acp-input:disabled, | |
| 626 | + | .acp-select:disabled, | |
| 627 | + | .acp-textarea:disabled { | |
| 628 | + | background: var(--acp-panel-2); | |
| 629 | + | color: var(--acp-muted); | |
| 630 | + | cursor: not-allowed; | |
| 631 | + | } | |
| 632 | + | .acp-textarea { min-height: 130px; resize: vertical; } | |
| 633 | + | .acp-row { | |
| 634 | + | display: grid; | |
| 635 | + | grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); | |
| 636 | + | gap: 14px; | |
| 637 | + | } | |
| 638 | + | .acp-actions { | |
| 639 | + | display: flex; | |
| 640 | + | flex-wrap: wrap; | |
| 641 | + | align-items: center; | |
| 642 | + | gap: 8px; | |
| 643 | + | margin-top: 16px; | |
| 644 | + | } | |
| 645 | + | .acp-actions.is-tight { margin-top: 0; } | |
| 646 | + | ||
| 647 | + | .acp-btn { | |
| 648 | + | display: inline-flex; | |
| 649 | + | align-items: center; | |
| 650 | + | justify-content: center; | |
| 651 | + | gap: 7px; | |
| 652 | + | min-height: 34px; | |
| 653 | + | padding: 0 14px; | |
| 654 | + | border: 1px solid #2588c4; | |
| 655 | + | border-radius: var(--acp-radius); | |
| 656 | + | background: #42a5e8; | |
| 657 | + | color: #fff; | |
| 658 | + | font: inherit; | |
| 659 | + | font-weight: 700; | |
| 660 | + | cursor: pointer; | |
| 661 | + | white-space: nowrap; | |
| 662 | + | } | |
| 663 | + | .acp-btn:hover { | |
| 664 | + | background: #58b6f3; | |
| 665 | + | color: #fff; | |
| 666 | + | text-decoration: none; | |
| 667 | + | } | |
| 668 | + | .acp-btn--ghost { | |
| 669 | + | background: transparent; | |
| 670 | + | border-color: var(--acp-line); | |
| 671 | + | color: var(--acp-fg); | |
| 672 | + | } | |
| 673 | + | .acp-btn--ghost:hover { | |
| 674 | + | background: var(--acp-panel-2); | |
| 675 | + | color: var(--acp-fg); | |
| 676 | + | } | |
| 677 | + | .acp-btn--green { background: var(--acp-green); border-color: #277c51; } | |
| 678 | + | .acp-btn--red { background: var(--acp-red); border-color: #b53e3e; } | |
| 679 | + | .acp-btn--amber { background: var(--acp-amber); border-color: #d27700; } | |
| 680 | + | .acp-btn--blue { background: var(--acp-blue-600); border-color: #2588c4; } | |
| 681 | + | .acp-btn--sm { min-height: 28px; padding: 0 10px; font-size: 12.5px; } | |
| 682 | + | ||
| 683 | + | .acp a.acp-btn, | |
| 684 | + | .acp a.acp-btn:hover, | |
| 685 | + | .acp a.acp-btn:visited, | |
| 686 | + | [data-acp-theme="dark"] .acp a.acp-btn { | |
| 687 | + | color: #fff; | |
| 688 | + | text-decoration: none; | |
| 689 | + | } | |
| 690 | + | ||
| 691 | + | .acp a.acp-btn--ghost, | |
| 692 | + | .acp a.acp-btn--ghost:hover, | |
| 693 | + | .acp a.acp-btn--ghost:visited, | |
| 694 | + | [data-acp-theme="dark"] .acp a.acp-btn--ghost { | |
| 695 | + | color: var(--acp-fg); | |
| 696 | + | } | |
| 697 | + | .acp-inline-form { display: inline-block; margin: 0; } | |
| 698 | + | ||
| 699 | + | .acp-pill { | |
| 700 | + | display: inline-block; | |
| 701 | + | padding: 2px 9px; | |
| 702 | + | border: 1px solid var(--acp-line); | |
| 703 | + | border-radius: 50px; | |
| 704 | + | background: var(--acp-panel-2); | |
| 705 | + | color: var(--acp-muted); | |
| 706 | + | font-size: 11.5px; | |
| 707 | + | font-weight: 700; | |
| 708 | + | white-space: nowrap; | |
| 709 | + | } | |
| 710 | + | .acp-pill--green { background: #e4f5ec; border-color: #b9dec9; color: #217147; } | |
| 711 | + | .acp-pill--red { background: #fde8e8; border-color: #f0c5c5; color: #bb2f2f; } | |
| 712 | + | .acp-pill--amber { background: #fff1dc; border-color: #f5d5a8; color: #a76100; } | |
| 713 | + | .acp-pill--blue { background: #e6f4fd; border-color: #bfdef1; color: #216282; } | |
| 714 | + | .acp-pill--purple { background: #eee9fb; border-color: #d3c8f1; color: #614ba1; } | |
| 715 | + | .acp-pill--grey { background: var(--acp-panel-2); } | |
| 716 | + | ||
| 717 | + | .acp-settings-tabs { | |
| 718 | + | display: flex; | |
| 719 | + | flex-wrap: wrap; | |
| 720 | + | gap: 4px; | |
| 721 | + | margin-bottom: 14px; | |
| 722 | + | padding-bottom: 0; | |
| 723 | + | border-bottom: 1px solid var(--acp-line); | |
| 724 | + | } | |
| 725 | + | .acp-settings-tab { | |
| 726 | + | appearance: none; | |
| 727 | + | background: transparent; | |
| 728 | + | border: 1px solid transparent; | |
| 729 | + | border-bottom: none; | |
| 730 | + | border-radius: var(--acp-radius) var(--acp-radius) 0 0; | |
| 731 | + | padding: 8px 14px; | |
| 732 | + | font-size: 13px; | |
| 733 | + | font-weight: 600; | |
| 734 | + | color: var(--acp-muted); | |
| 735 | + | cursor: pointer; | |
| 736 | + | margin-bottom: -1px; | |
| 737 | + | } | |
| 738 | + | .acp-settings-tab:hover { | |
| 739 | + | color: var(--acp-fg); | |
| 740 | + | background: var(--acp-panel-2); | |
| 741 | + | } | |
| 742 | + | .acp-settings-tab.is-active { | |
| 743 | + | color: var(--acp-blue-700); | |
| 744 | + | background: var(--acp-panel); | |
| 745 | + | border-color: var(--acp-line); | |
| 746 | + | border-bottom: 1px solid var(--acp-panel); | |
| 747 | + | } | |
| 748 | + | .acp-settings-panels { display: block; } | |
| 749 | + | .acp-settings-panel[hidden] { display: none; } | |
| 750 | + | ||
| 751 | + | /* Reusable module bits */ | |
| 752 | + | .acp-empty { | |
| 753 | + | padding: 38px 20px; | |
| 754 | + | text-align: center; | |
| 755 | + | color: var(--acp-muted); | |
| 756 | + | } | |
| 757 | + | .acp-empty .fa { | |
| 758 | + | display: block; | |
| 759 | + | margin-bottom: 10px; | |
| 760 | + | font-size: 34px; | |
| 761 | + | opacity: .42; | |
| 762 | + | } | |
| 763 | + | .acp-media { | |
| 764 | + | display: grid; | |
| 765 | + | grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); | |
| 766 | + | gap: 16px; | |
| 767 | + | } | |
| 768 | + | .acp-media-item, | |
| 769 | + | .acp-post { | |
| 770 | + | border: 1px solid var(--acp-line); | |
| 771 | + | border-radius: var(--acp-radius); | |
| 772 | + | background: var(--acp-panel); | |
| 773 | + | overflow: hidden; | |
| 774 | + | } | |
| 775 | + | /* Theme screenshots: any size in, the same card height out. */ | |
| 776 | + | .acp-media-item > img { | |
| 777 | + | display: block; | |
| 778 | + | width: 100%; | |
| 779 | + | height: 170px; | |
| 780 | + | object-fit: cover; | |
| 781 | + | object-position: top center; | |
| 782 | + | background: var(--acp-panel-2); | |
| 783 | + | border-bottom: 1px solid var(--acp-line); | |
| 784 | + | } | |
| 785 | + | ||
| 786 | + | .acp-media-body { padding: 12px 14px; } | |
| 787 | + | .acp-media-body h3 { margin-bottom: 5px; font-size: 14px; font-weight: 700; } | |
| 788 | + | .acp-media-body p { color: var(--acp-muted); font-size: 12.5px; } | |
| 789 | + | .acp-media-foot { | |
| 790 | + | display: flex; | |
| 791 | + | flex-wrap: wrap; | |
| 792 | + | gap: 6px; | |
| 793 | + | padding: 10px 14px; | |
| 794 | + | border-top: 1px solid var(--acp-line); | |
| 795 | + | background: var(--acp-panel-2); | |
| 796 | + | } | |
| 797 | + | .acp-post { margin-bottom: 14px; } | |
| 798 | + | .acp-post-head { | |
| 799 | + | display: flex; | |
| 800 | + | flex-wrap: wrap; | |
| 801 | + | justify-content: space-between; | |
| 802 | + | gap: 4px 12px; | |
| 803 | + | padding: 10px 14px; | |
| 804 | + | background: var(--acp-panel-2); | |
| 805 | + | border-bottom: 1px solid var(--acp-line); | |
| 806 | + | color: var(--acp-muted); | |
| 807 | + | font-size: 12.5px; | |
| 808 | + | } | |
| 809 | + | .acp-post-head strong { color: var(--acp-fg); } | |
| 810 | + | .acp-post-body { padding: 15px; } | |
| 811 | + | .acp-post--staff { border-color: var(--acp-blue-600); } | |
| 812 | + | .acp-post--staff .acp-post-head { background: var(--acp-blue-100); } | |
| 813 | + | ||
| 814 | + | .acp-dl { | |
| 815 | + | display: grid; | |
| 816 | + | grid-template-columns: auto 1fr; | |
| 817 | + | gap: 7px 16px; | |
| 818 | + | margin: 0; | |
| 819 | + | font-size: 13.5px; | |
| 820 | + | } | |
| 821 | + | .acp-dl dt { color: var(--acp-muted); } | |
| 822 | + | .acp-dl dd { margin: 0; min-width: 0; } | |
| 823 | + | ||
| 824 | + | .acp-toolbar { | |
| 825 | + | display: flex; | |
| 826 | + | flex-wrap: wrap; | |
| 827 | + | align-items: center; | |
| 828 | + | justify-content: space-between; | |
| 829 | + | gap: 10px; | |
| 830 | + | margin-bottom: 16px; | |
| 831 | + | } | |
| 832 | + | .acp-dump { | |
| 833 | + | margin: 0; | |
| 834 | + | padding: 14px; | |
| 835 | + | border-radius: var(--acp-radius); | |
| 836 | + | background: #10161e; | |
| 837 | + | color: #c3cede; | |
| 838 | + | overflow-x: auto; | |
| 839 | + | font-size: 12px; | |
| 840 | + | line-height: 1.5; | |
| 841 | + | } | |
| 842 | + | ||
| 843 | + | .acp-shop-preview-img, | |
| 844 | + | .acp-shop-preview-item { | |
| 845 | + | display: inline-block; | |
| 846 | + | vertical-align: middle; | |
| 847 | + | max-width: none; | |
| 848 | + | } | |
| 849 | + | .acp-shop-preview-img { height: 48px; } | |
| 850 | + | .acp-shop-preview-item { | |
| 851 | + | height: 32px; | |
| 852 | + | image-rendering: auto; | |
| 853 | + | } | |
| 854 | + | .acp-shop-preview-img + .acp-shop-preview-img { | |
| 855 | + | margin-left: 3px; | |
| 856 | + | } | |
| 857 | + | .acp-shop-id-field { | |
| 858 | + | display: grid; | |
| 859 | + | grid-template-columns: minmax(0, 1fr) 82px; | |
| 860 | + | gap: 8px; | |
| 861 | + | align-items: stretch; | |
| 862 | + | } | |
| 863 | + | .acp-shop-live-preview { | |
| 864 | + | min-height: 42px; | |
| 865 | + | display: flex; | |
| 866 | + | align-items: center; | |
| 867 | + | justify-content: center; | |
| 868 | + | gap: 3px; | |
| 869 | + | padding: 4px; | |
| 870 | + | border: 1px solid var(--acp-line); | |
| 871 | + | border-radius: var(--acp-radius); | |
| 872 | + | background: var(--acp-panel-2); | |
| 873 | + | overflow: hidden; | |
| 874 | + | } | |
| 875 | + | .acp-shop-live-preview .acp-shop-preview-img { height: 36px; } | |
| 876 | + | .acp-shop-live-preview .acp-shop-preview-item { height: 30px; } | |
| 877 | + | .acp-shop-form-card .acp-card-body { padding-bottom: 18px; } | |
| 878 | + | .acp-shop-form-row { grid-template-columns: repeat(3, minmax(220px, 1fr)); } | |
| 879 | + | .acp-shop-offers-table th:first-child, | |
| 880 | + | .acp-shop-offers-table td:first-child { width: 48px; } | |
| 881 | + | .acp-shop-offers-table th:nth-child(2), | |
| 882 | + | .acp-shop-offers-table td:nth-child(2) { width: 96px; } | |
| 883 | + | .acp-shop-offers-table th:nth-child(4), | |
| 884 | + | .acp-shop-offers-table td:nth-child(4) { width: 100px; } | |
| 885 | + | .acp-shop-offers-table th:nth-child(5), | |
| 886 | + | .acp-shop-offers-table td:nth-child(5) { width: 115px; } | |
| 887 | + | .acp-shop-offer-actions { | |
| 888 | + | text-align: right; | |
| 889 | + | } | |
| 890 | + | .acp-shop-offer-actions .acp-inline-form { margin-left: 8px; } | |
| 891 | + | ||
| 892 | + | @media (max-width: 1200px) { | |
| 893 | + | .acp-stats { grid-template-columns: repeat(3, minmax(150px, 1fr)); } | |
| 894 | + | .acp-grid--2, | |
| 895 | + | .acp-grid--3 { grid-template-columns: 1fr; } | |
| 896 | + | .acp-shop-form-row { grid-template-columns: 1fr; } | |
| 897 | + | } | |
| 898 | + | ||
| 899 | + | @media (max-width: 840px) { | |
| 900 | + | .acp-shell { grid-template-columns: 1fr; } | |
| 901 | + | .acp-sidebar { | |
| 902 | + | position: fixed; | |
| 903 | + | inset: 0 auto 0 0; | |
| 904 | + | width: var(--acp-sidebar-w); | |
| 905 | + | transform: translateX(-100%); | |
| 906 | + | transition: transform .18s ease; | |
| 907 | + | } | |
| 908 | + | .acp-nav-open .acp-sidebar { transform: translateX(0); } | |
| 909 | + | .acp-backdrop { | |
| 910 | + | position: fixed; | |
| 911 | + | inset: 0; | |
| 912 | + | z-index: 18; | |
| 913 | + | background: rgba(0, 0, 0, .45); | |
| 914 | + | } | |
| 915 | + | .acp-nav-open .acp-backdrop { display: block; } | |
| 916 | + | .acp-content, | |
| 917 | + | .acp-footer { width: min(100% - 24px, 1154px); } | |
| 918 | + | .acp-top-title span { display: none; } | |
| 919 | + | .acp-sidebar-closed .acp-sidebar { | |
| 920 | + | display: block; | |
| 921 | + | } | |
| 922 | + | } | |
| 923 | + | ||
| 924 | + | @media (max-width: 560px) { | |
| 925 | + | .acp-topbar { padding: 0 10px; } | |
| 926 | + | .acp-user-name, | |
| 927 | + | .acp-theme-toggle span { display: none; } | |
| 928 | + | .acp-stats { grid-template-columns: 1fr; } | |
| 929 | + | .acp-page-head h1 { font-size: 23px; } | |
| 930 | + | .acp-footer { flex-direction: column; } | |
| 931 | + | .acp-dl { grid-template-columns: 1fr; } | |
| 932 | + | } | |
| 933 | + | ||
| 934 | + | @media print { | |
| 935 | + | .acp-sidebar, | |
| 936 | + | .acp-topbar, | |
| 937 | + | .acp-footer, | |
| 938 | + | .acp-backdrop { display: none !important; } | |
| 939 | + | .acp-shell { display: block; } | |
| 940 | + | .acp-content { width: 100%; margin: 0; padding: 0; } | |
| 941 | + | .acp-card { box-shadow: none; break-inside: avoid; } | |
| 942 | + | } | |
| 943 | + | ||
| 944 | + | /* Disabled paging arrow */ | |
| 945 | + | .acp-btn.is-disabled { | |
| 946 | + | opacity: .45; | |
| 947 | + | pointer-events: none; | |
| 948 | + | } | |
| 949 | + | ||
| 950 | + | /* A catalogue theme that is already installed */ | |
| 951 | + | .acp-media-item.is-dimmed { opacity: .58; } | |
| 952 | + | .acp-media-item.is-dimmed:hover { opacity: 1; } | |
| 953 | + | ||
| 954 | + | .acp-top-search { | |
| 955 | + | position: relative; | |
| 956 | + | flex: 1 1 auto; | |
| 957 | + | max-width: 420px; | |
| 958 | + | margin: 0 14px 0 auto; | |
| 959 | + | } | |
| 960 | + | ||
| 961 | + | .acp-top-search .fa { | |
| 962 | + | position: absolute; | |
| 963 | + | left: 10px; | |
| 964 | + | top: 50%; | |
| 965 | + | transform: translateY(-50%); | |
| 966 | + | font-size: 13px; | |
| 967 | + | color: rgba(255, 255, 255, .6); | |
| 968 | + | pointer-events: none; | |
| 969 | + | } | |
| 970 | + | ||
| 971 | + | .acp-top-search input { | |
| 972 | + | width: 100%; | |
| 973 | + | height: 30px; | |
| 974 | + | padding: 0 46px 0 30px; | |
| 975 | + | border: 1px solid rgba(255, 255, 255, .18); | |
| 976 | + | border-radius: 15px; | |
| 977 | + | background: rgba(255, 255, 255, .12); | |
| 978 | + | color: #fff; | |
| 979 | + | font: inherit; | |
| 980 | + | font-size: 13px; | |
| 981 | + | outline: none; | |
| 982 | + | } | |
| 983 | + | ||
| 984 | + | .acp-top-search input::placeholder { color: rgba(255, 255, 255, .6); } | |
| 985 | + | ||
| 986 | + | .acp-top-search input:focus { | |
| 987 | + | background: rgba(255, 255, 255, .2); | |
| 988 | + | border-color: rgba(255, 255, 255, .45); | |
| 989 | + | } | |
| 990 | + | ||
| 991 | + | .acp-search-kbd { | |
| 992 | + | position: absolute; | |
| 993 | + | right: 8px; | |
| 994 | + | top: 50%; | |
| 995 | + | transform: translateY(-50%); | |
| 996 | + | padding: 2px 6px; | |
| 997 | + | border: 1px solid rgba(255, 255, 255, .25); | |
| 998 | + | border-radius: 5px; | |
| 999 | + | background: rgba(255, 255, 255, .1); | |
| 1000 | + | color: rgba(255, 255, 255, .65); | |
| 1001 | + | font-size: 10px; | |
| 1002 | + | font-family: inherit; | |
| 1003 | + | line-height: 1.4; | |
| 1004 | + | pointer-events: none; | |
| 1005 | + | } | |
| 1006 | + | ||
| 1007 | + | .acp-search-page { margin: 0 0 16px; } | |
| 1008 | + | .acp-input--lg { height: 42px; font-size: 15px; } | |
| 1009 | + | ||
| 1010 | + | .acp-search-results { list-style: none; margin: 0; padding: 0; } | |
| 1011 | + | ||
| 1012 | + | .acp-search-results li { border-bottom: 1px solid var(--acp-line-soft); } | |
| 1013 | + | .acp-search-results li:last-child { border-bottom: 0; } | |
| 1014 | + | ||
| 1015 | + | .acp .acp-search-results a { | |
| 1016 | + | display: flex; | |
| 1017 | + | align-items: center; | |
| 1018 | + | gap: 12px; | |
| 1019 | + | padding: 11px 16px; | |
| 1020 | + | color: var(--acp-fg); | |
| 1021 | + | text-decoration: none; | |
| 1022 | + | } | |
| 1023 | + | ||
| 1024 | + | .acp .acp-search-results a:hover { background: var(--acp-panel-2); text-decoration: none; } | |
| 1025 | + | ||
| 1026 | + | .acp-search-results > li > a > .fa:first-child { | |
| 1027 | + | width: 18px; | |
| 1028 | + | text-align: center; | |
| 1029 | + | color: var(--acp-muted); | |
| 1030 | + | } | |
| 1031 | + | ||
| 1032 | + | .acp-search-main { flex: 1 1 auto; min-width: 0; } | |
| 1033 | + | ||
| 1034 | + | .acp-search-title { display: block; font-weight: 600; } | |
| 1035 | + | ||
| 1036 | + | .acp-search-ctx { | |
| 1037 | + | display: block; | |
| 1038 | + | font-size: 12px; | |
| 1039 | + | color: var(--acp-muted); | |
| 1040 | + | } | |
| 1041 | + | ||
| 1042 | + | .acp-search-detail { | |
| 1043 | + | display: block; | |
| 1044 | + | font-size: 12.5px; | |
| 1045 | + | color: var(--acp-muted); | |
| 1046 | + | margin-top: 2px; | |
| 1047 | + | } | |
| 1048 | + | ||
| 1049 | + | .acp-search-go { color: var(--acp-muted); } | |
| 1050 | + | ||
| 1051 | + | .acp-search-results mark { | |
| 1052 | + | background: #ffe9a8; | |
| 1053 | + | color: inherit; | |
| 1054 | + | padding: 0 2px; | |
| 1055 | + | border-radius: 2px; | |
| 1056 | + | } | |
| 1057 | + | ||
| 1058 | + | [data-acp-theme="dark"] .acp-search-results mark { background: #6b5a1f; color: #fff; } | |
| 1059 | + | ||
| 1060 | + | @media (max-width: 900px) { | |
| 1061 | + | .acp-top-search { display: none; } | |
| 1062 | + | } | |
| 1063 | + | ||
| 1064 | + | .acp-field--found { | |
| 1065 | + | position: relative; | |
| 1066 | + | border-radius: var(--acp-radius); | |
| 1067 | + | box-shadow: 0 0 0 3px rgba(47, 148, 209, .55); | |
| 1068 | + | animation: acpFound 2.6s ease-out; | |
| 1069 | + | } | |
| 1070 | + | ||
| 1071 | + | @keyframes acpFound { | |
| 1072 | + | 0%, 60% { background: rgba(47, 148, 209, .14); } | |
| 1073 | + | 100% { background: transparent; } | |
| 1074 | + | } | |
| 1075 | + | ||
| 1076 | + | .acp-perm-list { display: flex; flex-direction: column; gap: 12px; } | |
| 1077 | + | .acp-perm-account { | |
| 1078 | + | border: 1px solid var(--acp-line); | |
| 1079 | + | border-radius: var(--acp-radius); | |
| 1080 | + | background: var(--acp-panel-2); | |
| 1081 | + | padding: 12px; | |
| 1082 | + | } | |
| 1083 | + | .acp-perm-account-head { | |
| 1084 | + | display: flex; | |
| 1085 | + | align-items: center; | |
| 1086 | + | gap: 12px; | |
| 1087 | + | flex-wrap: wrap; | |
| 1088 | + | margin-bottom: 10px; | |
| 1089 | + | } | |
| 1090 | + | .acp-perm-account-head .acp-input { flex: 1 1 220px; min-width: 160px; } | |
| 1091 | + | .acp-perm-owner-toggle { | |
| 1092 | + | display: flex; | |
| 1093 | + | align-items: center; | |
| 1094 | + | gap: 6px; | |
| 1095 | + | font-weight: 700; | |
| 1096 | + | white-space: nowrap; | |
| 1097 | + | } | |
| 1098 | + | .acp-perm-modules { | |
| 1099 | + | display: grid; | |
| 1100 | + | grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); | |
| 1101 | + | gap: 10px 16px; | |
| 1102 | + | border-top: 1px solid var(--acp-line); | |
| 1103 | + | padding-top: 10px; | |
| 1104 | + | } | |
| 1105 | + | .acp-perm-modules[hidden] { display: none; } | |
| 1106 | + | .acp-perm-group h4 { | |
| 1107 | + | margin: 0 0 6px; | |
| 1108 | + | font-size: 11px; | |
| 1109 | + | font-weight: 700; | |
| 1110 | + | letter-spacing: .05em; | |
| 1111 | + | text-transform: uppercase; | |
| 1112 | + | color: var(--acp-muted); | |
| 1113 | + | } | |
| 1114 | + | .acp-perm-mod { | |
| 1115 | + | display: flex; | |
| 1116 | + | align-items: center; | |
| 1117 | + | gap: 7px; | |
| 1118 | + | font-weight: 400; | |
| 1119 | + | font-size: 13px; | |
| 1120 | + | padding: 2px 0; | |
| 1121 | + | } | |
| 1122 | + | ||
| 1123 | + | .acp-progress-bar { | |
| 1124 | + | height: 10px; | |
| 1125 | + | border-radius: 6px; | |
| 1126 | + | background: var(--acp-line); | |
| 1127 | + | overflow: hidden; | |
| 1128 | + | } | |
| 1129 | + | .acp-progress-fill { | |
| 1130 | + | height: 100%; | |
| 1131 | + | width: 0%; | |
| 1132 | + | background: var(--acp-green); | |
| 1133 | + | transition: width .25s ease; | |
| 1134 | + | } | |
| 1135 | + | .acp-progress-log { | |
| 1136 | + | margin-top: 10px; | |
| 1137 | + | max-height: 200px; | |
| 1138 | + | overflow-y: auto; | |
| 1139 | + | padding: 10px 12px; | |
| 1140 | + | border: 1px solid var(--acp-line); | |
| 1141 | + | border-radius: 6px; | |
| 1142 | + | background: var(--acp-bg-2, rgba(0, 0, 0, .12)); | |
| 1143 | + | font-family: monospace; | |
| 1144 | + | font-size: 12px; | |
| 1145 | + | line-height: 1.6; | |
| 1146 | + | } |
| @@ -0,0 +1,387 @@ | |||
| 1 | + | /* ZnoteX Admin Control Panel - day/night theme, menu search, side sections. */ | |
| 2 | + | (function () { | |
| 3 | + | 'use strict'; | |
| 4 | + | ||
| 5 | + | var root = document.documentElement; | |
| 6 | + | var backdrop = document.getElementById('acpBackdrop'); | |
| 7 | + | var burger = document.getElementById('acpBurger'); | |
| 8 | + | var filter = document.getElementById('acpFilter'); | |
| 9 | + | var nav = document.getElementById('acpNav'); | |
| 10 | + | var themeBtn = document.getElementById('acpTheme'); | |
| 11 | + | var MOBILE = '(max-width: 840px)'; | |
| 12 | + | ||
| 13 | + | function store(key, value) { | |
| 14 | + | try { localStorage.setItem('acp.' + key, value); } catch (e) {} | |
| 15 | + | } | |
| 16 | + | ||
| 17 | + | function isMobile() { | |
| 18 | + | return window.matchMedia(MOBILE).matches; | |
| 19 | + | } | |
| 20 | + | ||
| 21 | + | function openDrawer(open) { | |
| 22 | + | root.classList.toggle('acp-nav-open', open); | |
| 23 | + | if (backdrop) { backdrop.hidden = !open; } | |
| 24 | + | } | |
| 25 | + | ||
| 26 | + | if (burger) { | |
| 27 | + | burger.addEventListener('click', function () { | |
| 28 | + | if (isMobile()) { | |
| 29 | + | openDrawer(!root.classList.contains('acp-nav-open')); | |
| 30 | + | return; | |
| 31 | + | } | |
| 32 | + | ||
| 33 | + | var closed = root.classList.toggle('acp-sidebar-closed'); | |
| 34 | + | store('sidebar_closed', closed ? '1' : '0'); | |
| 35 | + | }); | |
| 36 | + | } | |
| 37 | + | if (backdrop) { | |
| 38 | + | backdrop.addEventListener('click', function () { openDrawer(false); }); | |
| 39 | + | } | |
| 40 | + | document.addEventListener('keydown', function (e) { | |
| 41 | + | if (e.key === 'Escape') { openDrawer(false); } | |
| 42 | + | }); | |
| 43 | + | window.addEventListener('resize', function () { | |
| 44 | + | if (!isMobile()) { openDrawer(false); } | |
| 45 | + | }); | |
| 46 | + | ||
| 47 | + | if (nav) { | |
| 48 | + | Array.prototype.slice.call(nav.querySelectorAll('.acp-nav-group')).forEach(function (group) { | |
| 49 | + | var button = group.querySelector('.acp-nav-group-label'); | |
| 50 | + | var active = group.querySelector('.acp-nav-link.is-active'); | |
| 51 | + | group.classList.toggle('is-open', !!active); | |
| 52 | + | if (!active && group === nav.querySelector('.acp-nav-group')) { | |
| 53 | + | group.classList.add('is-open'); | |
| 54 | + | } | |
| 55 | + | if (button) { | |
| 56 | + | button.setAttribute('aria-expanded', group.classList.contains('is-open') ? 'true' : 'false'); | |
| 57 | + | button.addEventListener('click', function () { | |
| 58 | + | var open = group.classList.toggle('is-open'); | |
| 59 | + | button.setAttribute('aria-expanded', open ? 'true' : 'false'); | |
| 60 | + | }); | |
| 61 | + | } | |
| 62 | + | }); | |
| 63 | + | ||
| 64 | + | // Same collapse behaviour, one level down: a plugin's own sub-list of | |
| 65 | + | // pages inside a group. Already open when one of its pages is the | |
| 66 | + | // current one (server-rendered with is-open), closed otherwise. | |
| 67 | + | Array.prototype.slice.call(nav.querySelectorAll('.acp-nav-plugin')).forEach(function (cluster) { | |
| 68 | + | var button = cluster.querySelector('.acp-nav-plugin-label'); | |
| 69 | + | if (!button) { return; } | |
| 70 | + | button.addEventListener('click', function () { | |
| 71 | + | var open = cluster.classList.toggle('is-open'); | |
| 72 | + | button.setAttribute('aria-expanded', open ? 'true' : 'false'); | |
| 73 | + | }); | |
| 74 | + | }); | |
| 75 | + | } | |
| 76 | + | ||
| 77 | + | if (filter && nav) { | |
| 78 | + | var links = Array.prototype.slice.call(nav.querySelectorAll('.acp-nav-link')); | |
| 79 | + | var clusters = Array.prototype.slice.call(nav.querySelectorAll('.acp-nav-plugin')); | |
| 80 | + | var groups = Array.prototype.slice.call(nav.querySelectorAll('.acp-nav-group')); | |
| 81 | + | var noMatch = nav.querySelector('.acp-nav-nomatch'); | |
| 82 | + | ||
| 83 | + | function applyFilter() { | |
| 84 | + | var q = filter.value.trim().toLowerCase(); | |
| 85 | + | var hits = 0; | |
| 86 | + | ||
| 87 | + | links.forEach(function (link) { | |
| 88 | + | var match = q === '' || (link.getAttribute('data-title') || '').indexOf(q) !== -1; | |
| 89 | + | link.parentNode.hidden = !match; | |
| 90 | + | if (match) { hits++; } | |
| 91 | + | }); | |
| 92 | + | ||
| 93 | + | // A plugin's own <li> never matches .acp-nav-link (it is the | |
| 94 | + | // cluster wrapper, not a page), so it needs its own visibility | |
| 95 | + | // pass based on whether any page inside it just matched above. | |
| 96 | + | clusters.forEach(function (cluster) { | |
| 97 | + | var visible = cluster.querySelectorAll('.acp-nav-link:not([hidden])').length > 0; | |
| 98 | + | cluster.hidden = !visible; | |
| 99 | + | if (q !== '' && visible) { | |
| 100 | + | cluster.classList.add('is-open'); | |
| 101 | + | var pbutton = cluster.querySelector('.acp-nav-plugin-label'); | |
| 102 | + | if (pbutton) { pbutton.setAttribute('aria-expanded', 'true'); } | |
| 103 | + | } | |
| 104 | + | }); | |
| 105 | + | ||
| 106 | + | groups.forEach(function (group) { | |
| 107 | + | var visible = group.querySelectorAll('li:not([hidden])').length > 0; | |
| 108 | + | group.hidden = !visible; | |
| 109 | + | if (q !== '' && visible) { | |
| 110 | + | group.classList.add('is-open'); | |
| 111 | + | var button = group.querySelector('.acp-nav-group-label'); | |
| 112 | + | if (button) { button.setAttribute('aria-expanded', 'true'); } | |
| 113 | + | } | |
| 114 | + | }); | |
| 115 | + | ||
| 116 | + | if (noMatch) { noMatch.hidden = hits > 0; } | |
| 117 | + | } | |
| 118 | + | ||
| 119 | + | filter.addEventListener('input', applyFilter); | |
| 120 | + | filter.addEventListener('keydown', function (e) { | |
| 121 | + | if (e.key === 'Escape') { | |
| 122 | + | filter.value = ''; | |
| 123 | + | applyFilter(); | |
| 124 | + | } | |
| 125 | + | if (e.key === 'Enter') { | |
| 126 | + | var first = nav.querySelector('li:not([hidden]) .acp-nav-link'); | |
| 127 | + | if (first) { window.location.href = first.href; } | |
| 128 | + | } | |
| 129 | + | }); | |
| 130 | + | } | |
| 131 | + | ||
| 132 | + | function syncTheme() { | |
| 133 | + | if (!themeBtn) { return; } | |
| 134 | + | var dark = root.getAttribute('data-acp-theme') === 'dark'; | |
| 135 | + | var icon = themeBtn.querySelector('.fa'); | |
| 136 | + | var label = themeBtn.querySelector('span'); | |
| 137 | + | if (icon) { icon.className = 'fa ' + (dark ? 'fa-sun-o' : 'fa-moon-o'); } | |
| 138 | + | if (label) { label.textContent = dark ? 'Day' : 'Night'; } | |
| 139 | + | themeBtn.title = dark ? 'Switch to day mode' : 'Switch to night mode'; | |
| 140 | + | } | |
| 141 | + | ||
| 142 | + | if (themeBtn) { | |
| 143 | + | themeBtn.addEventListener('click', function () { | |
| 144 | + | var dark = root.getAttribute('data-acp-theme') === 'dark'; | |
| 145 | + | root.setAttribute('data-acp-theme', dark ? 'light' : 'dark'); | |
| 146 | + | store('theme', dark ? 'light' : 'dark'); | |
| 147 | + | syncTheme(); | |
| 148 | + | }); | |
| 149 | + | syncTheme(); | |
| 150 | + | } | |
| 151 | + | ||
| 152 | + | var shopPreview = document.getElementById('shopOfferPreview'); | |
| 153 | + | var shopType = document.getElementById('type'); | |
| 154 | + | var shopItem = document.getElementById('itemid'); | |
| 155 | + | var shopCount = document.getElementById('count'); | |
| 156 | + | ||
| 157 | + | if (shopPreview && shopType && shopItem && shopCount) { | |
| 158 | + | function image(src, className) { | |
| 159 | + | var img = document.createElement('img'); | |
| 160 | + | img.src = src; | |
| 161 | + | img.className = className; | |
| 162 | + | img.alt = ''; | |
| 163 | + | return img; | |
| 164 | + | } | |
| 165 | + | ||
| 166 | + | function outfitUrl(outfitId, mountId) { | |
| 167 | + | var server = shopPreview.getAttribute('data-outfit-server') || ''; | |
| 168 | + | var count = parseInt(shopCount.value, 10) || 0; | |
| 169 | + | if (!server || !outfitId) { return ''; } | |
| 170 | + | ||
| 171 | + | var url = server + '?id=' + encodeURIComponent(outfitId) | |
| 172 | + | + '&addons=' + encodeURIComponent(count) | |
| 173 | + | + '&head=78&body=68&legs=58&feet=76&direction=2'; | |
| 174 | + | ||
| 175 | + | if (mountId) { | |
| 176 | + | url += '&mount=' + encodeURIComponent(mountId); | |
| 177 | + | } | |
| 178 | + | ||
| 179 | + | return url; | |
| 180 | + | } | |
| 181 | + | ||
| 182 | + | function updateShopPreview() { | |
| 183 | + | var type = parseInt(shopType.value, 10) || 0; | |
| 184 | + | var raw = shopItem.value.trim(); | |
| 185 | + | var template = shopPreview.getAttribute('data-item-template') || ''; | |
| 186 | + | ||
| 187 | + | shopPreview.innerHTML = ''; | |
| 188 | + | ||
| 189 | + | if (type === 5) { | |
| 190 | + | var pair = raw.match(/^\s*(\d+)\s*,\s*(\d+)\s*$/); | |
| 191 | + | if (pair) { | |
| 192 | + | shopPreview.appendChild(image(outfitUrl(pair[1], ''), 'acp-shop-preview-img')); | |
| 193 | + | shopPreview.appendChild(image(outfitUrl(pair[2], ''), 'acp-shop-preview-img')); | |
| 194 | + | return; | |
| 195 | + | } | |
| 196 | + | } else if (type === 6) { | |
| 197 | + | if (/^\d+$/.test(raw)) { | |
| 198 | + | shopPreview.appendChild(image(outfitUrl(128, raw), 'acp-shop-preview-img')); | |
| 199 | + | return; | |
| 200 | + | } | |
| 201 | + | } else if (/^\d+$/.test(raw) && template) { | |
| 202 | + | shopPreview.appendChild(image(template.replace('{id}', raw), 'acp-shop-preview-item')); | |
| 203 | + | return; | |
| 204 | + | } | |
| 205 | + | ||
| 206 | + | var muted = document.createElement('span'); | |
| 207 | + | muted.className = 'is-muted'; | |
| 208 | + | muted.appendChild(document.createTextNode('Preview')); | |
| 209 | + | shopPreview.appendChild(muted); | |
| 210 | + | } | |
| 211 | + | ||
| 212 | + | shopType.addEventListener('change', updateShopPreview); | |
| 213 | + | shopItem.addEventListener('input', updateShopPreview); | |
| 214 | + | shopCount.addEventListener('input', updateShopPreview); | |
| 215 | + | updateShopPreview(); | |
| 216 | + | } | |
| 217 | + | ||
| 218 | + | document.addEventListener('submit', function (e) { | |
| 219 | + | var form = e.target; | |
| 220 | + | var message = form.getAttribute('data-confirm'); | |
| 221 | + | if (message && !window.confirm(message)) { | |
| 222 | + | e.preventDefault(); | |
| 223 | + | } | |
| 224 | + | }); | |
| 225 | + | })(); | |
| 226 | + | ||
| 227 | + | /* | |
| 228 | + | * Click-to-sort for any <table class="acp-table" data-sortable>. Sorts the | |
| 229 | + | * rows currently in the DOM - on a paginated list that is only the current | |
| 230 | + | * page, which is fine: the point is letting an admin re-order what is on | |
| 231 | + | * screen (highest points first, most recent first), not a full-dataset sort. | |
| 232 | + | */ | |
| 233 | + | (function () { | |
| 234 | + | function cellText(row, index) { | |
| 235 | + | var cell = row.children[index]; | |
| 236 | + | if (!cell) return ''; | |
| 237 | + | return (cell.getAttribute('data-sort-value') || cell.textContent || '').trim(); | |
| 238 | + | } | |
| 239 | + | ||
| 240 | + | function looksNumeric(value) { | |
| 241 | + | return value !== '' && !isNaN(parseFloat(value.replace(/[^0-9.\-]/g, ''))) && /^[\s0-9.,\-]+$/.test(value); | |
| 242 | + | } | |
| 243 | + | ||
| 244 | + | Array.prototype.slice.call(document.querySelectorAll('table.acp-table[data-sortable]')).forEach(function (table) { | |
| 245 | + | var thead = table.querySelector('thead'); | |
| 246 | + | var tbody = table.querySelector('tbody'); | |
| 247 | + | if (!thead || !tbody) return; | |
| 248 | + | ||
| 249 | + | var headers = Array.prototype.slice.call(thead.querySelectorAll('th')); | |
| 250 | + | ||
| 251 | + | headers.forEach(function (th, index) { | |
| 252 | + | if (th.textContent.trim() === '') return; // icon/action-only columns stay unsortable | |
| 253 | + | ||
| 254 | + | th.classList.add('acp-th-sortable'); | |
| 255 | + | th.setAttribute('role', 'button'); | |
| 256 | + | th.setAttribute('tabindex', '0'); | |
| 257 | + | ||
| 258 | + | var sort = function () { | |
| 259 | + | var dir = th.getAttribute('data-sort-dir') === 'asc' ? 'desc' : 'asc'; | |
| 260 | + | headers.forEach(function (h) { | |
| 261 | + | h.removeAttribute('data-sort-dir'); | |
| 262 | + | h.classList.remove('is-sorted-asc', 'is-sorted-desc'); | |
| 263 | + | }); | |
| 264 | + | th.setAttribute('data-sort-dir', dir); | |
| 265 | + | th.classList.add(dir === 'asc' ? 'is-sorted-asc' : 'is-sorted-desc'); | |
| 266 | + | ||
| 267 | + | var rows = Array.prototype.slice.call(tbody.querySelectorAll(':scope > tr')); | |
| 268 | + | var numeric = rows.length > 0 && looksNumeric(cellText(rows[0], index)); | |
| 269 | + | ||
| 270 | + | rows.sort(function (a, b) { | |
| 271 | + | var av = cellText(a, index); | |
| 272 | + | var bv = cellText(b, index); | |
| 273 | + | var cmp; | |
| 274 | + | if (numeric) { | |
| 275 | + | cmp = (parseFloat(av.replace(/[^0-9.\-]/g, '')) || 0) - (parseFloat(bv.replace(/[^0-9.\-]/g, '')) || 0); | |
| 276 | + | } else { | |
| 277 | + | cmp = av.localeCompare(bv, undefined, { sensitivity: 'base', numeric: true }); | |
| 278 | + | } | |
| 279 | + | return dir === 'asc' ? cmp : -cmp; | |
| 280 | + | }); | |
| 281 | + | ||
| 282 | + | rows.forEach(function (row) { tbody.appendChild(row); }); | |
| 283 | + | }; | |
| 284 | + | ||
| 285 | + | th.addEventListener('click', sort); | |
| 286 | + | th.addEventListener('keydown', function (e) { | |
| 287 | + | if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); sort(); } | |
| 288 | + | }); | |
| 289 | + | }); | |
| 290 | + | }); | |
| 291 | + | })(); | |
| 292 | + | ||
| 293 | + | /* | |
| 294 | + | * Client-side row filter for small lists (plugins, shop offers - anything | |
| 295 | + | * that is already fully rendered on the page, not a paginated server query). | |
| 296 | + | * Usage: <input data-acp-search-input="tableId"> filters | |
| 297 | + | * #tableId tbody tr[data-acp-search] by substring match, and optionally | |
| 298 | + | * updates a live count in [data-acp-search-count="tableId"]. | |
| 299 | + | */ | |
| 300 | + | (function () { | |
| 301 | + | Array.prototype.slice.call(document.querySelectorAll('[data-acp-search-input]')).forEach(function (input) { | |
| 302 | + | var tableId = input.getAttribute('data-acp-search-input'); | |
| 303 | + | var table = document.getElementById(tableId); | |
| 304 | + | if (!table) return; | |
| 305 | + | ||
| 306 | + | var rows = Array.prototype.slice.call(table.querySelectorAll('tbody tr[data-acp-search]')); | |
| 307 | + | var count = document.querySelector('[data-acp-search-count="' + tableId + '"]'); | |
| 308 | + | ||
| 309 | + | input.addEventListener('keyup', function () { | |
| 310 | + | var needle = input.value.trim().toLowerCase(); | |
| 311 | + | var shown = 0; | |
| 312 | + | rows.forEach(function (row) { | |
| 313 | + | var match = needle === '' || (row.getAttribute('data-acp-search') || '').indexOf(needle) !== -1; | |
| 314 | + | row.hidden = !match; | |
| 315 | + | if (match) shown++; | |
| 316 | + | }); | |
| 317 | + | if (count) count.textContent = needle === '' ? '' : (shown + ' / ' + rows.length); | |
| 318 | + | }); | |
| 319 | + | }); | |
| 320 | + | })(); | |
| 321 | + | ||
| 322 | + | /* | |
| 323 | + | * Dynamic add/remove-row tables: any element with data-acp-table-add="key" | |
| 324 | + | * clones the row template registered as data-acp-table-template="key" into | |
| 325 | + | * the matching [data-acp-table="key"] container; data-acp-table-remove | |
| 326 | + | * removes its own row. Shared by settings.php's 'table' schema fields and | |
| 327 | + | * the serverdata single-record editors (items/creatures attribute rows). | |
| 328 | + | */ | |
| 329 | + | (function () { | |
| 330 | + | document.addEventListener('click', function (e) { | |
| 331 | + | var addBtn = e.target.closest('[data-acp-table-add]'); | |
| 332 | + | if (addBtn) { | |
| 333 | + | var key = addBtn.getAttribute('data-acp-table-add'); | |
| 334 | + | var container = document.querySelector('[data-acp-table="' + key + '"]'); | |
| 335 | + | var template = document.querySelector('template[data-acp-table-template="' + key + '"]'); | |
| 336 | + | if (!container || !template) return; | |
| 337 | + | var body = container.querySelector('[data-acp-table-body]') || container; | |
| 338 | + | // <tr> fragments only parse correctly inside a <tbody> wrapper; anything | |
| 339 | + | // else (the permissions table's plain <div> account blocks) parses fine | |
| 340 | + | // in a generic <div>. | |
| 341 | + | var wrapper = document.createElement(body.tagName === 'TBODY' ? 'tbody' : 'div'); | |
| 342 | + | var nextIndex = body.children.length; | |
| 343 | + | var html = template.innerHTML.split('__ROWIDX__').join(String(nextIndex)); | |
| 344 | + | wrapper.innerHTML = html; | |
| 345 | + | body.appendChild(wrapper.firstElementChild); | |
| 346 | + | return; | |
| 347 | + | } | |
| 348 | + | ||
| 349 | + | var removeBtn = e.target.closest('[data-acp-table-remove]'); | |
| 350 | + | if (removeBtn) { | |
| 351 | + | var row = removeBtn.closest('tr, .acp-perm-account'); | |
| 352 | + | if (row) row.remove(); | |
| 353 | + | } | |
| 354 | + | }); | |
| 355 | + | })(); | |
| 356 | + | ||
| 357 | + | /* Ctrl+K / Cmd+K jumps focus to the top-bar search, from anywhere in the panel. */ | |
| 358 | + | (function () { | |
| 359 | + | document.addEventListener('keydown', function (e) { | |
| 360 | + | if (!(e.ctrlKey || e.metaKey) || e.key.toLowerCase() !== 'k') return; | |
| 361 | + | var input = document.getElementById('acpTopSearch'); | |
| 362 | + | if (!input) return; | |
| 363 | + | e.preventDefault(); | |
| 364 | + | input.focus(); | |
| 365 | + | input.select(); | |
| 366 | + | }); | |
| 367 | + | })(); | |
| 368 | + | ||
| 369 | + | /* Arriving from search: highlight the field the anchor points at. */ | |
| 370 | + | (function () { | |
| 371 | + | var id = (window.location.hash || '').replace('#', ''); | |
| 372 | + | if (!id) return; | |
| 373 | + | ||
| 374 | + | var el = document.getElementById(id); | |
| 375 | + | if (!el) return; | |
| 376 | + | ||
| 377 | + | var field = el.closest ? el.closest('.acp-field') : null; | |
| 378 | + | var target = field || el; | |
| 379 | + | ||
| 380 | + | target.classList.add('acp-field--found'); | |
| 381 | + | setTimeout(function () { target.classList.remove('acp-field--found'); }, 2600); | |
| 382 | + | ||
| 383 | + | setTimeout(function () { | |
| 384 | + | target.scrollIntoView({ behavior: 'smooth', block: 'center' }); | |
| 385 | + | if (el.focus && el.type !== 'checkbox') { try { el.focus({ preventScroll: true }); } catch (e) {} } | |
| 386 | + | }, 60); | |
| 387 | + | })(); |
| @@ -0,0 +1,741 @@ | |||
| 1 | + | <?php | |
| 2 | + | /** | |
| 3 | + | * ZnoteX Admin Control Panel - shared runtime. | |
| 4 | + | */ | |
| 5 | + | ||
| 6 | + | if (!defined('ACP_ROOT')) { | |
| 7 | + | http_response_code(403); | |
| 8 | + | die('Direct access denied.'); | |
| 9 | + | } | |
| 10 | + | ||
| 11 | + | if (!function_exists('h')) { | |
| 12 | + | function h($s): string { | |
| 13 | + | return htmlspecialchars((string)($s ?? ''), ENT_QUOTES, 'UTF-8'); | |
| 14 | + | } | |
| 15 | + | } | |
| 16 | + | if (!function_exists('intv')) { | |
| 17 | + | function intv($v): int { | |
| 18 | + | return is_numeric($v) ? (int)$v : 0; | |
| 19 | + | } | |
| 20 | + | } | |
| 21 | + | if (!function_exists('esc')) { | |
| 22 | + | function esc($s): string { | |
| 23 | + | return mysql_znote_escape_string((string)($s ?? '')); | |
| 24 | + | } | |
| 25 | + | } | |
| 26 | + | ||
| 27 | + | // Scheduled maintenance (engine/function/scheduler.php) normally runs off | |
| 28 | + | // public-page traffic (page.footer) - the admin panel never fires that hook, | |
| 29 | + | // so a site with only admin visitors still needs this call to run its due | |
| 30 | + | // tasks. | |
| 31 | + | if (function_exists('scheduler_tick')) { | |
| 32 | + | scheduler_tick(); | |
| 33 | + | } | |
| 34 | + | ||
| 35 | + | function acp_site(string $path = ''): string { | |
| 36 | + | return '../' . ltrim($path, '/'); | |
| 37 | + | } | |
| 38 | + | ||
| 39 | + | function acp_url(string $module = 'dashboard', array $params = []): string { | |
| 40 | + | return 'index.php?' . http_build_query(array_merge(['p' => $module], $params)); | |
| 41 | + | } | |
| 42 | + | ||
| 43 | + | /** | |
| 44 | + | * Every scoped account gets Dashboard and Search for free, whatever else it | |
| 45 | + | * was granted - otherwise an account limited to, say, just "news" would land | |
| 46 | + | * on an access-denied wall the moment it logs in, since dashboard is the | |
| 47 | + | * default page. | |
| 48 | + | */ | |
| 49 | + | function acp_module_free_for_any_role(): array { | |
| 50 | + | return array('dashboard', 'search'); | |
| 51 | + | } | |
| 52 | + | ||
| 53 | + | function acp_can_module(string $module, ?array $account = null): bool { | |
| 54 | + | $account = $account ?? ($GLOBALS['user_data'] ?? null); | |
| 55 | + | $roles = admin_roles($account); | |
| 56 | + | if (in_array('owner', $roles, true)) return true; | |
| 57 | + | if ($roles === array()) return false; | |
| 58 | + | if (in_array($module, acp_module_free_for_any_role(), true)) return true; | |
| 59 | + | return in_array(strtolower($module), $roles, true); | |
| 60 | + | } | |
| 61 | + | ||
| 62 | + | /** Literal Owner only - never satisfied by a granted module, even 'settings'. */ | |
| 63 | + | function acp_is_owner(?array $account = null): bool { | |
| 64 | + | $account = $account ?? ($GLOBALS['user_data'] ?? null); | |
| 65 | + | return in_array('owner', admin_roles($account), true); | |
| 66 | + | } | |
| 67 | + | ||
| 68 | + | function acp_editor_assets(): void { | |
| 69 | + | static $loaded = false; | |
| 70 | + | if ($loaded) return; | |
| 71 | + | $loaded = true; | |
| 72 | + | $v = '3.2.1'; | |
| 73 | + | $base = '../assets/sceditor/'; | |
| 74 | + | ?> | |
| 75 | + | <link rel="stylesheet" href="<?= $base ?>themes/defaultdark.min.css?v=<?= $v ?>"> | |
| 76 | + | <link rel="stylesheet" href="<?= $base ?>znote-editor-acp.css?v=<?= $v ?>"> | |
| 77 | + | <script src="<?= $base ?>sceditor.min.js?v=<?= $v ?>"></script> | |
| 78 | + | <script src="<?= $base ?>formats/bbcode.min.js?v=<?= $v ?>"></script> | |
| 79 | + | <script src="<?= $base ?>icons/material.min.js?v=<?= $v ?>"></script> | |
| 80 | + | <script src="<?= $base ?>plugins/undo.min.js?v=<?= $v ?>"></script> | |
| 81 | + | <script src="<?= $base ?>plugins/autoyoutube.min.js?v=<?= $v ?>"></script> | |
| 82 | + | <script src="<?= $base ?>znote-editor.js?v=<?= $v ?>"></script> | |
| 83 | + | <?php | |
| 84 | + | } | |
| 85 | + | ||
| 86 | + | /** | |
| 87 | + | * A BBCode editor bound to $name. $maxlength reflects a column limit and is | |
| 88 | + | * shown as a live counter, because BBCode tags count toward it. | |
| 89 | + | */ | |
| 90 | + | function acp_editor(string $name, string $value = '', array $options = []): void { | |
| 91 | + | $height = (int)($options['height'] ?? 260); | |
| 92 | + | $maxlength = (int)($options['maxlength'] ?? 0); | |
| 93 | + | $toolbar = (string)($options['toolbar'] ?? ''); | |
| 94 | + | $note = (string)($options['note'] ?? ''); | |
| 95 | + | ?> | |
| 96 | + | <div class="znote-editor-wrap"> | |
| 97 | + | <textarea class="znote-editor" id="<?= h($name) ?>" name="<?= h($name) ?>" | |
| 98 | + | data-asset-base="../assets/sceditor/" | |
| 99 | + | data-content-css="znote-content-acp.css" | |
| 100 | + | data-height="<?= $height ?>" | |
| 101 | + | <?php if ($maxlength > 0): ?>data-maxlength="<?= $maxlength ?>"<?php endif; ?> | |
| 102 | + | <?php if ($toolbar !== ''): ?>data-toolbar="<?= h($toolbar) ?>"<?php endif; ?>><?= h($value) ?></textarea> | |
| 103 | + | </div> | |
| 104 | + | <?php if ($note !== ''): ?> | |
| 105 | + | <p class="znote-editor-note"><?= h($note) ?></p> | |
| 106 | + | <?php endif; ?> | |
| 107 | + | <?php | |
| 108 | + | acp_editor_assets(); | |
| 109 | + | } | |
| 110 | + | ||
| 111 | + | function acp_color_field(string $name, $value = '', string $placeholder = '', string $style = ''): void { | |
| 112 | + | $styleAttr = $style !== '' ? ' style="' . h($style) . '"' : ''; | |
| 113 | + | ?> | |
| 114 | + | <input class="acp-input" type="text" name="<?= h($name) ?>" value="<?= h($value) ?>" placeholder="<?= h($placeholder) ?>"<?= $styleAttr ?>> | |
| 115 | + | <?php | |
| 116 | + | } | |
| 117 | + | function acp_redirect(string $module = 'dashboard', array $params = []): void { | |
| 118 | + | header('Location: ' . acp_url($module, $params)); | |
| 119 | + | exit; | |
| 120 | + | } | |
| 121 | + | ||
| 122 | + | const ACP_GROUP_ORDER = [ | |
| 123 | + | 'Overview' => 10, | |
| 124 | + | 'Content' => 20, | |
| 125 | + | 'Players' => 30, | |
| 126 | + | 'Server Info' => 40, | |
| 127 | + | 'Economy' => 50, | |
| 128 | + | 'Support' => 60, | |
| 129 | + | 'Operations' => 65, | |
| 130 | + | 'Settings' => 70, | |
| 131 | + | ]; | |
| 132 | + | ||
| 133 | + | function acp_parse_module_header(string $file): array { | |
| 134 | + | $head = (string)file_get_contents($file, false, null, 0, 1500); | |
| 135 | + | $meta = []; | |
| 136 | + | $manifestFile = substr($file, 0, -4) . '.json'; | |
| 137 | + | ||
| 138 | + | if (is_file($manifestFile)) { | |
| 139 | + | $manifest = json_decode((string)file_get_contents($manifestFile), true); | |
| 140 | + | if (is_array($manifest)) { | |
| 141 | + | foreach ($manifest as $key => $value) { | |
| 142 | + | if (is_string($key) && (is_string($value) || is_numeric($value) || is_bool($value))) { | |
| 143 | + | $meta[strtolower($key)] = $value; | |
| 144 | + | } | |
| 145 | + | } | |
| 146 | + | } | |
| 147 | + | } | |
| 148 | + | ||
| 149 | + | if (preg_match('~/\*\*(.*?)\*/~s', $head, $block)) { | |
| 150 | + | foreach (preg_split('~\R~', $block[1]) as $line) { | |
| 151 | + | if (preg_match('~^\s*\*\s*([A-Za-z]+)\s*:\s*(.+?)\s*$~', $line, $kv)) { | |
| 152 | + | $meta[strtolower($kv[1])] = $kv[2]; | |
| 153 | + | } | |
| 154 | + | } | |
| 155 | + | } | |
| 156 | + | ||
| 157 | + | return $meta; | |
| 158 | + | } | |
| 159 | + | ||
| 160 | + | /** Every admin/modules/*.php file, parsed into a nav entry each. */ | |
| 161 | + | function acp_modules_core(): array { | |
| 162 | + | $modules = []; | |
| 163 | + | ||
| 164 | + | foreach (glob(ACP_ROOT . '/modules/*.php') ?: [] as $file) { | |
| 165 | + | $key = basename($file, '.php'); | |
| 166 | + | if ($key === '' || $key[0] === '_') { | |
| 167 | + | continue; | |
| 168 | + | } | |
| 169 | + | ||
| 170 | + | $meta = acp_parse_module_header($file); | |
| 171 | + | $group = $meta['group'] ?? 'Other'; | |
| 172 | + | ||
| 173 | + | $modules[$key] = [ | |
| 174 | + | 'key' => $key, | |
| 175 | + | 'file' => $file, | |
| 176 | + | 'title' => t_default('acp.mod.' . $key . '.title', $meta['title'] ?? ucwords(str_replace('_', ' ', $key))), | |
| 177 | + | 'icon' => $meta['icon'] ?? 'fa-square-o', | |
| 178 | + | 'group' => t_default('acp.group.' . $group, $group), | |
| 179 | + | 'order' => isset($meta['order']) ? (int)$meta['order'] : 100, | |
| 180 | + | 'description' => t_default('acp.mod.' . $key . '.desc', $meta['description'] ?? ''), | |
| 181 | + | 'url' => $meta['url'] ?? null, | |
| 182 | + | 'target' => $meta['target'] ?? null, | |
| 183 | + | 'hidden' => !empty($meta['hidden']) && strtolower((string)$meta['hidden']) !== 'false', | |
| 184 | + | ]; | |
| 185 | + | } | |
| 186 | + | ||
| 187 | + | return $modules; | |
| 188 | + | } | |
| 189 | + | ||
| 190 | + | /** | |
| 191 | + | * Modules contributed by enabled plugins, listed beside the built-in ones. | |
| 192 | + | * Their key is prefixed with the plugin name, so a plugin can never shadow a | |
| 193 | + | * core module by choosing the same filename. | |
| 194 | + | */ | |
| 195 | + | function acp_modules_from_plugins(): array { | |
| 196 | + | $modules = []; | |
| 197 | + | ||
| 198 | + | if (function_exists('znote_plugin_admin_modules')) { | |
| 199 | + | foreach (znote_plugin_admin_modules() as $key => $file) { | |
| 200 | + | $meta = acp_parse_module_header($file); | |
| 201 | + | ||
| 202 | + | $modules[$key] = array( | |
| 203 | + | 'key' => $key, | |
| 204 | + | 'file' => $file, | |
| 205 | + | 'title' => $meta['title'] ?? ucwords(str_replace('_', ' ', $key)), | |
| 206 | + | 'icon' => $meta['icon'] ?? 'fa-plug', | |
| 207 | + | 'group' => $meta['group'] ?? 'Settings', | |
| 208 | + | 'order' => isset($meta['order']) ? (int)$meta['order'] : 100, | |
| 209 | + | 'description' => $meta['description'] ?? '', | |
| 210 | + | 'url' => $meta['url'] ?? null, | |
| 211 | + | 'target' => $meta['target'] ?? null, | |
| 212 | + | ); | |
| 213 | + | } | |
| 214 | + | } | |
| 215 | + | ||
| 216 | + | return $modules; | |
| 217 | + | } | |
| 218 | + | ||
| 219 | + | /** | |
| 220 | + | * A plugin's generic settings.json config used to only be reachable from its | |
| 221 | + | * row on the Plugins list page, off on its own away from the same plugin's | |
| 222 | + | * custom admin pages (Slots, Storage Watch, ...) that already show up under | |
| 223 | + | * "Installed Plugins". Listing it right there too - same group, same place - | |
| 224 | + | * means everything about one plugin lives in one spot instead of two. | |
| 225 | + | * $existingKeys is what acp_modules_core()/acp_modules_from_plugins() already | |
| 226 | + | * produced, so a plugin that names its own page "settings" is never clobbered. | |
| 227 | + | */ | |
| 228 | + | function acp_modules_plugin_settings(array $existingKeys): array { | |
| 229 | + | $modules = []; | |
| 230 | + | ||
| 231 | + | if (function_exists('znote_plugins') && function_exists('znote_plugin_settings_has')) { | |
| 232 | + | foreach (znote_plugins() as $name => $plugin) { | |
| 233 | + | if (!$plugin['enabled'] || !$plugin['installed'] || !$plugin['compatible'] || !znote_plugin_settings_has($name)) { | |
| 234 | + | continue; | |
| 235 | + | } | |
| 236 | + | ||
| 237 | + | $key = $name . '__settings'; | |
| 238 | + | if (isset($existingKeys[$key])) { | |
| 239 | + | continue; | |
| 240 | + | } | |
| 241 | + | ||
| 242 | + | $modules[$key] = array( | |
| 243 | + | 'key' => $key, | |
| 244 | + | 'file' => ACP_ROOT . '/modules/plugin_settings.php', | |
| 245 | + | 'title' => (string)($plugin['name'] ?? ucwords(str_replace('_', ' ', $name))) . ' Settings', | |
| 246 | + | 'icon' => 'fa-sliders', | |
| 247 | + | 'group' => 'Installed Plugins', | |
| 248 | + | 'order' => 5, | |
| 249 | + | 'description' => t_default('acp.mod.plugin_settings.desc', "This plugin's own configuration fields."), | |
| 250 | + | 'url' => acp_url('plugin_settings', array('plugin' => $name)), | |
| 251 | + | 'target' => null, | |
| 252 | + | ); | |
| 253 | + | } | |
| 254 | + | } | |
| 255 | + | ||
| 256 | + | return $modules; | |
| 257 | + | } | |
| 258 | + | ||
| 259 | + | function acp_modules(): array { | |
| 260 | + | static $modules = null; | |
| 261 | + | if ($modules !== null) { | |
| 262 | + | return $modules; | |
| 263 | + | } | |
| 264 | + | ||
| 265 | + | $modules = acp_modules_core() + acp_modules_from_plugins(); | |
| 266 | + | $modules += acp_modules_plugin_settings($modules); | |
| 267 | + | ||
| 268 | + | uasort($modules, static function (array $a, array $b): int { | |
| 269 | + | $ga = ACP_GROUP_ORDER[$a['group']] ?? 900; | |
| 270 | + | $gb = ACP_GROUP_ORDER[$b['group']] ?? 900; | |
| 271 | + | ||
| 272 | + | return [$ga, $a['order'], strtolower($a['title'])] | |
| 273 | + | <=> [$gb, $b['order'], strtolower($b['title'])]; | |
| 274 | + | }); | |
| 275 | + | ||
| 276 | + | return $modules; | |
| 277 | + | } | |
| 278 | + | ||
| 279 | + | function acp_nav_groups(): array { | |
| 280 | + | $groups = []; | |
| 281 | + | foreach (acp_modules() as $key => $module) { | |
| 282 | + | if (!empty($module['hidden']) || !acp_can_module($key)) { | |
| 283 | + | continue; | |
| 284 | + | } | |
| 285 | + | $groups[$module['group']][$key] = $module; | |
| 286 | + | } | |
| 287 | + | return $groups; | |
| 288 | + | } | |
| 289 | + | ||
| 290 | + | /** | |
| 291 | + | * Splits one group's modules into standalone links and per-plugin clusters, | |
| 292 | + | * so a sidebar group with several plugins each contributing 2-3 pages shows | |
| 293 | + | * one row per plugin (expanding to its pages) instead of every page flattened | |
| 294 | + | * into the group - the more plugins are installed, the more this matters. | |
| 295 | + | * | |
| 296 | + | * A plugin-contributed key is always "<plugin>__<page>" (see | |
| 297 | + | * znote_plugin_admin_modules() and the settings.json injection above); core | |
| 298 | + | * modules never contain "__", so they always end up in 'plain'. | |
| 299 | + | */ | |
| 300 | + | function acp_nav_cluster(array $groupModules): array { | |
| 301 | + | $plain = []; | |
| 302 | + | $plugins = []; | |
| 303 | + | ||
| 304 | + | foreach ($groupModules as $key => $module) { | |
| 305 | + | $sep = strpos($key, '__'); | |
| 306 | + | if ($sep === false) { | |
| 307 | + | $plain[$key] = $module; | |
| 308 | + | continue; | |
| 309 | + | } | |
| 310 | + | ||
| 311 | + | $pluginKey = substr($key, 0, $sep); | |
| 312 | + | if (!isset($plugins[$pluginKey])) { | |
| 313 | + | $manifest = function_exists('znote_plugins') ? (znote_plugins()[$pluginKey] ?? null) : null; | |
| 314 | + | $plugins[$pluginKey] = [ | |
| 315 | + | 'label' => (string)($manifest['name'] ?? ucwords(str_replace('_', ' ', $pluginKey))), | |
| 316 | + | 'items' => [], | |
| 317 | + | ]; | |
| 318 | + | } | |
| 319 | + | ||
| 320 | + | $plugins[$pluginKey]['items'][$key] = $module; | |
| 321 | + | } | |
| 322 | + | ||
| 323 | + | // A plugin with only one page gains nothing from being nested - it is | |
| 324 | + | // the same click count either way, just with an extra level in between - | |
| 325 | + | // so it goes back to a plain, top-level link instead. | |
| 326 | + | foreach ($plugins as $pluginKey => $cluster) { | |
| 327 | + | if (count($cluster['items']) === 1) { | |
| 328 | + | $plain += $cluster['items']; | |
| 329 | + | unset($plugins[$pluginKey]); | |
| 330 | + | } | |
| 331 | + | } | |
| 332 | + | ||
| 333 | + | // "Build Simulator Slots" under the "Build Simulator" cluster reads | |
| 334 | + | // better as just "Slots" - only strips the prefix when it is actually | |
| 335 | + | // there, so a plugin with differently-worded titles is untouched. | |
| 336 | + | foreach ($plugins as $pluginKey => &$cluster) { | |
| 337 | + | $prefix = $cluster['label'] . ' '; | |
| 338 | + | foreach ($cluster['items'] as &$module) { | |
| 339 | + | if (stripos($module['title'], $prefix) === 0) { | |
| 340 | + | $module['title'] = substr($module['title'], strlen($prefix)); | |
| 341 | + | } | |
| 342 | + | } | |
| 343 | + | unset($module); | |
| 344 | + | } | |
| 345 | + | unset($cluster); | |
| 346 | + | ||
| 347 | + | return ['plain' => $plain, 'plugins' => $plugins]; | |
| 348 | + | } | |
| 349 | + | ||
| 350 | + | /** | |
| 351 | + | * Everything the top-bar search can find: the modules themselves and every | |
| 352 | + | * field they expose. The point is that "download" reaches the client URL | |
| 353 | + | * fields under Settings, not just a module whose title happens to match. | |
| 354 | + | * | |
| 355 | + | * The schemas are read from _partials/, which only return arrays - including | |
| 356 | + | * the module itself would run its POST handling and print its page. | |
| 357 | + | */ | |
| 358 | + | function acp_search_index_modules(): array { | |
| 359 | + | $entries = []; | |
| 360 | + | foreach (acp_modules() as $key => $module) { | |
| 361 | + | if (!empty($module['hidden']) || !acp_can_module($key)) { | |
| 362 | + | continue; | |
| 363 | + | } | |
| 364 | + | $entries[] = [ | |
| 365 | + | 'kind' => 'page', | |
| 366 | + | 'title' => $module['title'], | |
| 367 | + | 'context' => $module['group'], | |
| 368 | + | 'detail' => $module['description'], | |
| 369 | + | 'url' => $module['url'] ?: acp_url($key), | |
| 370 | + | 'icon' => $module['icon'], | |
| 371 | + | 'haystack' => strtolower($key . ' ' . $module['title'] . ' ' . $module['group'] . ' ' . $module['description']), | |
| 372 | + | ]; | |
| 373 | + | } | |
| 374 | + | return $entries; | |
| 375 | + | } | |
| 376 | + | ||
| 377 | + | function acp_search_index_settings(): array { | |
| 378 | + | $entries = []; | |
| 379 | + | $settings = ACP_ROOT . '/modules/_partials/settings_schema.php'; | |
| 380 | + | if (acp_can_module('settings') && is_file($settings)) { | |
| 381 | + | foreach ((array)require $settings as $section => $fields) { | |
| 382 | + | foreach ((array)$fields as $key => $field) { | |
| 383 | + | $entries[] = [ | |
| 384 | + | 'kind' => 'setting', | |
| 385 | + | 'title' => $field['label'] ?? $key, | |
| 386 | + | 'context' => 'Settings › ' . $section, | |
| 387 | + | 'detail' => $field['help'] ?? '', | |
| 388 | + | 'url' => acp_url('settings') . '#set_' . $key, | |
| 389 | + | 'icon' => 'fa-cogs', | |
| 390 | + | 'haystack' => strtolower($key . ' ' . ($field['label'] ?? '') . ' ' . ($field['help'] ?? '') . ' ' . $section), | |
| 391 | + | ]; | |
| 392 | + | } | |
| 393 | + | } | |
| 394 | + | } | |
| 395 | + | return $entries; | |
| 396 | + | } | |
| 397 | + | ||
| 398 | + | function acp_search_index_payments(): array { | |
| 399 | + | $entries = []; | |
| 400 | + | $payments = ACP_ROOT . '/modules/_partials/payments_schema.php'; | |
| 401 | + | if (acp_can_module('payments') && is_file($payments)) { | |
| 402 | + | foreach ((array)require $payments as $groupName => $group) { | |
| 403 | + | foreach ((array)($group['fields'] ?? []) as $key => $field) { | |
| 404 | + | $entries[] = [ | |
| 405 | + | 'kind' => 'setting', | |
| 406 | + | 'title' => $field['label'] ?? $key, | |
| 407 | + | 'context' => 'Payments › ' . $groupName, | |
| 408 | + | 'detail' => $field['help'] ?? '', | |
| 409 | + | 'url' => acp_url('payments') . '#pay_' . $key, | |
| 410 | + | 'icon' => 'fa-credit-card', | |
| 411 | + | 'haystack' => strtolower($key . ' ' . ($field['label'] ?? '') . ' ' . ($field['help'] ?? '') . ' ' . $groupName), | |
| 412 | + | ]; | |
| 413 | + | } | |
| 414 | + | } | |
| 415 | + | } | |
| 416 | + | return $entries; | |
| 417 | + | } | |
| 418 | + | ||
| 419 | + | function acp_search_index_layouts(): array { | |
| 420 | + | $entries = []; | |
| 421 | + | if (acp_can_module('layouts') && function_exists('theme_list') && function_exists('theme_options')) { | |
| 422 | + | foreach (theme_list() as $themeKey => $theme) { | |
| 423 | + | foreach (theme_options($themeKey) as $optKey => $opt) { | |
| 424 | + | $entries[] = [ | |
| 425 | + | 'kind' => 'setting', | |
| 426 | + | 'title' => $opt['label'] ?? $optKey, | |
| 427 | + | 'context' => 'Layout › ' . ($theme['name'] ?? $themeKey) . ' options', | |
| 428 | + | 'detail' => $opt['help'] ?? '', | |
| 429 | + | 'url' => acp_url('layouts', ['options' => $themeKey]), | |
| 430 | + | 'icon' => 'fa-paint-brush', | |
| 431 | + | 'haystack' => strtolower($optKey . ' ' . ($opt['label'] ?? '') . ' ' . ($opt['help'] ?? '') . ' ' . $themeKey), | |
| 432 | + | ]; | |
| 433 | + | } | |
| 434 | + | } | |
| 435 | + | } | |
| 436 | + | return $entries; | |
| 437 | + | } | |
| 438 | + | ||
| 439 | + | function acp_search_index(): array { | |
| 440 | + | static $index = null; | |
| 441 | + | if ($index !== null) { | |
| 442 | + | return $index; | |
| 443 | + | } | |
| 444 | + | ||
| 445 | + | $index = array_merge( | |
| 446 | + | acp_search_index_modules(), | |
| 447 | + | acp_search_index_settings(), | |
| 448 | + | acp_search_index_payments(), | |
| 449 | + | acp_search_index_layouts() | |
| 450 | + | ); | |
| 451 | + | ||
| 452 | + | return $index; | |
| 453 | + | } | |
| 454 | + | ||
| 455 | + | /** Rank matches: whole-word and title hits first. */ | |
| 456 | + | function acp_search(string $query, int $limit = 40): array { | |
| 457 | + | $query = trim(strtolower($query)); | |
| 458 | + | if ($query === '') { | |
| 459 | + | return []; | |
| 460 | + | } | |
| 461 | + | ||
| 462 | + | $terms = preg_split('/\s+/', $query) ?: [$query]; | |
| 463 | + | $hits = []; | |
| 464 | + | ||
| 465 | + | foreach (acp_search_index() as $row) { | |
| 466 | + | $score = 0; | |
| 467 | + | foreach ($terms as $term) { | |
| 468 | + | if ($term === '' || strpos($row['haystack'], $term) === false) { | |
| 469 | + | $score = 0; | |
| 470 | + | break; | |
| 471 | + | } | |
| 472 | + | $score += 1; | |
| 473 | + | if (strpos(strtolower($row['title']), $term) !== false) { | |
| 474 | + | $score += 3; | |
| 475 | + | } | |
| 476 | + | if (preg_match('/\b' . preg_quote($term, '/') . '\b/', $row['haystack'])) { | |
| 477 | + | $score += 2; | |
| 478 | + | } | |
| 479 | + | } | |
| 480 | + | if ($score > 0) { | |
| 481 | + | $row['score'] = $score + ($row['kind'] === 'page' ? 1 : 0); | |
| 482 | + | $hits[] = $row; | |
| 483 | + | } | |
| 484 | + | } | |
| 485 | + | ||
| 486 | + | usort($hits, static function (array $a, array $b): int { | |
| 487 | + | return $b['score'] <=> $a['score'] ?: strcmp($a['title'], $b['title']); | |
| 488 | + | }); | |
| 489 | + | ||
| 490 | + | return array_slice($hits, 0, $limit); | |
| 491 | + | } | |
| 492 | + | ||
| 493 | + | function acp_badge(string $key): ?int { | |
| 494 | + | $fn = 'acp_badge_' . $key; | |
| 495 | + | if (!function_exists($fn)) { | |
| 496 | + | return null; | |
| 497 | + | } | |
| 498 | + | $count = (int)$fn(); | |
| 499 | + | return $count > 0 ? $count : null; | |
| 500 | + | } | |
| 501 | + | ||
| 502 | + | function acp_count(string $sql, array $params = []): int { | |
| 503 | + | $row = db()->fetchOne($sql, $params); | |
| 504 | + | return is_array($row) && $row ? (int)reset($row) : 0; | |
| 505 | + | } | |
| 506 | + | ||
| 507 | + | function acp_badge_reports(): int { | |
| 508 | + | return acp_count("SELECT COUNT(*) AS `c` FROM `znote_player_reports` WHERE `status` IN (0, 1, 2);"); | |
| 509 | + | } | |
| 510 | + | ||
| 511 | + | function acp_badge_helpdesk(): int { | |
| 512 | + | return acp_count("SELECT COUNT(*) AS `c` FROM `znote_tickets` WHERE `status` <> 'CLOSED';"); | |
| 513 | + | } | |
| 514 | + | ||
| 515 | + | function acp_badge_gallery(): int { | |
| 516 | + | return acp_count("SELECT COUNT(*) AS `c` FROM `znote_images` WHERE `status` = 1;"); | |
| 517 | + | } | |
| 518 | + | ||
| 519 | + | function acp_badge_feedback(): int { | |
| 520 | + | $cache = new Cache('engine/cache/asideFeedbackCount'); | |
| 521 | + | if (!$cache->hasExpired()) { | |
| 522 | + | return (int)$cache->load(); | |
| 523 | + | } | |
| 524 | + | ||
| 525 | + | $new = 0; | |
| 526 | + | $threads = db()->fetchAll("SELECT `id`, `player_id` FROM `znote_forum_threads` WHERE `forum_id` = 4 AND `closed` = 0;"); | |
| 527 | + | ||
| 528 | + | if (is_array($threads)) { | |
| 529 | + | $staffIds = []; | |
| 530 | + | $staffs = db()->fetchAll("SELECT `id` FROM `players` WHERE `group_id` > 1;"); | |
| 531 | + | if (is_array($staffs)) { | |
| 532 | + | foreach ($staffs as $staff) { | |
| 533 | + | $staffIds[(int)$staff['id']] = true; | |
| 534 | + | } | |
| 535 | + | } | |
| 536 | + | ||
| 537 | + | foreach ($threads as $thread) { | |
| 538 | + | $answered = false; | |
| 539 | + | $posts = db()->fetchAll("SELECT `id`, `player_id` FROM `znote_forum_posts` WHERE `thread_id` = ?;", [(int)$thread['id']]); | |
| 540 | + | ||
| 541 | + | if (is_array($posts)) { | |
| 542 | + | foreach ($posts as $post) { | |
| 543 | + | if (isset($staffIds[(int)$post['player_id']])) { | |
| 544 | + | $answered = true; | |
| 545 | + | break; | |
| 546 | + | } | |
| 547 | + | } | |
| 548 | + | } | |
| 549 | + | ||
| 550 | + | if (!$answered) { | |
| 551 | + | $new++; | |
| 552 | + | } | |
| 553 | + | } | |
| 554 | + | } | |
| 555 | + | ||
| 556 | + | $cache->setContent($new); | |
| 557 | + | $cache->save(); | |
| 558 | + | ||
| 559 | + | return $new; | |
| 560 | + | } | |
| 561 | + | ||
| 562 | + | function acp_badge_shop_orders(): int { | |
| 563 | + | return acp_count("SELECT COUNT(*) AS `c` FROM `znote_shop_orders`;"); | |
| 564 | + | } | |
| 565 | + | ||
| 566 | + | function acp_flash(string $type, string $message): void { | |
| 567 | + | $_SESSION['acp_flash'][] = ['type' => $type, 'message' => $message]; | |
| 568 | + | } | |
| 569 | + | ||
| 570 | + | function acp_flash_success(string $m): void { acp_flash('success', $m); } | |
| 571 | + | function acp_flash_error(string $m): void { acp_flash('error', $m); } | |
| 572 | + | function acp_flash_info(string $m): void { acp_flash('info', $m); } | |
| 573 | + | ||
| 574 | + | function acp_take_flashes(): array { | |
| 575 | + | $flashes = $_SESSION['acp_flash'] ?? []; | |
| 576 | + | unset($_SESSION['acp_flash']); | |
| 577 | + | return is_array($flashes) ? $flashes : []; | |
| 578 | + | } | |
| 579 | + | ||
| 580 | + | function acp_csrf(): string { | |
| 581 | + | if (empty($_SESSION['acp_csrf'])) { | |
| 582 | + | $_SESSION['acp_csrf'] = bin2hex(random_bytes(16)); | |
| 583 | + | } | |
| 584 | + | return $_SESSION['acp_csrf']; | |
| 585 | + | } | |
| 586 | + | ||
| 587 | + | function acp_csrf_field(): string { | |
| 588 | + | return '<input type="hidden" name="csrf_token" value="' . h(acp_csrf()) . '">'; | |
| 589 | + | } | |
| 590 | + | ||
| 591 | + | function acp_verify_csrf(): bool { | |
| 592 | + | return !empty($_POST['csrf_token']) | |
| 593 | + | && is_string($_POST['csrf_token']) | |
| 594 | + | && hash_equals(acp_csrf(), $_POST['csrf_token']); | |
| 595 | + | } | |
| 596 | + | ||
| 597 | + | /** | |
| 598 | + | * Dynamic add/remove-row key-value table fields, shared by any module that | |
| 599 | + | * needs an editable list of rows (originally built for settings.php's | |
| 600 | + | * 'table' schema field type, also used by the serverdata single-record | |
| 601 | + | * editors). Lives here rather than in one module file since only the active | |
| 602 | + | * module's own file is included per request (see admin/index.php). | |
| 603 | + | */ | |
| 604 | + | ||
| 605 | + | /** Convert a decoded JSON/array value into editable table rows. */ | |
| 606 | + | function acp_table_rows_from_json(array $field, array $decoded): array { | |
| 607 | + | $shape = $field['json_shape'] ?? 'map'; | |
| 608 | + | ||
| 609 | + | if ($shape === 'list') { | |
| 610 | + | $rows = array(); | |
| 611 | + | foreach ($decoded as $value) { | |
| 612 | + | if (!is_array($value)) continue; | |
| 613 | + | $row = array(); | |
| 614 | + | foreach ($field['columns'] as $colKey => $colDef) { | |
| 615 | + | $v = $value[$colKey] ?? null; | |
| 616 | + | $row[$colKey] = acp_table_cell_to_string($colDef, $v); | |
| 617 | + | } | |
| 618 | + | $rows[] = $row; | |
| 619 | + | } | |
| 620 | + | return $rows; | |
| 621 | + | } | |
| 622 | + | ||
| 623 | + | $rowKey = $field['row_key'] ?? 'id'; | |
| 624 | + | $valueColumn = $field['value_column'] ?? null; | |
| 625 | + | $rows = array(); | |
| 626 | + | ||
| 627 | + | foreach ($decoded as $key => $value) { | |
| 628 | + | $row = array($rowKey => (string)$key); | |
| 629 | + | ||
| 630 | + | if ($valueColumn !== null) { | |
| 631 | + | $row[$valueColumn] = is_scalar($value) ? (string)$value : ''; | |
| 632 | + | } else { | |
| 633 | + | foreach ($field['columns'] as $colKey => $colDef) { | |
| 634 | + | if ($colKey === $rowKey) continue; | |
| 635 | + | $v = is_array($value) ? ($value[$colKey] ?? null) : null; | |
| 636 | + | $row[$colKey] = acp_table_cell_to_string($colDef, $v); | |
| 637 | + | } | |
| 638 | + | } | |
| 639 | + | ||
| 640 | + | $rows[] = $row; | |
| 641 | + | } | |
| 642 | + | ||
| 643 | + | return $rows; | |
| 644 | + | } | |
| 645 | + | ||
| 646 | + | /** Convert one stored cell value into the string used to populate a form input. */ | |
| 647 | + | function acp_table_cell_to_string(array $colDef, $v): string { | |
| 648 | + | switch ($colDef['type'] ?? 'text') { | |
| 649 | + | case 'nullable_int': | |
| 650 | + | return ($v === false || $v === null) ? '' : (string)(int)$v; | |
| 651 | + | case 'bool': | |
| 652 | + | return !empty($v) ? '1' : ''; | |
| 653 | + | default: | |
| 654 | + | return ($v === null) ? '' : (string)$v; | |
| 655 | + | } | |
| 656 | + | } | |
| 657 | + | ||
| 658 | + | /** Render the form control for one table cell (name attribute pre-built by the caller). */ | |
| 659 | + | function acp_table_cell_input(array $colDef, string $name, string $value): string { | |
| 660 | + | $type = $colDef['type'] ?? 'text'; | |
| 661 | + | ||
| 662 | + | if ($type === 'bool') { | |
| 663 | + | return '<label style="display:flex;align-items:center;justify-content:center;">' | |
| 664 | + | . '<input type="checkbox" name="' . h($name) . '" value="1" ' . ($value !== '' ? 'checked' : '') . '>' | |
| 665 | + | . '</label>'; | |
| 666 | + | } | |
| 667 | + | ||
| 668 | + | if ($type === 'select') { | |
| 669 | + | $html = '<select class="acp-input" name="' . h($name) . '">'; | |
| 670 | + | foreach (($colDef['options'] ?? array()) as $optValue => $optLabel) { | |
| 671 | + | $html .= '<option value="' . h((string)$optValue) . '" ' . ((string)$optValue === $value ? 'selected' : '') . '>' . h((string)$optLabel) . '</option>'; | |
| 672 | + | } | |
| 673 | + | $html .= '</select>'; | |
| 674 | + | return $html; | |
| 675 | + | } | |
| 676 | + | ||
| 677 | + | if ($type === 'textarea') { | |
| 678 | + | return '<textarea class="acp-textarea" name="' . h($name) . '" rows="2">' . h($value) . '</textarea>'; | |
| 679 | + | } | |
| 680 | + | ||
| 681 | + | $inputType = in_array($type, array('int', 'nullable_int'), true) ? 'number' : 'text'; | |
| 682 | + | return '<input class="acp-input" type="' . h($inputType) . '" name="' . h($name) . '" value="' . h($value) . '">'; | |
| 683 | + | } | |
| 684 | + | ||
| 685 | + | /** Convert one posted cell value back into its typed PHP value for storage. */ | |
| 686 | + | function acp_table_cell_from_post(array $colDef, $v) { | |
| 687 | + | switch ($colDef['type'] ?? 'text') { | |
| 688 | + | case 'nullable_int': | |
| 689 | + | $v = trim((string)$v); | |
| 690 | + | return ($v === '') ? false : (int)$v; | |
| 691 | + | case 'int': | |
| 692 | + | return (int)trim((string)$v); | |
| 693 | + | case 'bool': | |
| 694 | + | return !empty($v); | |
| 695 | + | default: | |
| 696 | + | return trim((string)$v); | |
| 697 | + | } | |
| 698 | + | } | |
| 699 | + | ||
| 700 | + | /** | |
| 701 | + | * acp_table_json_from_rows() (the reverse conversion) is NOT here - the | |
| 702 | + | * map-shape branch's key validation differs per caller (settings.php requires | |
| 703 | + | * numeric row keys for its vocation/town id fields; the serverdata editors | |
| 704 | + | * need arbitrary text keys for item attributes), so each defines its own. | |
| 705 | + | */ | |
| 706 | + | ||
| 707 | + | function acp_card_open(string $title = '', string $subtitle = '', string $extraClass = ''): void { | |
| 708 | + | echo '<section class="acp-card ' . h($extraClass) . '">'; | |
| 709 | + | if ($title !== '') { | |
| 710 | + | echo '<header class="acp-card-head"><h2>' . h($title) . '</h2>'; | |
| 711 | + | if ($subtitle !== '') { | |
| 712 | + | echo '<p>' . h($subtitle) . '</p>'; | |
| 713 | + | } | |
| 714 | + | echo '</header>'; | |
| 715 | + | } | |
| 716 | + | echo '<div class="acp-card-body">'; | |
| 717 | + | } | |
| 718 | + | ||
| 719 | + | function acp_card_close(): void { | |
| 720 | + | echo '</div></section>'; | |
| 721 | + | } | |
| 722 | + | ||
| 723 | + | function acp_empty(string $message, string $icon = 'fa-inbox'): void { | |
| 724 | + | echo '<div class="acp-empty"><i class="fa ' . h($icon) . '"></i><p>' . h($message) . '</p></div>'; | |
| 725 | + | } | |
| 726 | + | ||
| 727 | + | function acp_stat(string $label, $value, string $icon = 'fa-circle-o', ?string $href = null, string $tone = 'blue'): void { | |
| 728 | + | $display = is_int($value) ? number_format($value) : (string)$value; | |
| 729 | + | ||
| 730 | + | $inner = '<span class="acp-stat-icon"><i class="fa ' . h($icon) . '"></i></span>' | |
| 731 | + | . '<span class="acp-stat-text">' | |
| 732 | + | . '<span class="acp-stat-label">' . h($label) . '</span>' | |
| 733 | + | . '<span class="acp-stat-value">' . h($display) . '</span>' | |
| 734 | + | . '</span>'; | |
| 735 | + | ||
| 736 | + | $class = 'acp-stat acp-stat--' . h($tone); | |
| 737 | + | ||
| 738 | + | echo $href !== null | |
| 739 | + | ? '<a class="' . $class . '" href="' . h($href) . '">' . $inner . '</a>' | |
| 740 | + | : '<div class="' . $class . '">' . $inner . '</div>'; | |
| 741 | + | } |
| @@ -0,0 +1,77 @@ | |||
| 1 | + | <?php | |
| 2 | + | /** | |
| 3 | + | * ZnoteX Admin Control Panel - single entry point. | |
| 4 | + | */ | |
| 5 | + | ||
| 6 | + | define('ACP_ROOT', __DIR__); | |
| 7 | + | ||
| 8 | + | chdir(dirname(__DIR__)); | |
| 9 | + | ||
| 10 | + | require_once 'engine/init.php'; | |
| 11 | + | ||
| 12 | + | if (user_logged_in() !== true) { | |
| 13 | + | header('Location: ../protected.php'); | |
| 14 | + | exit; | |
| 15 | + | } | |
| 16 | + | ||
| 17 | + | if (!has_admin_panel_access($user_data ?? null)) { | |
| 18 | + | acp_log('access.panel_denied', (string)($_GET['p'] ?? 'dashboard')); | |
| 19 | + | header('Location: ../myaccount.php'); | |
| 20 | + | exit; | |
| 21 | + | } | |
| 22 | + | ||
| 23 | + | if (znote2fa_setup_incomplete((int)$session_user_id, true)) { | |
| 24 | + | header('Location: ../twofa.php'); | |
| 25 | + | exit; | |
| 26 | + | } | |
| 27 | + | ||
| 28 | + | require_once ACP_ROOT . '/bootstrap.php'; | |
| 29 | + | ||
| 30 | + | $acp_modules = acp_modules(); | |
| 31 | + | ||
| 32 | + | $acp_page = (string)($_GET['p'] ?? 'dashboard'); | |
| 33 | + | if (!isset($acp_modules[$acp_page])) { | |
| 34 | + | $acp_page = isset($acp_modules['dashboard']) | |
| 35 | + | ? 'dashboard' | |
| 36 | + | : (string)(array_key_first($acp_modules) ?? ''); | |
| 37 | + | } | |
| 38 | + | ||
| 39 | + | $acp_module = $acp_modules[$acp_page] ?? null; | |
| 40 | + | ||
| 41 | + | if ($acp_module !== null && !acp_can_module($acp_page)) { | |
| 42 | + | acp_log('access.module_denied', $acp_page, ['roles' => admin_roles($user_data)]); | |
| 43 | + | http_response_code(403); | |
| 44 | + | die('You do not have permission to access this admin module.'); | |
| 45 | + | } | |
| 46 | + | ||
| 47 | + | // A nav entry that points somewhere else on the site is a link, not a page. | |
| 48 | + | if ($acp_module !== null && !empty($acp_module['url'])) { | |
| 49 | + | header('Location: ' . $acp_module['url']); | |
| 50 | + | exit; | |
| 51 | + | } | |
| 52 | + | ||
| 53 | + | // A POST larger than post_max_size reaches PHP with $_POST and $_FILES both | |
| 54 | + | // emptied, which would otherwise look like a forged request. | |
| 55 | + | if ($_SERVER['REQUEST_METHOD'] === 'POST' | |
| 56 | + | && !$_POST && !$_FILES | |
| 57 | + | && (int)($_SERVER['CONTENT_LENGTH'] ?? 0) > 0 | |
| 58 | + | ) { | |
| 59 | + | http_response_code(413); | |
| 60 | + | die('That upload was larger than post_max_size in php.ini, so PHP discarded it. Raise post_max_size and upload_max_filesize, then try again.'); | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | if ($_SERVER['REQUEST_METHOD'] === 'POST' && !acp_verify_csrf()) { | |
| 64 | + | acp_log('security.csrf_rejected', $acp_page); | |
| 65 | + | http_response_code(400); | |
| 66 | + | die('Invalid CSRF token. Reload the page and try again.'); | |
| 67 | + | } | |
| 68 | + | ||
| 69 | + | ob_start(); | |
| 70 | + | if ($acp_module !== null) { | |
| 71 | + | include $acp_module['file']; | |
| 72 | + | } else { | |
| 73 | + | acp_empty('No admin modules are installed in admin/modules/.', 'fa-plug'); | |
| 74 | + | } | |
| 75 | + | $acp_content = ob_get_clean(); | |
| 76 | + | ||
| 77 | + | include ACP_ROOT . '/layout/shell.php'; |
| @@ -0,0 +1,218 @@ | |||
| 1 | + | <?php | |
| 2 | + | /** | |
| 3 | + | * ZnoteX ACP shell - sidebar panel with ZnoteX styling. | |
| 4 | + | * Rendered by admin/index.php with $acp_content already built. | |
| 5 | + | * | |
| 6 | + | * @var array $acp_modules | |
| 7 | + | * @var array|null $acp_module | |
| 8 | + | * @var string $acp_page | |
| 9 | + | * @var string $acp_content | |
| 10 | + | */ | |
| 11 | + | ||
| 12 | + | if (!defined('ACP_ROOT')) { | |
| 13 | + | http_response_code(403); | |
| 14 | + | die('Direct access denied.'); | |
| 15 | + | } | |
| 16 | + | ||
| 17 | + | $acp_flashes = acp_take_flashes(); | |
| 18 | + | $acp_groups = acp_nav_groups(); | |
| 19 | + | $acp_admin = (string)($user_data['name'] ?? 'Admin'); | |
| 20 | + | $acp_siteName = (string)($config['site_title'] ?? 'ZnoteX'); | |
| 21 | + | $acp_title = $acp_module['title'] ?? 'Admin Panel'; | |
| 22 | + | $acp_engine = serverEngineReal(); | |
| 23 | + | ?> | |
| 24 | + | <!DOCTYPE html> | |
| 25 | + | <html lang="en" dir="ltr"> | |
| 26 | + | <head> | |
| 27 | + | <meta charset="utf-8"> | |
| 28 | + | <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| 29 | + | <meta name="robots" content="noindex, nofollow"> | |
| 30 | + | <title><?= h($acp_title) ?> · <?= h($acp_siteName) ?> ACP</title> | |
| 31 | + | ||
| 32 | + | <link rel="icon" href="../assets/img/znoteX.png"> | |
| 33 | + | <link rel="shortcut icon" href="../assets/img/znoteX.png"> | |
| 34 | + | <link rel="apple-touch-icon" href="../assets/img/znoteX.png"> | |
| 35 | + | ||
| 36 | + | <link rel="stylesheet" href="../assets/fontawesome/css/font-awesome.min.css?acp=1"> | |
| 37 | + | <link rel="stylesheet" href="assets/acp.css?acp=6"> | |
| 38 | + | ||
| 39 | + | <script> | |
| 40 | + | // Applied before first paint so the theme never flashes light-then-dark. | |
| 41 | + | (function () { | |
| 42 | + | try { | |
| 43 | + | var d = document.documentElement; | |
| 44 | + | var t = localStorage.getItem('acp.theme'); | |
| 45 | + | if (t) { d.setAttribute('data-acp-theme', t); } | |
| 46 | + | if (localStorage.getItem('acp.sidebar_closed') === '1') { d.classList.add('acp-sidebar-closed'); } | |
| 47 | + | } catch (e) {} | |
| 48 | + | })(); | |
| 49 | + | </script> | |
| 50 | + | </head> | |
| 51 | + | <body class="acp acp-page-<?= h($acp_page) ?>"> | |
| 52 | + | ||
| 53 | + | <div class="acp-shell"> | |
| 54 | + | ||
| 55 | + | <aside class="acp-sidebar" id="acpSidebar"> | |
| 56 | + | <a class="acp-side-home" href="<?= h(acp_url('dashboard')) ?>"> | |
| 57 | + | <i class="fa fa-home"></i> | |
| 58 | + | <span><?= h($acp_siteName) ?></span> | |
| 59 | + | </a> | |
| 60 | + | ||
| 61 | + | <div class="acp-nav-filter"> | |
| 62 | + | <i class="fa fa-search"></i> | |
| 63 | + | <input type="search" id="acpFilter" placeholder="<?= h(t('acp.shell.search_panel')) ?>" autocomplete="off" aria-label="<?= h(t('acp.shell.nav_label')) ?>"> | |
| 64 | + | </div> | |
| 65 | + | ||
| 66 | + | <nav class="acp-nav" id="acpNav" aria-label="<?= h(t('acp.shell.nav_label')) ?>"> | |
| 67 | + | <?php | |
| 68 | + | // A little helper, inline since it is only ever used right here: | |
| 69 | + | // renders one nav link <li>, identical whether it sits directly in | |
| 70 | + | // a group or inside a plugin's sub-list. | |
| 71 | + | $acp_nav_link = function (string $key, array $mod, string $groupName): void { | |
| 72 | + | $isExternal = !empty($mod['url']); | |
| 73 | + | $href = $isExternal ? $mod['url'] : acp_url($key); | |
| 74 | + | $badge = acp_badge($key); | |
| 75 | + | $active = (!$isExternal && $key === $GLOBALS['acp_page']); | |
| 76 | + | ?> | |
| 77 | + | <li> | |
| 78 | + | <a class="acp-nav-link<?= $active ? ' is-active' : '' ?>" | |
| 79 | + | href="<?= h($href) ?>" | |
| 80 | + | data-title="<?= h(strtolower($mod['title'] . ' ' . $groupName)) ?>" | |
| 81 | + | <?= $isExternal ? 'target="' . h($mod['target'] ?? '_self') . '"' : '' ?>> | |
| 82 | + | <i class="fa <?= h($mod['icon']) ?>"></i> | |
| 83 | + | <span class="acp-nav-text"><?= h($mod['title']) ?></span> | |
| 84 | + | <?php if ($badge !== null): ?> | |
| 85 | + | <span class="acp-nav-badge"><?= (int)$badge ?></span> | |
| 86 | + | <?php elseif ($isExternal): ?> | |
| 87 | + | <i class="fa fa-external-link acp-nav-ext"></i> | |
| 88 | + | <?php endif; ?> | |
| 89 | + | </a> | |
| 90 | + | </li> | |
| 91 | + | <?php | |
| 92 | + | }; | |
| 93 | + | ?> | |
| 94 | + | <?php foreach ($acp_groups as $groupName => $groupModules): | |
| 95 | + | $acp_cluster = acp_nav_cluster($groupModules); | |
| 96 | + | ?> | |
| 97 | + | <div class="acp-nav-group"> | |
| 98 | + | <button type="button" class="acp-nav-group-label" aria-expanded="true"> | |
| 99 | + | <span><?= h($groupName) ?></span> | |
| 100 | + | <i class="fa fa-angle-down"></i> | |
| 101 | + | </button> | |
| 102 | + | <ul> | |
| 103 | + | <?php foreach ($acp_cluster['plain'] as $key => $mod): $acp_nav_link($key, $mod, $groupName); endforeach; ?> | |
| 104 | + | ||
| 105 | + | <?php foreach ($acp_cluster['plugins'] as $pluginKey => $cluster): | |
| 106 | + | $pluginActive = array_key_exists($acp_page, $cluster['items']); | |
| 107 | + | ?> | |
| 108 | + | <li class="acp-nav-plugin<?= $pluginActive ? ' is-open' : '' ?>"> | |
| 109 | + | <button type="button" class="acp-nav-plugin-label" aria-expanded="<?= $pluginActive ? 'true' : 'false' ?>"> | |
| 110 | + | <i class="fa fa-plug"></i> | |
| 111 | + | <span class="acp-nav-text"><?= h($cluster['label']) ?></span> | |
| 112 | + | <i class="fa fa-angle-right acp-nav-caret"></i> | |
| 113 | + | </button> | |
| 114 | + | <ul> | |
| 115 | + | <?php foreach ($cluster['items'] as $key => $mod): $acp_nav_link($key, $mod, $groupName . ' ' . $cluster['label']); endforeach; ?> | |
| 116 | + | </ul> | |
| 117 | + | </li> | |
| 118 | + | <?php endforeach; ?> | |
| 119 | + | </ul> | |
| 120 | + | </div> | |
| 121 | + | <?php endforeach; ?> | |
| 122 | + | <p class="acp-nav-nomatch" hidden><?= t('acp.shell.no_match') ?></p> | |
| 123 | + | </nav> | |
| 124 | + | </aside> | |
| 125 | + | ||
| 126 | + | <div class="acp-backdrop" id="acpBackdrop" hidden></div> | |
| 127 | + | ||
| 128 | + | <section class="acp-panel"> | |
| 129 | + | <header class="acp-topbar"> | |
| 130 | + | <button type="button" class="acp-icon-btn acp-burger" id="acpBurger" aria-label="<?= h(t('acp.shell.toggle_menu')) ?>"> | |
| 131 | + | <i class="fa fa-bars"></i> | |
| 132 | + | </button> | |
| 133 | + | <div class="acp-top-title"> | |
| 134 | + | <strong><?= h($acp_siteName) ?></strong> | |
| 135 | + | <span><?= h($acp_engine) ?> <?= t('acp.shell.control_panel') ?></span> | |
| 136 | + | </div> | |
| 137 | + | <form class="acp-top-search" method="get" action="index.php" role="search"> | |
| 138 | + | <input type="hidden" name="p" value="search"> | |
| 139 | + | <i class="fa fa-search"></i> | |
| 140 | + | <input type="search" id="acpTopSearch" name="q" list="acpSearchList" | |
| 141 | + | value="<?= h($acp_page === 'search' ? ($_GET['q'] ?? '') : '') ?>" | |
| 142 | + | placeholder="<?= h(t('acp.shell.search_the_panel')) ?>" autocomplete="off" aria-label="<?= h(t('acp.shell.search_the_panel')) ?>"> | |
| 143 | + | <kbd class="acp-search-kbd" aria-hidden="true">Ctrl K</kbd> | |
| 144 | + | <datalist id="acpSearchList"> | |
| 145 | + | <?php foreach (array_slice(acp_search_index(), 0, 300) as $acp_hit): ?> | |
| 146 | + | <option value="<?= h($acp_hit['title']) ?>"></option> | |
| 147 | + | <?php endforeach; ?> | |
| 148 | + | </datalist> | |
| 149 | + | </form> | |
| 150 | + | ||
| 151 | + | <div class="acp-top-actions"> | |
| 152 | + | <a class="acp-icon-btn" href="../index.php" title="<?= h(t('acp.shell.view_site')) ?>" aria-label="<?= h(t('acp.shell.view_site')) ?>"> | |
| 153 | + | <i class="fa fa-globe"></i> | |
| 154 | + | </a> | |
| 155 | + | <button type="button" class="acp-theme-toggle" id="acpTheme" title="<?= h(t('acp.shell.toggle_theme')) ?>" aria-label="<?= h(t('acp.shell.toggle_theme')) ?>"> | |
| 156 | + | <i class="fa fa-moon-o"></i> | |
| 157 | + | <span><?= t('acp.shell.night') ?></span> | |
| 158 | + | </button> | |
| 159 | + | <span class="acp-user"> | |
| 160 | + | <i class="fa fa-user-circle-o"></i> | |
| 161 | + | <span class="acp-user-name"><?= h($acp_admin) ?></span> | |
| 162 | + | </span> | |
| 163 | + | <a class="acp-icon-btn" href="../login.php?logout" title="<?= h(t('acp.shell.log_out')) ?>" aria-label="<?= h(t('acp.shell.log_out')) ?>"> | |
| 164 | + | <i class="fa fa-sign-out"></i> | |
| 165 | + | </a> | |
| 166 | + | </div> | |
| 167 | + | </header> | |
| 168 | + | ||
| 169 | + | <main class="acp-content"> | |
| 170 | + | ||
| 171 | + | <div class="acp-page-head"> | |
| 172 | + | <?php if ($acp_page !== 'dashboard'): ?> | |
| 173 | + | <nav class="acp-breadcrumb" aria-label="<?= h(t_default('acp.shell.breadcrumb_label', 'Breadcrumb')) ?>"> | |
| 174 | + | <a href="<?= h(acp_url('dashboard')) ?>"><?= h(t('acp.mod.dashboard.title')) ?></a> | |
| 175 | + | <?php if (!empty($acp_module['group'])): ?> | |
| 176 | + | <span class="acp-breadcrumb-sep">/</span> | |
| 177 | + | <span><?= h($acp_module['group']) ?></span> | |
| 178 | + | <?php endif; ?> | |
| 179 | + | <span class="acp-breadcrumb-sep">/</span> | |
| 180 | + | <span class="acp-breadcrumb-current"><?= h($acp_title) ?></span> | |
| 181 | + | </nav> | |
| 182 | + | <?php endif; ?> | |
| 183 | + | <h1><?= h($acp_title) ?></h1> | |
| 184 | + | <?php if (!empty($acp_module['description'])): ?> | |
| 185 | + | <p><?= h($acp_module['description']) ?></p> | |
| 186 | + | <?php endif; ?> | |
| 187 | + | </div> | |
| 188 | + | ||
| 189 | + | <?php foreach ($acp_flashes as $flash): ?> | |
| 190 | + | <div class="acp-flash acp-flash--<?= h($flash['type']) ?>"> | |
| 191 | + | <i class="fa <?= $flash['type'] === 'success' ? 'fa-check-circle' : ($flash['type'] === 'error' ? 'fa-exclamation-triangle' : 'fa-info-circle') ?>"></i> | |
| 192 | + | <span><?= $flash['message'] ?></span> | |
| 193 | + | </div> | |
| 194 | + | <?php endforeach; ?> | |
| 195 | + | ||
| 196 | + | <?php if (!acp_log_table_exists()): ?> | |
| 197 | + | <div class="acp-flash acp-flash--error"> | |
| 198 | + | <i class="fa fa-exclamation-triangle"></i> | |
| 199 | + | <span>Administrative audit logging is unavailable because <code>znote_admin_log</code> is missing. Sensitive changes will not be traceable until the migration is applied.</span> | |
| 200 | + | </div> | |
| 201 | + | <?php endif; ?> | |
| 202 | + | ||
| 203 | + | <?= $acp_content ?> | |
| 204 | + | </main> | |
| 205 | + | ||
| 206 | + | <footer class="acp-footer"> | |
| 207 | + | <span>© <?= h($acp_siteName) ?> · ZnoteX <?= h($version ?? '') ?></span> | |
| 208 | + | <span> | |
| 209 | + | <?= t('acp.shell.rendered_in', ['seconds' => elapsedTime()]) ?> | |
| 210 | + | · <?= h(getClock(false, true)) ?> | |
| 211 | + | </span> | |
| 212 | + | </footer> | |
| 213 | + | </section> | |
| 214 | + | </div> | |
| 215 | + | ||
| 216 | + | <script src="assets/acp.js?acp=3"></script> | |
| 217 | + | </body> | |
| 218 | + | </html> |