PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
plugins
/
vxcash
/
admin
<?php /** * Created by PhpStorm. * User: te * Date: 05.07.2018 * Time: 10:42 */ class Vxcash_Notifier { /** * @var null */ protected static $_instance; private $notifications = array(); const VX_NOTIFICATIONS = 'vxNotifications'; const LEVEL_SUCCESS = 'notice-success'; const LEVEL_WARNING = 'notice-warning'; const LEVEL_INFO = 'notice-info'; const LEVEL_ERROR = 'notice-error'; /** * Vxcash_Config constructor. */ private function __construct() {} /** * */ private function __clone() {} /** * @return Vxcash_Notifier */ public static function getInstance() { if (self::$_instance === null) { self::$_instance = new self; } return self::$_instance; } private function getValues() { $notifications = get_option(self::VX_NOTIFICATIONS); if (!$notifications) { $notifications = array(); } $this->notifications = $notifications; } private function saveValues() { update_option(self::VX_NOTIFICATIONS, $this->notifications); } /** * @param string $tag Enforce unique Notifications by overwriting old ones with the same tag * @param string $text The notification text * @param string $level */ public function addNotification($tag, $text, $level = self::LEVEL_INFO) { $this->getValues(); $this->notifications[$tag] = array('text' => $text, 'level' => $level); $this->saveValues(); } /** * @param string $tag */ public function deleteNotification($tag) { $this->getValues(); unset($this->notifications[$tag]); $this->saveValues(); } public function handleNotifications() { $this->getValues(); add_action('admin_init', array($this, 'dismissNotices')); add_action('admin_notices', array($this, 'showAlert')); } public function dismissNotices() { if (isset($_GET['vx-dismissed'])) { $this->deleteNotification($_GET['vx-dismissed']); } } public function showAlert() { foreach ($this->notifications as $tag => $noticiation) { printf('<div class="notice %s" style="position: relative"><p>%s</p><a href="?vx-dismissed=%s" class="notice-dismiss"></a></div>', $noticiation['level'], $noticiation['text'], $tag); } } }
[-] index.php
[edit]
[+]
js
[-] class-vxcash-debug-admin.php
[edit]
[-] class-vxcash-visitx-video-admin.php
[edit]
[-] class-vxcash-auto-import-dataprovider.php
[edit]
[-] class-vxcash-config.php
[edit]
[+]
partials
[-] class-vxcash-admin.php
[edit]
[-] class-vxcash-host-category-handler.php
[edit]
[-] class-vxcash-notifier.php
[edit]
[+]
..
[+]
css
[-] class-vxcash-visitx-host-admin.php
[edit]
[-] class-vxcash-visitx-graphql-client.php
[edit]
[-] class-vxcash-pornme-video-admin.php
[edit]
[-] class-vxcash-vx-dataprovider.php
[edit]