1
0
- 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:
Bharat Mediratta 2011-12-27 01:18:04 -08:00
parent 94be4c4ba6
commit ea015d7ded
5 changed files with 41 additions and 40 deletions

View File

@ -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());
}
}
}

View File

@ -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
*
@ -16,41 +17,15 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
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;
}
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;
}
}
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");
}
}
}

View File

@ -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>