Source for file Sitemaker.class.php
Documentation is available at
Sitemaker.class.php
<?php
/**
* Class Sitemaker creates the sites from long tables
*
* LICENSE: CREATIVE COMMONS PUBLIC LICENSE "Namensnennung — Nicht-kommerziell 2.0"
*
*
@copyright
2009 <SEDesign />
*
@license
http://creativecommons.org/licenses/by-nc/2.0/de/
*
@version
$3.0.6$
*
@link
http://www.sedesign.de/de_produkte_chat-v3.html
*
@since
File available since Alpha 1.0
*/
/*
$sitemakerObj = new Sitemaker($anzahl_der_messages_pro_seite, $counted[0][0]);
$sitemakerObj->make($seite, $absolut_dir.$kat."-#site#.html", "Seite", "von");
$print_site_count = $sitemakerObj->get();
*/
class
Sitemaker
{
/**
* Created output to print
*
@var
String
*/
private
$print_site_count
;
/**
* Messages on one site
*
@var
int
*/
private
$anzahl_der_messages_pro_seite
;
/**
* Counted datasets
*
@var
int
*/
private
$counted
;
/**
* Constructor
*
*
@return
void
*/
public
function
__construct
(
$anz
,
$count
)
{
$this
->
anzahl_der_messages_pro_seite
=
$anz
;
$this
->
counted
=
$count
;
}
/**
* Creates the arrows and so on
*
*
@return
void
*/
public
function
make
(
$seite
,
$tpl
,
$site_text
=
"Site"
,
$of_text
=
"of"
,
$minus_stop
=
"<<<"
,
$minus
=
"<<<"
,
$plus
=
">>>"
,
$plus_stop
=
">>>"
)
{
$anzahl_der_seiten_ermittelt
= (int)
((
$this
->
counted
/
$this
->
anzahl_der_messages_pro_seite
)
+0.99999999999999
)
;
if
(
$seite
<1
)
$seite
=1
;
if
(
$seite
>
$anzahl_der_seiten_ermittelt
)
$seite
=
$anzahl_der_seiten_ermittelt
;
if
(
$seite
==1
)
$this
->
print_site_count
=
$minus_stop
.
" "
;
else
$this
->
print_site_count
=
"<a class=\"sitemaker\" href=\"#\" id=\""
.
str_replace
(
'#site#'
,
(
$seite
-1
)
,
$tpl
)
.
"\" title=\"Site -\">"
.
$minus
.
"</a> "
;
$this
->
print_site_count
.=
$site_text
.
"\n<form action=\"\" style=\"display:inline;\">"
;
$this
->
print_site_count
.=
"\n<div style=\"display:inline;\"><select id=\"site_selecter\" class=\"sitemaker_select\">\n"
;
for
(
$i
=1
;
$i
<=
$anzahl_der_seiten_ermittelt
;
$i
++
)
{
if
(
$seite
==
$i
)
$this
->
print_site_count
.=
"<option value=\""
.
$i
.
"
\" selected=\"selected\">
$i
</option>\n
"
;
else
$this
->
print_site_count
.=
"<option value=\""
.
$i
.
"
\">
$i
</option>\n
"
;
}
$this
->
print_site_count
.=
"</select></div></form>"
;
$this
->
print_site_count
.=
" "
.
$of_text
.
" "
.
$anzahl_der_seiten_ermittelt
.
" "
;
if
((
$this
->
counted
/
$this
->
anzahl_der_messages_pro_seite
)
<=
$seite
)
$this
->
print_site_count
.=
$plus
;
else
$this
->
print_site_count
.=
"<a class=\"sitemaker\" href=\"#\" id=\""
.
str_replace
(
'#site#'
,
(
$seite
+1
)
,
$tpl
)
.
"\" title=\"Site +\">"
.
$plus_stop
.
"</a>"
;
}
/**
* Print the result
*
*
@return
void
*/
function
show
(
)
{
echo
$this
->
print_site_count
;
}
/**
* Return the result
*
*
@return
String
*/
function
get
(
)
{
return
$this
->
print_site_count
;
}
}
?>
Documentation generated on Tue, 22 Dec 2009 09:42:51 +0100 by
phpDocumentor 1.4.1