Cleanup:
- Fix up url generation so that they don't expect gallery3 to be installed at the DocumentRoot - Move the theme page_top HTML into a view - Make the JS/CSS work with the combined JS/CSS APIs
This commit is contained in:
parent
94be4c4ba6
commit
ea015d7ded
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
<?php defined("SYSPATH") or die("No direct script access.");/**
|
||||
<?php defined("SYSPATH") or die("No direct script access.");
|
||||
/**
|
||||
* Gallery - a web based photo album viewer and editor
|
||||
* Copyright (C) 2000-2009 Bharat Mediratta
|
||||
*
|
||||
@ -18,39 +19,13 @@
|
||||
*/
|
||||
class content_warning_theme {
|
||||
static function head($theme) {
|
||||
$h = '
|
||||
<script type="text/javascript" src="/lib/jquery.js"></script>
|
||||
<link type="text/css" href="/modules/content_warning/jqModal.css" rel="stylesheet" />
|
||||
<script type="text/javascript" src="/modules/content_warning/jqModal.js"></script>
|
||||
<script type="text/javascript">
|
||||
jQuery().ready(function($){
|
||||
$(\'#dialog\').jqm().jqmShow({});
|
||||
});
|
||||
</script>
|
||||
';
|
||||
return $h;
|
||||
$theme->css("jqModal.css");
|
||||
$theme->script("jqModal.js");
|
||||
}
|
||||
|
||||
static function page_top($theme) {
|
||||
$cw = '
|
||||
<div class="jqmWindow" id="dialog">
|
||||
<hr />
|
||||
<h3>'.module::get_var("content_warning", "title").'</h3>
|
||||
<br />
|
||||
<p>'.nl2br(module::get_var("content_warning", "message")).'</p>
|
||||
<br />
|
||||
<div id="cw_buttons_container">
|
||||
<div class="cw_buttons" id="cw_ko">
|
||||
<a href="'.module::get_var("content_warning", "exit_link_url").'">'.module::get_var("content_warning", "exit_link_text").'</a>
|
||||
</div>
|
||||
<div class="cw_buttons" id="cw_ok">
|
||||
<a href="/index.php/content_warning?cw=1">'.module::get_var("content_warning", "enter_link_text").'</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
if(!isset($_COOKIE['cw_agree'])) {
|
||||
return $cw;
|
||||
return new View("content_warning_page_top.html");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||
<div class="jqmWindow" id="content_warning_dialog">
|
||||
<hr />
|
||||
<h3> <?= module::get_var("content_warning", "title") ?></h3>
|
||||
<br />
|
||||
|
||||
<p><?= nl2br(module::get_var("content_warning", "message")) ?></p>
|
||||
<br />
|
||||
|
||||
<div id="cw_buttons_container">
|
||||
<div class="cw_buttons" id="cw_ko">
|
||||
<a href="<?= module::get_var("content_warning", "exit_link_url") ?>">
|
||||
<?= module::get_var("content_warning", "exit_link_text") ?>
|
||||
</a>
|
||||
</div>
|
||||
<div class="cw_buttons" id="cw_ok">
|
||||
<a href="<?= url::site("content_warning?cw=1") ?>">
|
||||
<?= module::get_var("content_warning", "enter_link_text") ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$("#content_warning_dialog").ready(function($){
|
||||
$("#content_warning_dialog").jqm().jqmShow({});
|
||||
});
|
||||
</script>
|
Reference in New Issue
Block a user