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

This class represents a background image property in a property form. More...

+ Inheritance diagram for ilBackgroundImageInputGUI:
+ Collaboration diagram for ilBackgroundImageInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor.
 setValue ($a_value)
 Set Value.
 getValue ()
 Get Value.
 setImages ($a_images)
 Set Images.
 getImages ()
 Get Images.
 checkInput ()
 Check input, strip slashes etc.
 insert (&$a_tpl)
 Insert property html.
 setValueByArray ($a_values)
 Set value by array.
- 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.
 getSubForm ()
 Get sub form html.
 hideSubForm ()
 Sub form hidden on init?
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders)
 getHiddenTitle ()
 Get hidden title.
 getItemByPostVar ($a_post_var)
 Get item by post var.
 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

 $value
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 $title
 $postvar
 $info
 $alert
 $required = false
 $parentgui
 $parentform

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type.

Detailed Description

This class represents a background image 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 31 of file class.ilBackgroundImageInputGUI.php.

Constructor & Destructor Documentation

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilFormPropertyGUI.

Definition at line 41 of file class.ilBackgroundImageInputGUI.php.

References ilFormPropertyGUI\setType().

{
parent::__construct($a_title, $a_postvar);
$this->setType("background_image");
}

+ Here is the call graph for this function:

Member Function Documentation

ilBackgroundImageInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilFormPropertyGUI.

Definition at line 92 of file class.ilBackgroundImageInputGUI.php.

References $_POST, $lng, ilFormPropertyGUI\$type, ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), setValue(), and ilUtil\stripSlashes().

{
global $lng;
$type = $_POST[$this->getPostVar()]["type"] =
$int_value = $_POST[$this->getPostVar()]["int_value"] =
ilUtil::stripSlashes($_POST[$this->getPostVar()]["int_value"]);
$ext_value = $_POST[$this->getPostVar()]["ext_value"] =
ilUtil::stripSlashes($_POST[$this->getPostVar()]["ext_value"]);
if ($this->getRequired() && $type == "ext" && trim($ext_value) == "")
{
$this->setAlert($lng->txt("msg_input_is_required"));
return false;
}
if ($type == "external")
{
$this->setValue($ext_value);
}
else
{
$this->setValue($int_value);
}
return true;
}

+ Here is the call graph for this function:

ilBackgroundImageInputGUI::getImages ( )

Get Images.

Returns
array Images

Definition at line 82 of file class.ilBackgroundImageInputGUI.php.

Referenced by insert().

{
return $this->images;
}

+ Here is the caller graph for this function:

ilBackgroundImageInputGUI::getValue ( )

Get Value.

Returns
string Value

Definition at line 62 of file class.ilBackgroundImageInputGUI.php.

References $value.

Referenced by insert().

{
return $this->value;
}

+ Here is the caller graph for this function:

ilBackgroundImageInputGUI::insert ( $a_tpl)

Insert property html.

Definition at line 125 of file class.ilBackgroundImageInputGUI.php.

References $tpl, $value, getImages(), ilFormPropertyGUI\getPostVar(), getValue(), and ilUtil\prepareFormOutput().

{
$tpl = new ilTemplate("tpl.prop_background_image.html", true, true, "Services/Style");
$tpl->setVariable("POSTVAR", $this->getPostVar());
$int_options = array_merge(array("" => ""), $this->getImages());
$value = trim($this->getValue());
if (is_int(strpos($value, "/")))
{
$current_type = "ext";
$tpl->setVariable("EXTERNAL_SELECTED", 'checked="checked"');
$tpl->setVariable("VAL_EXT", ilUtil::prepareFormOutput($value));
}
else
{
$current_type = "int";
$tpl->setVariable("INTERNAL_SELECTED", 'checked="checked"');
}
foreach ($int_options as $option)
{
$tpl->setCurrentBlock("int_option");
$tpl->setVariable("VAL_INT", $option);
$tpl->setVariable("TXT_INT", $option);
if ($current_type == "int" && $value == $option)
{
$tpl->setVariable("INT_SELECTED", 'selected="selected"');
}
$tpl->parseCurrentBlock();
}
$a_tpl->setCurrentBlock("prop_generic");
$a_tpl->setVariable("PROP_GENERIC", $tpl->get());
$a_tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilBackgroundImageInputGUI::setImages (   $a_images)

Set Images.

Parameters
array$a_imagesImages

Definition at line 72 of file class.ilBackgroundImageInputGUI.php.

Referenced by ilObjStyleSheetGUI\initTagStyleForm().

{
$this->images = $a_images;
}

+ Here is the caller graph for this function:

ilBackgroundImageInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

Definition at line 52 of file class.ilBackgroundImageInputGUI.php.

Referenced by checkInput(), and setValueByArray().

{
$this->value = $a_value;
}

+ Here is the caller graph for this function:

ilBackgroundImageInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 170 of file class.ilBackgroundImageInputGUI.php.

References ilFormPropertyGUI\getPostVar(), and setValue().

{
global $ilUser;
if ($a_values[$this->getPostVar()]["type"] == "internal")
{
$this->setValue($a_values[$this->getPostVar()]["int_value"]);
}
else
{
$this->setValue($a_values[$this->getPostVar()]["ext_value"]);
}
}

+ Here is the call graph for this function:

Field Documentation

ilBackgroundImageInputGUI::$value
protected

Definition at line 33 of file class.ilBackgroundImageInputGUI.php.

Referenced by getValue(), and insert().


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