html
[
class tree: html
] [
index: html
] [
all elements
]
changelog
install
readme
Todo List
Packages:
core
communication
databases
data_structures
filesystem
forms
GilliGan
html
Services_JSON
Source for file AlphabetFilter.class.php
Documentation is available at
AlphabetFilter.class.php
<?php
/**
* For including this file you have to define the constant "CLASSPATH".
* Because every include in the framework depends on the CLASSPATH definition.
* The CLASSPATH means the relative path to the folder that contains the
* framework GilliGan.
*
*
@package
html
*
@subpackage
components
*/
if
(
!
defined
(
"CLASSPATH"
) )
{
echo
"<h3>You have to define the constant CLASSPATH!</h3>\n"
;
echo
"Example: define( 'CLASSPATH', '../path/to/classes/' );\n"
;
exit
(
)
;
}
/**
*
*/
require_once
(
CLASSPATH
.
"html/components/WebsiteNavigation.class.php"
)
;
/**
* A class to generate a albabethical list to use as Filter for several data.
*
*
@package
html
*
@subpackage
components
*
@version
0.1.1
*
@author
Daniel Plücken <daniel@debakel.net>
*
@license
http://www.gnu.org/copyleft/lesser.html
* GNU Lesser General Public License
*
@copyright
Copyright (c) 2005 Daniel Plücken <daniel@debakel.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
class
AlphabetFilter
extends
WebsiteNavigation
{
/**
*
@access
public
*
@var
string
$str_alphabet
*/
var
$str_alphabet
=
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
;
/**
*
@access
public
*
@var
string
$str_href
*/
var
$str_href
=
""
;
/**
*
@access
public
*
@var
string
$str_before_each_Label
*/
var
$str_before_each_Label
=
""
;
/**
*
@access
public
*
@var
string
$str_behind_each_Label
*/
var
$str_behind_each_Label
=
""
;
/**
* Constructor.
*
*
@version
1.0
*
@since
0.1.0
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@param
$str_href
The hyper reference that should use on click on the
* list item. Place the string "[value]" where you
* want that the alphabetical char from the label of
* the list item should appear.
*
@param
$str_alphabet
*/
function
AlphabetFilter
(
$str_href
,
$str_selected_value
,
$str_alphabet
=
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
)
{
$this
->
str_href
=
$str_href
;
$this
->
str_alphabet
=
$str_alphabet
;
}
/**
* Sets the string that should concate in front of the label string.
*
*
@version
1.0
*
@since
0.1.1
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@param
string
$str_before
*
@return
void
*/
function
setStringBeforeLabel
(
$str_before
)
{
$this
->
str_before_each_Label
=
$str_before
;
}
/**
* Sets the string that should concate behind the label string.
*
*
@version
1.0
*
@since
0.1.1
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@param
string
$str_before
*
@return
void
*/
function
setStringBehindLabel
(
$str_behind
)
{
$this
->
str_behind_each_Label
=
$str_behind
;
}
/**
* Sets the style of the a list item identified by his given value.
*
*
@version
1.0
*
@since
0.1.1
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@param
string
$str_value
*
@param
string
$str_style_class
*
@param
string
$str_link_style_class
*
@param
string
$str_freestyle
*
@param
string
$str_link_freestyle
*
@return
void
*/
function
setMarkedValue
(
$str_value
,
$str_style_class
=
""
,
$str_link_style_class
=
""
,
$str_freestyle
=
""
,
$str_link_freestyle
=
""
)
{
$this
->
build
(
)
;
parent
::
setMarkedValue
(
$str_value
,
$str_style_class
,
$str_link_style_class
,
$str_freestyle
,
$str_link_freestyle
)
;
}
/**
* Builds the alphabetic list.
*
*
@version
1.0
*
@since
0.1.1
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@param
string
$str_before
*
@return
void
*/
function
build
(
)
{
static
$already_build
=
false
;
if
(
$already_build
)
return
;
for
(
$i
=
0
;
$i
<
strlen
(
$this
->
str_alphabet
)
;
$i
++
)
{
if
(
$this
->
str_alphabet
[
$i
]
==
" "
)
$str_label
=
" "
;
else
$str_label
=
htmlentities
(
$this
->
str_alphabet
[
$i
]
)
;
$this
->
addElement
(
$this
->
str_before_each_Label
.
$str_label
.
$this
->
str_behind_each_Label
,
$this
->
str_href
,
$this
->
str_alphabet
[
$i
]
)
;
}
$already_build
=
true
;
}
/**
* Returns a generated string based on the attributes of this HTML-Object.
*
*
@version
1.1
*
@since
0.1.0
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@return
string
*/
function
get
(
)
{
$this
->
build
(
)
;
return
parent
::
get
(
)
;
}
}
// End of class AlphabetFilter
?>
Documentation generated on Thu, 05 Jun 2008 19:10:05 +0200 by
phpDocumentor 1.4.1