pools coding standards
This commit is contained in:
parent
14b48d5599
commit
e61b1fe954
@ -8,7 +8,6 @@
|
||||
*/
|
||||
|
||||
class Pools extends SimpleExtension {
|
||||
|
||||
public function onInitExt($event) {
|
||||
global $config, $database;
|
||||
|
||||
|
@ -20,8 +20,7 @@ class PoolsTheme extends Themelet {
|
||||
/*
|
||||
* HERE WE SHOWS THE LIST OF POOLS
|
||||
*/
|
||||
public function list_pools(Page $page, $pools, $pageNumber, $totalPages)
|
||||
{
|
||||
public function list_pools(Page $page, $pools, $pageNumber, $totalPages) {
|
||||
global $user;
|
||||
|
||||
$html = '<table id="poolsList" class="zebra">'.
|
||||
@ -37,8 +36,7 @@ class PoolsTheme extends Themelet {
|
||||
$html .= "</tr></thead>";
|
||||
|
||||
$n = 0;
|
||||
foreach ($pools as $pool)
|
||||
{
|
||||
foreach ($pools as $pool) {
|
||||
$oe = ($n++ % 2 == 0) ? "even" : "odd";
|
||||
|
||||
$pool_link = '<a href="'.make_link("pool/view/".$pool['id']).'">'.$pool['title']."</a>";
|
||||
@ -80,8 +78,7 @@ class PoolsTheme extends Themelet {
|
||||
/*
|
||||
* HERE WE DISPLAY THE NEW POOL COMPOSER
|
||||
*/
|
||||
public function new_pool_composer(Page $page)
|
||||
{
|
||||
public function new_pool_composer(Page $page) {
|
||||
$html = "<form action=".make_link("pool/create")." method='POST'>
|
||||
<table>
|
||||
<tr><td>Title:</td><td><input type='text' name='title'></td></tr>
|
||||
@ -102,8 +99,7 @@ class PoolsTheme extends Themelet {
|
||||
/*
|
||||
* HERE WE DISPLAY THE POOL WITH TITLE DESCRIPTION AND IMAGES WITH PAGINATION
|
||||
*/
|
||||
public function view_pool($pools, $images, $pageNumber, $totalPages)
|
||||
{
|
||||
public function view_pool($pools, $images, $pageNumber, $totalPages) {
|
||||
global $user, $page;
|
||||
|
||||
$pool_info = "<table id='poolsList' class='zebra'>".
|
||||
@ -113,8 +109,7 @@ class PoolsTheme extends Themelet {
|
||||
"</tr></thead>";
|
||||
|
||||
$n = 0;
|
||||
foreach ($pools as $pool)
|
||||
{
|
||||
foreach ($pools as $pool) {
|
||||
$oe = ($n++ % 2 == 0) ? "even" : "odd";
|
||||
|
||||
$pool_info .= "<tr class='$oe'>".
|
||||
@ -266,8 +261,7 @@ class PoolsTheme extends Themelet {
|
||||
* HERE WE DISPLAY THE POOL ORDERER
|
||||
* WE LIST ALL IMAGES ON POOL WITHOUT PAGINATION AND WITH A TEXT INPUT TO SET A NUMBER AND CHANGE THE ORDER
|
||||
*/
|
||||
public function edit_order(Page $page, $pools, $images)
|
||||
{
|
||||
public function edit_order(Page $page, $pools, $images) {
|
||||
global $user;
|
||||
|
||||
$pool_info = "<table id='poolsList' class='zebra'>".
|
||||
@ -278,8 +272,7 @@ class PoolsTheme extends Themelet {
|
||||
|
||||
$n = 0;
|
||||
|
||||
foreach ($pools as $pool)
|
||||
{
|
||||
foreach ($pools as $pool) {
|
||||
$oe = ($n++ % 2 == 0) ? "even" : "odd";
|
||||
|
||||
$pool_info .= "<tr class='$oe'>".
|
||||
@ -298,17 +291,12 @@ class PoolsTheme extends Themelet {
|
||||
$n = 0;
|
||||
foreach($images as $pair) {
|
||||
$image = $pair[0];
|
||||
|
||||
$thumb_html = $this->build_thumb_html($image);
|
||||
|
||||
$pool_images .= '<span class="thumb">'.
|
||||
'<a href="$image_link">'.$thumb_html.'</a>';
|
||||
|
||||
|
||||
$pool_images .= '<br><input name="imgs['.$n.'][]" type="text" width="50px" value="'.$image->image_order.'" />'.
|
||||
'<input name="imgs['.$n.'][]" type="hidden" value="'.$image->id.'" />';
|
||||
$n = $n+1;
|
||||
|
||||
$pool_images .= '</span>';
|
||||
}
|
||||
|
||||
@ -326,8 +314,7 @@ class PoolsTheme extends Themelet {
|
||||
* HERE WE DISPLAY THE POOL EDITOR
|
||||
* WE LIST ALL IMAGES ON POOL WITHOUT PAGINATION AND WITH A CHECKBOX TO SELECT WHICH IMAGE WE WANT REMOVE
|
||||
*/
|
||||
public function edit_pool(Page $page, $pools, $images)
|
||||
{
|
||||
public function edit_pool(Page $page, $pools, $images) {
|
||||
global $user;
|
||||
|
||||
$pool_info = "<table id='poolsList' class='zebra'>".
|
||||
@ -338,8 +325,7 @@ class PoolsTheme extends Themelet {
|
||||
|
||||
$n = 0;
|
||||
|
||||
foreach ($pools as $pool)
|
||||
{
|
||||
foreach ($pools as $pool) {
|
||||
$oe = ($n++ % 2 == 0) ? "even" : "odd";
|
||||
|
||||
$pool_info .= "<tr class='$oe'>".
|
||||
@ -378,23 +364,16 @@ class PoolsTheme extends Themelet {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
";
|
||||
|
||||
$pool_images .= "<form action='".make_link("pool/remove_posts")."' method='POST' name='checks'>";
|
||||
|
||||
foreach($images as $pair) {
|
||||
$image = $pair[0];
|
||||
|
||||
$thumb_html = $this->build_thumb_html($image);
|
||||
|
||||
$pool_images .= '<span class="thumb">'.
|
||||
'<a href="$image_link">'.$thumb_html.'</a>';
|
||||
|
||||
|
||||
$pool_images .= '<br><input name="check[]" type="checkbox" value="'.$image->id.'" />';
|
||||
|
||||
|
||||
$pool_images .= '</span>';
|
||||
}
|
||||
|
||||
@ -430,8 +409,7 @@ class PoolsTheme extends Themelet {
|
||||
"</tr></thead>";
|
||||
|
||||
$n = 0;
|
||||
foreach ($histories as $history)
|
||||
{
|
||||
foreach ($histories as $history) {
|
||||
$oe = ($n++ % 2 == 0) ? "even" : "odd";
|
||||
|
||||
$pool_link = "<a href='".make_link("pool/view/".$history['pool_id'])."'>".$history['title']."</a>";
|
||||
|
Loading…
x
Reference in New Issue
Block a user