| @@ -7,24 +7,19 @@ | ||
| 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 | - | |
| 15 | 11 | foreach ($notification_types as $type) { |
| 16 | 12 | if ($notifications = get_option(WTSEC_PLUGIN_PREFIX.$type)) { |
| 17 | 13 | if(is_array($notifications)) { |
| 18 | 14 | foreach ($notifications as $notification) { |
| 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"].'">'.strtoupper($type).':</div> | |
| 24 | - <p class="wtotem_alert__text">'.$notification.'</p> | |
| 25 | - </div> | |
| 26 | - <div class="wtotem_alert__close" onclick="removeAlert()"></div> | |
| 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> | |
| 27 | 22 | </div>'; |
| 28 | 23 | } |
| 29 | 24 | } |
| 30 | 25 | self::deleteNotification($type); |