ILIAS  Release_5_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.
 setALlowDeletion ($a_val)
 Set allow deletion.
 getALlowDeletion ()
 Get allow deletion.
 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.
 setPending ($a_val)
 Set pending filename value.
 getPending ()
 Get pending filename.
 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.
 setPersonalWorkspaceQuotaCheck ($a_value)
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem.
 getSubItems ()
 Get Subitems.
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively
 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)
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi.
 getMulti ()
 Get Multi.
 setMultiValues (array $a_values)
 Set multi values.
 getMultiValues ()
 Get multi values.
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g.

Protected Attributes

 $cache
- Protected Attributes inherited from ilFileInputGUI
 $size = 40
 $pending
 $allow_deletion
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 $title
 $postvar
 $info
 $alert
 $required = false
 $parentgui
 $parentform
 $hidden_title = ""
 $multi = false
 $multi_sortable = false
 $multi_addremove = true
 $multi_values

Additional Inherited Members

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

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->setAllowDeletion(true);
$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::getALlowDeletion ( )

Get allow deletion.

Returns
boolean allow deletion

Reimplemented from ilFileInputGUI.

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

References ilFileInputGUI\$allow_deletion.

Referenced by insert().

{
}

+ Here is the caller graph for this function:

ilImageFileInputGUI::getAlt ( )

Get Alternative Text.

Returns
string Alternative Text

Definition at line 108 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.

Reimplemented from ilFileInputGUI.

Definition at line 217 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 88 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 68 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 116 of file class.ilImageFileInputGUI.php.

References $lng, ilFileInputGUI\$pending, getALlowDeletion(), getAlt(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), getImage(), ilFileInputGUI\getMaxFileSizeString(), ilFileInputGUI\getPending(), ilFormPropertyGUI\getPostVar(), ilDiskQuotaHandler\getStatusLegend(), getUseCache(), ilFileInputGUI\getValue(), ilDiskQuotaHandler\isUploadPossible(), and ilFileInputGUI\outputSuffixes().

{
global $lng;
$quota_exceeded = $quota_legend = false;
if(self::$check_wsp_quota)
{
include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
{
$lng->loadLanguageModule("file");
$quota_exceeded = $lng->txt("personal_workspace_quota_exceeded_warning");
}
else
{
if($quota_legend)
{
$quota_legend = "<br />".$quota_legend;
}
}
}
$i_tpl = new ilTemplate("tpl.prop_image_file.html", true, true, "Services/Form");
if ($this->getImage() != "")
{
if (!$this->getDisabled() && $this->getALlowDeletion())
{
$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() . "&amp;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();
}
$pending = $this->getPending();
{
$i_tpl->setCurrentBlock("pending");
$i_tpl->setVariable("TXT_PENDING", $lng->txt("file_upload_pending").
": ".$pending);
$i_tpl->parseCurrentBlock();
}
$i_tpl->setVariable("POST_VAR", $this->getPostVar());
$i_tpl->setVariable("ID", $this->getFieldId());
if(!$quota_exceeded)
{
$i_tpl->setVariable("TXT_MAX_SIZE", $lng->txt("file_notice")." ".
$this->getMaxFileSizeString().$quota_legend);
$this->outputSuffixes($i_tpl, "allowed_image_suffixes");
}
else
{
$i_tpl->setVariable("TXT_MAX_SIZE", $quota_exceeded);
}
if ($this->getDisabled() || $quota_exceeded)
{
$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::setALlowDeletion (   $a_val)

Set allow deletion.

Parameters
boolean$a_valallow deletion

Reimplemented from ilFileInputGUI.

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

{
$this->allow_deletion = $a_val;
}
ilImageFileInputGUI::setAlt (   $a_alt)

Set Alternative Text.

Parameters
string$a_altAlternative Text

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

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

Set Image.

Parameters
string$a_imageImage

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

Referenced by ilPCInteractiveImageGUI\initForm(), and 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 58 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: