Skip to content

Commit 9682b0d

Browse files
committed
v0.1.0
1 parent a57e3d8 commit 9682b0d

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

plugin.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@
142142

143143
$App->set_action( 'admin_nav', function () {
144144
global $page;
145-
$slug = $this->admin_url( '?page=modules_manager', true );
146-
$active = ( 'modules_manager' === $page ? ' ss-bg-cyan' : '' );
147-
return "<a href=\"$slug\" class=\"ss-btn ss-inverted ss-bd-none ss-white$active\">Modules</a>";
145+
$slug = $this->admin_url( '?page=marketplace', true );
146+
$active = ( 'marketplace' === $page ? ' ss-bg-cyan' : '' );
147+
return "<a href=\"$slug\" class=\"ss-btn ss-inverted ss-bd-none ss-white$active\">Marketplace</a>";
148148
});
149149

150150
$App->set_action( 'admin_middle', function () {
@@ -184,9 +184,9 @@
184184

185185
require_once $this->root( 'app/layout.php' );
186186
break;
187-
case 'modules_manager':
187+
case 'marketplace':
188188
$config = $this->get( 'modules' );
189-
$layout[ 'title' ] = 'Modules';
189+
$layout[ 'title' ] = 'Marketplace';
190190
$layout[ 'content' ] = '
191191
<div class="ss-container ss-center ss-mt-7">
192192
<input type="search" id="search" placeholder="Search" class="ss-input ss-mobile ss-w-6 ss-mx-auto">
@@ -196,7 +196,7 @@
196196
<option value="plugin">PLUGINS</option>
197197
</select>
198198
<p class="ss-right-align ss-tiny ss-mt-7 ss-mb-5 ss-mr-3">
199-
<a href="' . $this->admin_url( '?page=modules_manager&sync=true&token=' . $this->token(), true ) . '" class="ss-btn ss-inverted ss-white ss-bg-cyan ss-bd-cyan">Check for updates</a>
199+
<a href="' . $this->admin_url( '?page=marketplace&sync=true&token=' . $this->token(), true ) . '" class="ss-btn ss-inverted ss-white ss-bg-cyan ss-bd-cyan">Check for updates</a>
200200
<br> Last sync: ' . date( 'F j, Y – H:i', filectime( modules_temporary_dir( 'packages.json' ) ) ) . '
201201
<br> Repository: ' . MODULES_REPO . '
202202
</p>
@@ -268,8 +268,8 @@
268268
<h4 class="ss-monospace">' . $module[ 'name' ] . ' <sup class="ss-small">(' . $module[ 'slug' ] . ')</sup></h4>
269269
<p>' . substr( $module[ 'description' ], 0, 300 ) . '</p>
270270
<p>
271-
<a' . ( ( $compatible && $version !== 0 ) ? ' href="' . $this->admin_url( '?page=modules_manager&download=true' . ( $downloaded ? '&update=true' : '' ) . '&slug=' . $module[ 'slug' ] . '&type=' . $module[ 'type' ] . '&token=' . $this->token(), true ) . '" onclick="return confirm(\'Are you sure you want to ' . ( $downloaded ? ( ( $version < 0 ) ? 'downgrade' : 'update' ) : 'download' ) . ' this ' . $module[ 'type' ] . '?\')"' : '' ) . ' class="ss-button ss-card' . ( ( $compatible && $version !== 0 ) ? '' : ' ss-disabled' ) . '" disabled>' . ( $downloaded ? ( ( $version < 0 ) ? 'Downgrade' : ( ( $version === 0 ) ? 'Up to Date' : 'Update' ) ) : 'Download' ) . '</a>
272-
' . ( $downloaded ? '<a' . ( ( $installed || $is_current_theme ) ? '' : ' href="' . $this->admin_url( '?page=modules_manager&delete=true&slug=' . $module[ 'slug' ] . '&type=' . $module[ 'type' ] . '&token=' . $this->token(), true ) . '" onclick="return confirm(\'Are you sure you want to delete this ' . $module[ 'type' ] . '?\')"' ) . ' class="ss-button ss-card ss-white ss-bg-light-red' . ( ( $installed || $is_current_theme ) ? ' ss-disabled" disabled' : '"' ) . '>Delete</a>' : '' ) . '
271+
<a' . ( ( $compatible && $version !== 0 ) ? ' href="' . $this->admin_url( '?page=marketplace&download=true' . ( $downloaded ? '&update=true' : '' ) . '&slug=' . $module[ 'slug' ] . '&type=' . $module[ 'type' ] . '&token=' . $this->token(), true ) . '" onclick="return confirm(\'Are you sure you want to ' . ( $downloaded ? ( ( $version < 0 ) ? 'downgrade' : 'update' ) : 'download' ) . ' this ' . $module[ 'type' ] . '?\')"' : '' ) . ' class="ss-button ss-card' . ( ( $compatible && $version !== 0 ) ? '' : ' ss-disabled' ) . '" disabled>' . ( $downloaded ? ( ( $version < 0 ) ? 'Downgrade' : ( ( $version === 0 ) ? 'Up to Date' : 'Update' ) ) : 'Download' ) . '</a>
272+
' . ( $downloaded ? '<a' . ( ( $installed || $is_current_theme ) ? '' : ' href="' . $this->admin_url( '?page=marketplace&delete=true&slug=' . $module[ 'slug' ] . '&type=' . $module[ 'type' ] . '&token=' . $this->token(), true ) . '" onclick="return confirm(\'Are you sure you want to delete this ' . $module[ 'type' ] . '?\')"' ) . ' class="ss-button ss-card ss-white ss-bg-light-red' . ( ( $installed || $is_current_theme ) ? ' ss-disabled" disabled' : '"' ) . '>Delete</a>' : '' ) . '
273273
</p>
274274
<details class="ss-fieldset">
275275
<summary>More details</summary>
@@ -349,11 +349,11 @@
349349
$this->auth( post: false );
350350
if ( modules_download_list() ) {
351351
$this->alert( 'List updated successfully.', 'success' );
352-
$this->go( $this->admin_url( '?page=modules_manager' ) );
352+
$this->go( $this->admin_url( '?page=marketplace' ) );
353353
}
354354

355355
$this->alert( 'Failed to update list, please try again.', 'error' );
356-
$this->go( $this->admin_url( '?page=modules_manager' ) );
356+
$this->go( $this->admin_url( '?page=marketplace' ) );
357357
}
358358

359359
elseif ( isset( $_GET[ 'download' ] ) ) {
@@ -362,23 +362,23 @@
362362
if ( download_module( $module, $msg ) ) {
363363
$action = ( isset( $_GET[ 'update' ] ) ? 'updated' : 'downloaded' );
364364
$this->alert( sprintf( '%s <b>%s</b> has been %s successfully.', ucfirst( $module[ 'type' ] ), ucwords( $module[ 'name' ] ), $action ), 'success' );
365-
$this->go( $this->admin_url( '?page=modules_manager' ) );
365+
$this->go( $this->admin_url( '?page=marketplace' ) );
366366
}
367367

368368
$this->alert( $msg . ', please try again.', 'error' );
369-
$this->go( $this->admin_url( '?page=modules_manager' ) );
369+
$this->go( $this->admin_url( '?page=marketplace' ) );
370370
}
371371

372372
elseif ( isset( $_GET[ 'delete' ] ) ) {
373373
$this->auth( post: false );
374374
$module = get_module( $_GET[ 'slug' ], $_GET[ 'type' ] );
375375
if ( delete_module( $module, $msg ) ) {
376376
$this->alert( $msg . ' successfully.', 'success' );
377-
$this->go( $this->admin_url( '?page=modules_manager' ) );
377+
$this->go( $this->admin_url( '?page=marketplace' ) );
378378
}
379379

380380
$this->alert( $msg . ', please try again.', 'error' );
381-
$this->go( $this->admin_url( '?page=modules_manager' ) );
381+
$this->go( $this->admin_url( '?page=marketplace' ) );
382382
}
383383

384384
require_once $this->root( 'app/layout.php' );

0 commit comments

Comments
 (0)