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() {
|
public function index() {
|
||||||
if(isset($_GET['cw'])) {
|
if(isset($_GET['cw'])) {
|
||||||
setcookie('cw_agree', '1', time() + (60 * 60 * 24), '/');
|
setcookie('cw_agree', '1', time() + (60 * 60 * 24), '/');
|
||||||
header("Location: /");
|
url::redirect(item::root()->abs_url());
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -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
|
* Gallery - a web based photo album viewer and editor
|
||||||
* Copyright (C) 2000-2009 Bharat Mediratta
|
* Copyright (C) 2000-2009 Bharat Mediratta
|
||||||
*
|
*
|
||||||
@ -17,40 +18,14 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
class content_warning_theme {
|
class content_warning_theme {
|
||||||
static function head($theme) {
|
static function head($theme) {
|
||||||
$h = '
|
$theme->css("jqModal.css");
|
||||||
<script type="text/javascript" src="/lib/jquery.js"></script>
|
$theme->script("jqModal.js");
|
||||||
<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;
|
|
||||||
}
|
|
||||||
|
|
||||||
static function page_top($theme) {
|
static function page_top($theme) {
|
||||||
$cw = '
|
if(!isset($_COOKIE['cw_agree'])) {
|
||||||
<div class="jqmWindow" id="dialog">
|
return new View("content_warning_page_top.html");
|
||||||
<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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -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