diff --git a/3.0/modules/content_warning/controllers/content_warning.php b/3.0/modules/content_warning/controllers/content_warning.php index c514931b..1dc489fb 100644 --- a/3.0/modules/content_warning/controllers/content_warning.php +++ b/3.0/modules/content_warning/controllers/content_warning.php @@ -20,8 +20,7 @@ class Content_Warning_Controller extends Controller { public function index() { if(isset($_GET['cw'])) { setcookie('cw_agree', '1', time() + (60 * 60 * 24), '/'); - header("Location: /"); - exit; + url::redirect(item::root()->abs_url()); } } } \ No newline at end of file diff --git a/3.0/modules/content_warning/jqModal.css b/3.0/modules/content_warning/css/jqModal.css similarity index 100% rename from 3.0/modules/content_warning/jqModal.css rename to 3.0/modules/content_warning/css/jqModal.css diff --git a/3.0/modules/content_warning/helpers/content_warning_theme.php b/3.0/modules/content_warning/helpers/content_warning_theme.php index 46305789..9fe31f81 100644 --- a/3.0/modules/content_warning/helpers/content_warning_theme.php +++ b/3.0/modules/content_warning/helpers/content_warning_theme.php @@ -1,4 +1,5 @@ - - - - - '; - return $h; - } - - static function page_top($theme) { - $cw = ' -
-
-

'.module::get_var("content_warning", "title").'

-
-

'.nl2br(module::get_var("content_warning", "message")).'

-
-
- - -
-
- '; - if(!isset($_COOKIE['cw_agree'])) { - return $cw; - } - } +class content_warning_theme { + static function head($theme) { + $theme->css("jqModal.css"); + $theme->script("jqModal.js"); + } + + static function page_top($theme) { + if(!isset($_COOKIE['cw_agree'])) { + return new View("content_warning_page_top.html"); + } + } } \ No newline at end of file diff --git a/3.0/modules/content_warning/jqModal.js b/3.0/modules/content_warning/js/jqModal.js similarity index 100% rename from 3.0/modules/content_warning/jqModal.js rename to 3.0/modules/content_warning/js/jqModal.js diff --git a/3.0/modules/content_warning/views/content_warning_page_top.html.php b/3.0/modules/content_warning/views/content_warning_page_top.html.php new file mode 100644 index 00000000..81487cd0 --- /dev/null +++ b/3.0/modules/content_warning/views/content_warning_page_top.html.php @@ -0,0 +1,27 @@ + +
+
+

+
+ +

+
+ +
+
+ "> + + +
+
+ "> + + +
+
+
+