* @copyright 2013 WPFront.com */ class WPFront_Notification_Bar_Template { protected $controller; protected $options; public function __construct($options, $controller) { $this->options = $options; $this->controller = $controller; } public function write() { $this->dynamic_css(); $this->display_button_js_script(); $this->display_bar(); } protected function dynamic_css() { if (!$this->options->dynamic_css_use_url) { ?> options->display_button && $this->options->button_action == 2) { $id_suffix = $this->controller->get_html_id_suffix(); $id_suffix = str_replace('-', "", $id_suffix); $js = preg_replace('/<\/script\b[^>]*>/i', '', $this->options->button_action_javascript); ?> options->fixed_position) { $bar_css .= ' wpfront-fixed-position'; } if($this->controller->display_on_page_load()) { $bar_css .= ' load'; } if($this->options->position == 1) { $bar_css .= ' top'; } else { $bar_css .= ' bottom'; } if($this->options->display_shadow) { if($this->options->position == 1) { $bar_css .= ' wpfront-bottom-shadow'; } else { $bar_css .= ' wpfront-top-shadow'; } } if($this->controller->has_keep_closed_set()) { $bar_css .= ' keep-closed'; } if($this->controller->has_max_views_reached()) { $bar_css .= ' max-views-reached'; } $bar_css .= ' ' . $this->options->custom_class; return $bar_css; } protected function display_bar() { $id_suffix = $this->controller->get_html_id_suffix(); $bar_css = $this->get_bar_css_classes(); ?>