| @@ -1,5 +1,5 @@ | ||
| 1 | -<?php defined('ABSPATH') or die("Protected By Webtotem Wordpress Security!"); | |
| 1 | +<?php defined('ABSPATH') or die("Protected By WT!"); | |
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | class WTSEC_LIBRARY_Session |
| 5 | 5 | { |
| @@ -7,19 +7,24 @@ | ||
| 7 | 7 | { |
| 8 | 8 | $notification_types = [ |
| 9 | 9 | "error","info","warning","success" |
| 10 | 10 | ]; |
| 11 | + | |
| 12 | + //need upgrade code style | |
| 13 | + $styles = ["error" => ["color" => "red","class" => "wtotem_alert__img_cross", "img" => ""],"info" => ["color" => "","class" => "","img" => ""],"warning" => ["color" => "yellow","class" => "", "img" => '<img src="'.wtsec_getImagePath("alert-warning.svg").'">'],"success" => ["color" => "green","class" => "" ,"img" => '<img src="'.wtsec_getImagePath("alert-success.svg").'">']]; | |
| 14 | + | |
| 11 | 15 | foreach ($notification_types as $type) { |
| 12 | 16 | if ($notifications = get_option(WTSEC_PLUGIN_PREFIX.$type)) { |
| 13 | 17 | if(is_array($notifications)) { |
| 14 | 18 | foreach ($notifications as $notification) { |
| 15 | - echo '<div class="ww-main ww-main--grid" id="ww-alert" title="" data-tlite=""> | |
| 16 | - <div class="ww-alert ww-alert--'.$type.'" title="" data-tlite=""> | |
| 17 | - <div class="ww-alert__info">'.strtoupper($type).':</div> | |
| 18 | - <div class="ww-alert__text" title="" data-tlite="">'.$notification.'</div><button class="ww-alert__close" type="button" onclick="removeAlert()"> | |
| 19 | - <div class="ww-icon ww-icon--close"></div> | |
| 20 | - </button> | |
| 21 | - </div> | |
| 19 | + $style = $styles[$type]; | |
| 20 | + echo '<div class="wtotem_alert wt_card" id="wtotem_alert" style="margin-bottom:0"> | |
| 21 | + <div class="wtotem_alert__desc"> | |
| 22 | + <div class="wtotem_alert__img '.$style["class"].'">'.$style["img"].'</div> | |
| 23 | + <div class="wtotem_alert__title wtotem_alert__title_'.$style["color"].'">'.WTSEC_LIBRARY_Localization::lmsg('statuses.' . $type).': </div> | |
| 24 | + <p class="wtotem_alert__text">'.$notification.'</p> | |
| 25 | + </div> | |
| 26 | + <div class="wtotem_alert__close" ></div> | |
| 22 | 27 | </div>'; |
| 23 | 28 | } |
| 24 | 29 | } |
| 25 | 30 | self::deleteNotification($type); |
| @@ -38,5 +43,14 @@ | ||
| 38 | 43 | }else{ |
| 39 | 44 | update_option(WTSEC_PLUGIN_PREFIX.$type,[$value]); |
| 40 | 45 | } |
| 41 | 46 | } |
| 47 | + | |
| 48 | + public static function _set($name, $value){ | |
| 49 | + $_SESSION[WTSEC_PLUGIN_PREFIX . $name] = $value; | |
| 50 | + } | |
| 51 | + | |
| 52 | + public static function _get($name){ | |
| 53 | + return $_SESSION[WTSEC_PLUGIN_PREFIX . $name]; | |
| 54 | + } | |
| 55 | + | |
| 42 | 56 | } |