ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilImageFileInputGUI Class Reference

This class represents an image file property in a property form. More...

+ Inheritance diagram for ilImageFileInputGUI:
+ Collaboration diagram for ilImageFileInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor.
 setUseCache ($a_cache)
 Set cache.
 getUseCache ()
 Get cache.
 setImage ($a_image)
 Set Image.
 getImage ()
 Get Image.
 setAlt ($a_alt)
 Set Alternative Text.
 getAlt ()
 Get Alternative Text.
 insert (&$a_tpl)
 Insert property html.
 getDeletionFlag ()
 Get deletion flag.
- Public Member Functions inherited from ilFileInputGUI
 setValueByArray ($a_values)
 Set value by array.
 setValue ($a_value)
 Set Value.
 getValue ()
 Get Value.
 setSize ($a_size)
 Set Size.
 getSize ()
 Get Size.
 setFilename ($a_val)
 Set filename value (if filename selection is enabled)
 getFilename ()
 Get Value.
 setSuffixes ($a_suffixes)
 Set Accepted Suffixes.
 getSuffixes ()
 Get Accepted Suffixes.
 enableFileNameSelection ($a_post_var)
 If enabled, users get the possibility to enter a filename for the uploaded file.
 isFileNameSelectionEnabled ()
 Check if filename selection is enabled.
 getFileNamePostVar ()
 Get file name post var.
 checkInput ()
 Check input, strip slashes etc.
 render ($a_mode="")
 Render html.
 getToolbarHTML ()
 Get HTML for toolbar.
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem.
 getSubItems ()
 Get Subitems.
 checkSubItemsInput ()
 Check SubItems.
 getSubForm ()
 Get sub form html.
 getItemByPostVar ($a_post_var)
 Get item by post var.
- Public Member Functions inherited from ilFormPropertyGUI
executeCommand ()
 Execute command.
 getType ()
 Get Type.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setPostVar ($a_postvar)
 Set Post Variable.
 getPostVar ()
 Get Post Variable.
 getFieldId ()
 Get Post Variable.
 setInfo ($a_info)
 Set Information Text.
 getInfo ()
 Get Information Text.
 setAlert ($a_alert)
 Set Alert Text.
 getAlert ()
 Get Alert Text.
 setRequired ($a_required)
 Set Required.
 getRequired ()
 Get Required.
 setDisabled ($a_disabled)
 Set Disabled.
 getDisabled ()
 Get Disabled.
 setParentForm ($a_parentform)
 Set Parent Form.
 getParentForm ()
 Get Parent Form.
 setParent ($a_val)
 Set Parent GUI object.
 getParent ()
 Get Parent GUI object.
 hideSubForm ()
 Sub form hidden on init?
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders)
 getHiddenTitle ()
 Get hidden title.
 serializeData ()
 serialize data
 unserializeData ($a_data)
 unserialize data
 writeToSession ()
 Write to session.
 clearFromSession ()
 Clear session value.
 readFromSession ()
 Read from session.
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties)

Protected Attributes

 $cache
- Protected Attributes inherited from ilFileInputGUI
 $size = 40
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 $title
 $postvar
 $info
 $alert
 $required = false
 $parentgui
 $parentform

Additional Inherited Members

- Protected Member Functions inherited from ilFileInputGUI
 outputSuffixes ($a_tpl, $a_block="allowed_suffixes")
 getMaxFileSizeString ()

Detailed Description

This class represents an image file property in a property form.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 11 of file class.ilImageFileInputGUI.php.

Constructor & Destructor Documentation

