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 HTMLEmbed.class.php
Documentation is available at
HTMLEmbed.class.php
<?php
/**
*
@package
html
*/
/**
*
*/
include_once
CLASSPATH
.
"filesystem/Files.class.php"
;
/**
*
*/
include_once
CLASSPATH
.
"html/ABSTHTMLTag.class.php"
;
/**
*
@package
html
*
*
@version
0.1.1
*
@since
0.9.0.8
*
@deprecated
*
@author
Daniel Plücken <daniel@debakel.net>
*
@license
http://www.gnu.org/copyleft/lesser.html
* GNU Lesser General Public License
*
@copyright
Copyright (C) 2006 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
HTMLEmbed
extends
Files
{
/**
*
@access
public
*
@var
string
$kind
*/
var
$kind
=
""
;
// MPG, MOV or AVI
/**
* Stores the value of the width-attribute of this HTMLEmbed-object.
*
*
@var
integer
$width
* access public
*/
var
$width
;
/**
* Stores the value of the height-attribute of this HTMLEmbed-object.
*
*
@var
integer
$height
* access public
*/
var
$height
;
/**
* Stores the url of the plugin to play the embeded file.
*
*
@var
string
$pluginspage
*
@access
public
*/
var
$pluginspage
=
"http://www.apple.com/quicktime/download/"
;
/**
*
@access
public
*
@var
string
$str_show_controller
*/
var
$str_show_controller
=
"true"
;
/**
*
@access
public
*
@var
string
$str_autoplay
*/
var
$str_autoplay
=
"true"
;
/**
*
@access
public
*
@var
string
$mime_type
*/
var
$mime_type
=
""
;
/**
* Constructor
*
*
@access
public
*
@version
1.03
*
@since
0.1.0
*
*
@param
string
$path_and_filename
*
@or
*
@param
string
$path
*
@param
string
$filename
*/
function
HTMLEmbed
(
$path
,
$filename
=
""
)
{
parent
::
Files
(
$path
,
$filename
)
;
if
(
$this
->
kind
==
"MPG"
||
preg_match
(
"!\.mpe?g$!i"
,
$this
->
filename
)
)
{
$this
->
kind
=
"MPG"
;
$this
->
mime_type
=
"video/mpeg"
;
}
else
if
(
$this
->
kind
==
"MOV"
||
preg_match
(
"!\.mov$!i"
,
$this
->
filename
)
)
{
$this
->
kind
=
"MOV"
;
$this
->
mime_type
=
"video/quicktime"
;
}
else
if
(
$this
->
kind
==
"AVI"
||
preg_match
(
"!\.avi$!i"
,
$this
->
filename
)
)
{
$this
->
kind
=
"AVI"
;
$this
->
mime_type
=
"video/avi"
;
}
else
die
(
"Not supported file format!"
)
;
}
/**
* Sets the value of the attribute pluginspage of the embed-tag.
*
*
@version
1.0
*
@since
0.1.0
*
@author
Daniel Plücken <daniel@debakel.net>
*
@access
public
*
@param
string
$url
*
@return
void
*/
function
setPluginspage
(
$url
)
{
$this
->
pluginspage
=
""
;
}
/**
* Sets how the uploaded file should be named.
*
*
@access
public
*
@version
1.0
*
@since
0.1.0
*
*
@param
integer
$int
*
*
@return
void
*/
function
setWidth
(
$int
)
{
if
(
preg_match
(
"!^\d+$!"
,
$int
) )
$this
->
width
=
intval
(
$int
)
;
}
/**
* Sets how the uploaded file should be named.
*
*
@access
public
*
@version
1.0
*
@since
0.1.0
*
*
@param
integer
$int
*
*
@return
void
*/
function
setHeight
(
$int
)
{
if
(
preg_match
(
"!^\d+$!"
,
$int
) )
$this
->
height
=
intval
(
$int
)
;
}
/**
* Returns a generated string based on the attributes of this HTML-Object.
*
*
@access
public
*
@version
1.02
*
@since
0.1.0
*
*
@return
string
*/
function
get
(
)
{
ABSTHTMLTag
::
idExists
(
$this
->
id
,
true
)
;
if
(
!
preg_match
(
"!/$!"
,
$this
->
path
) )
$this
->
path
.=
"/"
;
return
"<embed src=\""
.
$this
->
path
.
$this
->
filename
.
"\" "
.
(
!
empty
(
$this
->
width
)
?
"width=\""
.
$this
->
width
.
"\" "
:
""
)
.
(
!
empty
(
$this
->
height
)
?
"height=\""
.
$this
->
height
.
"\" "
:
""
)
.
"controller=\""
.
$this
->
str_show_controller
.
"\" "
.
"autoplay=\""
.
$this
->
str_autoplay
.
"\" "
.
"type=\""
.
$this
->
mime_type
.
"\" "
.
"pluginspage=\""
.
$this
->
pluginspage
.
"\">"
.
"</embed>"
;
}
}
// END of class HTMLEmbed
?>
Documentation generated on Thu, 05 Jun 2008 19:12:10 +0200 by
phpDocumentor 1.4.1