diff --git a/src/assets/js/default.js b/src/assets/js/default.js index 8bb93cd7..603c0fa9 100644 --- a/src/assets/js/default.js +++ b/src/assets/js/default.js @@ -40,9 +40,7 @@ $(function() { console.log(element); console.log(xhr); - if (response.startsWith('
')) { - response = response.replace('
', ''); - } + response = response.replace('
', ''); $('body') .modal({ @@ -87,11 +85,6 @@ $(function() { filterRemoteData: true }); - /** - * Refresh Wishlist - */ - // wishlistRefresh(); - /** * Commit to Product */ @@ -178,14 +171,3 @@ $(function() { .modal('show'); }); }); - -function wishlistRefresh() { - /** - * URL Parameter - */ - $('.ui.dropdown.wishlists').api({ - action: 'get wishlists', - method: 'GET', - on: 'now' - }); -} diff --git a/src/classes/page.php b/src/classes/page.php index 3d7b3327..618e1467 100644 --- a/src/classes/page.php +++ b/src/classes/page.php @@ -10,6 +10,76 @@ use wishthis\User; class Page { + /** + * Static + * + * @return string + */ + public static function message(string $content = '', string $header = '', string $type = ''): string + { + ob_start(); + + $containerClasses = array('ui', 'message'); + $iconClasses = array('ui', 'icon'); + + switch ($type) { + case 'error': + $containerClasses[] = 'error icon'; + $iconClasses[] = 'exclamation triangle'; + break; + + case 'warning': + $containerClasses[] = 'warning icon'; + $iconClasses[] = 'exclamation circle'; + break; + + case 'info': + $containerClasses[] = 'info icon'; + $iconClasses[] = 'info circle'; + break; + } + + $containerClass = implode(' ', $containerClasses); + $iconClass = implode(' ', $iconClasses); + ?> +
+ + + + +
+ +
+ + + +

+ +
+
+
-
+

wishthis

-
-

Preferences

- - -
-
@@ -226,62 +287,4 @@ class Page -
- - - - -
- -
- - - -

- -
-
- message($content, $header, 'error'); - } - - public function warning(string $content, string $header = ''): void - { - $this->message($content, $header, 'warning'); - } - - public function info(string $content, string $header = ''): void - { - $this->message($content, $header, 'info'); - } } diff --git a/src/classes/wishlist.php b/src/classes/wishlist.php index f9439e5d..c5fab618 100644 --- a/src/classes/wishlist.php +++ b/src/classes/wishlist.php @@ -143,17 +143,10 @@ class Wishlist - -
- -
-
- Empty -
-

This wishlist seems to be empty.

-
-
+ + + navigation(); error('Invalid credentials!', 'Error'); + echo Page::error('Invalid credentials!', 'Error'); } ?>