Cleaning up HTML code and such.
This commit is contained in:
parent
7044a6074f
commit
bbdce53a67
@ -17,8 +17,7 @@ class PoolsTheme extends Themelet {
|
|||||||
foreach($pools as $pool) {
|
foreach($pools as $pool) {
|
||||||
$h .= "<option value='".$pool['id']."'>".html_escape($pool['title'])."</option>";
|
$h .= "<option value='".$pool['id']."'>".html_escape($pool['title'])."</option>";
|
||||||
}
|
}
|
||||||
$editor = "
|
$editor = "\n".make_form(make_link("pool/add_post"))."
|
||||||
".make_form(make_link("pool/add_post"))."
|
|
||||||
<select name='pool_id'>
|
<select name='pool_id'>
|
||||||
$h
|
$h
|
||||||
</select>
|
</select>
|
||||||
@ -35,15 +34,18 @@ class PoolsTheme extends Themelet {
|
|||||||
*/
|
*/
|
||||||
public function list_pools(Page $page, /*array*/ $pools, /*int*/ $pageNumber, /*int*/ $totalPages) {
|
public function list_pools(Page $page, /*array*/ $pools, /*int*/ $pageNumber, /*int*/ $totalPages) {
|
||||||
global $user;
|
global $user;
|
||||||
$html = '<table id="poolsList" class="zebra">'.
|
$html = '
|
||||||
"<thead><tr>".
|
<table id="poolsList" class="zebra">
|
||||||
"<th>Name</th>".
|
<thead><tr>
|
||||||
"<th>Creator</th>".
|
<th>Name</th>
|
||||||
"<th>Posts</th>".
|
<th>Creator</th>
|
||||||
"<th>Public</th>".
|
<th>Posts</th>
|
||||||
"</tr></thead>";
|
<th>Public</th>
|
||||||
|
</tr></thead>';
|
||||||
|
|
||||||
$n = 0;
|
$n = 0;
|
||||||
|
|
||||||
|
// Build up the list of pools.
|
||||||
foreach($pools as $pool) {
|
foreach($pools as $pool) {
|
||||||
$oe = ($n++ % 2 == 0) ? "even" : "odd";
|
$oe = ($n++ % 2 == 0) ? "even" : "odd";
|
||||||
|
|
||||||
@ -61,11 +63,11 @@ class PoolsTheme extends Themelet {
|
|||||||
|
|
||||||
$html .= "</tbody></table>";
|
$html .= "</tbody></table>";
|
||||||
|
|
||||||
$nav_html = "
|
$nav_html = '
|
||||||
<a href=".make_link().">Index</a>
|
<a href="'.make_link().'">Index</a>
|
||||||
<br><a href=".make_link("pool/new").">Create Pool</a>
|
<br><a href="'.make_link("pool/new").'">Create Pool</a>
|
||||||
<br><a href=".make_link("pool/updated").">Pool Changes</a>
|
<br><a href="'.make_link("pool/updated").'">Pool Changes</a>
|
||||||
";
|
';
|
||||||
|
|
||||||
$blockTitle = "Pools";
|
$blockTitle = "Pools";
|
||||||
$page->set_title(html_escape($blockTitle));
|
$page->set_title(html_escape($blockTitle));
|
||||||
@ -114,11 +116,12 @@ class PoolsTheme extends Themelet {
|
|||||||
$page->add_block(new Block(html_escape($pool['title']), html_escape($pool['description']), "main", 10));
|
$page->add_block(new Block(html_escape($pool['title']), html_escape($pool['description']), "main", 10));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$pool_info = "<table id='poolsList' class='zebra'>".
|
$pool_info = '
|
||||||
"<thead><tr>".
|
<table id="poolsList" class="zebra">
|
||||||
"<th class='left'>Title</th>".
|
<thead><tr>
|
||||||
"<th class='left'>Description</th>".
|
<th class="left">Title</th>
|
||||||
"</tr></thead>";
|
<th class="left">Description</th>
|
||||||
|
</tr></thead>';
|
||||||
|
|
||||||
$n = 0;
|
$n = 0;
|
||||||
foreach($pools as $pool) {
|
foreach($pools as $pool) {
|
||||||
@ -189,10 +192,12 @@ class PoolsTheme extends Themelet {
|
|||||||
|
|
||||||
if($user->id == $pool['user_id'] || $user->is_admin()){
|
if($user->id == $pool['user_id'] || $user->is_admin()){
|
||||||
$editor .= "
|
$editor .= "
|
||||||
<script type='text/javascript'>
|
<script language='javascript' type='text/javascript'>
|
||||||
|
<!--
|
||||||
function confirm_action() {
|
function confirm_action() {
|
||||||
return confirm('Are you sure that you want to delete this pool?');
|
return confirm('Are you sure that you want to delete this pool?');
|
||||||
}
|
}
|
||||||
|
//-->
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
".make_form(make_link("pool/nuke"))."
|
".make_form(make_link("pool/nuke"))."
|
||||||
@ -204,7 +209,8 @@ class PoolsTheme extends Themelet {
|
|||||||
|
|
||||||
if($check_all) {
|
if($check_all) {
|
||||||
$editor .= "
|
$editor .= "
|
||||||
<script language='JavaScript' type='text/javascript'>
|
<script language='javascript' type='text/javascript'>
|
||||||
|
<!--
|
||||||
function setAll(value) {
|
function setAll(value) {
|
||||||
var a=new Array();
|
var a=new Array();
|
||||||
a=document.getElementsByName('check[]');
|
a=document.getElementsByName('check[]');
|
||||||
@ -213,6 +219,7 @@ class PoolsTheme extends Themelet {
|
|||||||
a[i].checked = value;
|
a[i].checked = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//-->
|
||||||
</script>
|
</script>
|
||||||
<br><input type='button' name='CheckAll' value='Check All' onClick='setAll(true)'>
|
<br><input type='button' name='CheckAll' value='Check All' onClick='setAll(true)'>
|
||||||
<input type='button' name='UnCheckAll' value='Uncheck All' onClick='setAll(false)'>
|
<input type='button' name='UnCheckAll' value='Uncheck All' onClick='setAll(false)'>
|
||||||
@ -228,7 +235,8 @@ class PoolsTheme extends Themelet {
|
|||||||
public function pool_result(Page $page, /*array*/ $images, /*int*/ $pool_id) {
|
public function pool_result(Page $page, /*array*/ $images, /*int*/ $pool_id) {
|
||||||
// TODO: this could / should be done using jQuery
|
// TODO: this could / should be done using jQuery
|
||||||
$pool_images = "
|
$pool_images = "
|
||||||
<script language='JavaScript' type='text/javascript'>
|
<script language='javascript' type='text/javascript'>
|
||||||
|
<!--
|
||||||
function setAll(value) {
|
function setAll(value) {
|
||||||
var a=new Array();
|
var a=new Array();
|
||||||
a=document.getElementsByName('check[]');
|
a=document.getElementsByName('check[]');
|
||||||
@ -241,6 +249,7 @@ class PoolsTheme extends Themelet {
|
|||||||
function confirm_action() {
|
function confirm_action() {
|
||||||
return confirm('Are you sure you want to add selected posts to this pool?');
|
return confirm('Are you sure you want to add selected posts to this pool?');
|
||||||
}
|
}
|
||||||
|
//-->
|
||||||
</script>
|
</script>
|
||||||
";
|
";
|
||||||
|
|
||||||
@ -335,15 +344,16 @@ class PoolsTheme extends Themelet {
|
|||||||
*/
|
*/
|
||||||
public function show_history($histories, /*int*/ $pageNumber, /*int*/ $totalPages) {
|
public function show_history($histories, /*int*/ $pageNumber, /*int*/ $totalPages) {
|
||||||
global $page;
|
global $page;
|
||||||
$html = "<table id='poolsList' class='zebra'>".
|
$html = '
|
||||||
"<thead><tr>".
|
<table id="poolsList" class="zebra">
|
||||||
"<th>Pool</th>".
|
<thead><tr>
|
||||||
"<th>Post Count</th>".
|
<th>Pool</th>
|
||||||
"<th>Changes</th>".
|
<th>Post Count</th>
|
||||||
"<th>Updater</th>".
|
<th>Changes</th>
|
||||||
"<th>Date</th>".
|
<th>Updater</th>
|
||||||
"<th>Action</th>".
|
<th>Date</th>
|
||||||
"</tr></thead>";
|
<th>Action</th>
|
||||||
|
</tr></thead>';
|
||||||
|
|
||||||
$n = 0;
|
$n = 0;
|
||||||
foreach($histories as $history) {
|
foreach($histories as $history) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user