ilImageFileInputGUI::__construct (   $a_title = "",
  $a_postvar = "" 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilFileInputGUI.

Reimplemented in ilImagemapFileInputGUI.

Definition at line 21 of file class.ilImageFileInputGUI.php.

References $lng, ilFormPropertyGUI\setHiddenTitle(), ilFileInputGUI\setSuffixes(), and ilFormPropertyGUI\setType().

{
global $lng;
parent::__construct($a_title, $a_postvar);
$this->setType("image_file");
$this->setSuffixes(array("jpg", "jpeg", "png", "gif"));
$this->setHiddenTitle("(".$lng->txt("form_image_file_input").")");
$this->cache = true;
}

+ Here is the call graph for this function:

Member Function Documentation

ilImageFileInputGUI::getAlt ( )

Get Alternative Text.

Returns
string Alternative Text

Definition at line 88 of file class.ilImageFileInputGUI.php.

Referenced by insert(), and ilImagemapFileInputGUI\insert().

{
return $this->alt;
}

+ Here is the caller graph for this function:

ilImageFileInputGUI::getDeletionFlag ( )

Get deletion flag.

Definition at line 161 of file class.ilImageFileInputGUI.php.

References $_POST, and ilFormPropertyGUI\getPostVar().

{
if ($_POST[$this->getPostVar()."_delete"])
{
return true;
}
return false;
}

+ Here is the call graph for this function:

ilImageFileInputGUI::getImage ( )

Get Image.

Returns
string Image

Definition at line 68 of file class.ilImageFileInputGUI.php.

Referenced by insert(), and ilImagemapFileInputGUI\insert().

{
return $this->image;
}

+ Here is the caller graph for this function:

ilImageFileInputGUI::getUseCache ( )

Get cache.

Returns
boolean

Definition at line 48 of file class.ilImageFileInputGUI.php.

References $cache.

Referenced by insert().

{
return $this->cache;
}

+ Here is the caller graph for this function:

ilImageFileInputGUI::insert ( $a_tpl)

Insert property html.

Reimplemented from ilFileInputGUI.

Reimplemented in ilImagemapFileInputGUI.

Definition at line 96 of file class.ilImageFileInputGUI.php.

References $lng, getAlt(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), getImage(), ilFileInputGUI\getMaxFileSizeString(), ilFormPropertyGUI\getPostVar(), getUseCache(), ilFileInputGUI\getValue(), and ilFileInputGUI\outputSuffixes().

{
global $lng;
$i_tpl = new ilTemplate("tpl.prop_image_file.html", true, true, "Services/Form");
$this->outputSuffixes($i_tpl, "allowed_image_suffixes");
if ($this->getImage() != "")
{
if (!$this->getDisabled())
{
$i_tpl->setCurrentBlock("delete_bl");
$i_tpl->setVariable("POST_VAR_D", $this->getPostVar());
$i_tpl->setVariable("TXT_DELETE_EXISTING",
$lng->txt("delete_existing_file"));
$i_tpl->parseCurrentBlock();
}
if (strlen($this->getValue()))
{
$i_tpl->setCurrentBlock("has_value");
$i_tpl->setVariable("TEXT_IMAGE_NAME", $this->getValue());
$i_tpl->parseCurrentBlock();
}
$i_tpl->setCurrentBlock("image");
if (!$this->getUseCache())
{
$pos = strpos($this->getImage(), '?');
if ($pos !== false)
{
$i_tpl->setVariable("SRC_IMAGE", $this->getImage() . "&time=" . time());
}
else
{
$i_tpl->setVariable("SRC_IMAGE", $this->getImage() . "?time=" . time());
}
}
else
{
$i_tpl->setVariable("SRC_IMAGE", $this->getImage());
}
$i_tpl->setVariable("ALT_IMAGE", $this->getAlt());
$i_tpl->parseCurrentBlock();
}
$i_tpl->setVariable("POST_VAR", $this->getPostVar());
$i_tpl->setVariable("ID", $this->getFieldId());
$i_tpl->setVariable("TXT_MAX_SIZE", $lng->txt("file_notice")." ".
if ($this->getDisabled())
{
$i_tpl->setVariable("DISABLED",
" disabled=\"disabled\"");
}
$a_tpl->setCurrentBlock("prop_generic");
$a_tpl->setVariable("PROP_GENERIC", $i_tpl->get());
$a_tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilImageFileInputGUI::setAlt (   $a_alt)

Set Alternative Text.

Parameters
string$a_altAlternative Text

Definition at line 78 of file class.ilImageFileInputGUI.php.

{
$this->alt = $a_alt;
}
ilImageFileInputGUI::setImage (   $a_image)

Set Image.

Parameters
string$a_imageImage

Definition at line 58 of file class.ilImageFileInputGUI.php.

Referenced by ilObjUserGUI\initForm().

{
$this->image = $a_image;
}

+ Here is the caller graph for this function:

ilImageFileInputGUI::setUseCache (   $a_cache)

Set cache.

Parameters
boolean$a_cacheIf false, the image will be forced to reload in the browser by adding an URL parameter with the actual timestamp

Definition at line 38 of file class.ilImageFileInputGUI.php.

{
$this->cache = ($a_cache) ? true : false;
}

Field Documentation

ilImageFileInputGUI::$cache
protected

Definition at line 13 of file class.ilImageFileInputGUI.php.

Referenced by getUseCache().


The documentation for this class was generated from the following file: