ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMatrixRowWizardInputGUI Class Reference

This class represents a survey question category wizard property in a property form. More...

+ Inheritance diagram for ilMatrixRowWizardInputGUI:
+ Collaboration diagram for ilMatrixRowWizardInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor.
 getUseOtherAnswer ()
 setUseOtherAnswer ($a_value)
 setValue ($a_value)
 Set Value.
 setValues ($a_values)
 Set Values.
 getValues ()
 Get Values.
 setAllowMove ($a_allow_move)
 Set allow move.
 getAllowMove ()
 Get allow move.
 setShowWizard ($a_value)
 getShowWizard ()
 setCategoryText ($a_text)
 getCategoryText ()
 setLabelText ($a_text)
 getLabelText ()
 setShowSavePhrase ($a_value)
 getShowSavePhrase ()
 checkInput ()
 Check input, strip slashes etc.
 insert (&$a_tpl)
 Insert property html.
- Public Member Functions inherited from ilTextInputGUI
 getValue ()
 Get Value.
 setValidationFailureMessage ($a_msg)
 Set message string for validation failure.
 getValidationFailureMessage ()
 setValidationRegexp ($a_value)
 Set validation regexp.
 getValidationRegexp ()
 Get validation regexp.
 setMaxLength ($a_maxlength)
 Set Max Length.
 getMaxLength ()
 Get Max Length.
 setSize ($a_size)
 Set Size.
 setInlineStyle ($a_style)
 Set inline style.
 getInlineStyle ()
 Get inline style.
 setCssClass ($a_class)
 getCssClass ()
 setValueByArray ($a_values)
 Set value by array.
 getSize ()
 Get Size.
 setSuffix ($a_value)
 Set suffix.
 getSuffix ()
 Get suffix.
 setInputType ($a_type)
 set input type
 getInputType ()
 get input type
 setSubmitFormOnEnter ($a_val)
 Set submit form on enter.
 getSubmitFormOnEnter ()
 Get submit form on enter.
 getDataSource ()
 get datasource link for YUI autocomplete
 setDataSource ($href)
 set datasource link for YUI autocomplete
 getDataSourceSchema ()
 get datasource schema for YUI autocomplete
 setDataSourceSchema ($ds)
 set datasource schema for YUI autocomplete
 getDataSourceResultFormat ()
 get data result format callback for YUI autocomplete
 setDataSourceResultFormat ($callback)
 set data result format callback for YUI autocomplete
 setDataSourceDelimiter ($ar)
 set data delimiter array
 getDataSourceDelimiter ()
 get data delimiter array
 getTableFilterHTML ()
 Get HTML for table filter.
 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

 $values = array()
 $allowMove = false
 $show_wizard = false
 $show_save_phrase = false
 $categorytext
 $labeltext
 $use_other_answer
- Protected Attributes inherited from ilTextInputGUI
 $value
 $maxlength = 200
 $size = 40
 $validationRegexp
 $validationFailureMessage = ''
 $suffix
 $style_css
 $css_class
 $yui_dataSource
 $yui_dataSchema
 $yui_formatCallback
 $yui_delimiterarray = array()
 $submit_form_on_enter = false
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 $title
 $postvar
 $info
 $alert
 $required = false
 $parentgui
 $parentform
 $hidden_title = ""

Additional Inherited Members

- Protected Member Functions inherited from ilTextInputGUI
 render ($a_mode="")
 Render item.

Detailed Description

This class represents a survey question category wizard property in a property form.

Author
Helmut Schottmüller ilias.nosp@m.@aur.nosp@m.ealis.nosp@m..de
Version
Id:
class.ilMatrixRowWizardInputGUI.php 23642 2010-04-26 12:31:50Z hschottm

Definition at line 31 of file class.ilMatrixRowWizardInputGUI.php.

Constructor & Destructor Documentation

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilTextInputGUI.

Definition at line 47 of file class.ilMatrixRowWizardInputGUI.php.

References $lng.

{
parent::__construct($a_title, $a_postvar);
global $lng;
$this->show_wizard = false;
$this->show_save_phrase = false;
$this->categorytext = $lng->txt('answer');
$this->use_other_answer = false;
}

Member Function Documentation

ilMatrixRowWizardInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilTextInputGUI.

Definition at line 173 of file class.ilMatrixRowWizardInputGUI.php.

References $_POST, $lng, ilSubEnabledFormPropertyGUI\checkSubItemsInput(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), and ilUtil\stripSlashesRecursive().

{
global $lng;
if (is_array($_POST[$this->getPostVar()])) $_POST[$this->getPostVar()] = ilUtil::stripSlashesRecursive($_POST[$this->getPostVar()]);
$foundvalues = $_POST[$this->getPostVar()];
if (is_array($foundvalues))
{
// check answers
if (is_array($foundvalues['answer']))
{
foreach ($foundvalues['answer'] as $idx => $answervalue)
{
if (((strlen($answervalue)) == 0) && ($this->getRequired() && (!$foundvalues['other'][$idx])))
{
$this->setAlert($lng->txt("msg_input_is_required"));
return FALSE;
}
}
}
}
else
{
$this->setAlert($lng->txt("msg_input_is_required"));
return FALSE;
}
return $this->checkSubItemsInput();
}

+ Here is the call graph for this function:

ilMatrixRowWizardInputGUI::getAllowMove ( )

Get allow move.

Returns
boolean Allow move

Definition at line 123 of file class.ilMatrixRowWizardInputGUI.php.

References $allowMove.

Referenced by insert().

{
}

+ Here is the caller graph for this function:

ilMatrixRowWizardInputGUI::getCategoryText ( )

Definition at line 143 of file class.ilMatrixRowWizardInputGUI.php.

References $categorytext.

Referenced by insert().

{
}

+ Here is the caller graph for this function:

ilMatrixRowWizardInputGUI::getLabelText ( )

Definition at line 153 of file class.ilMatrixRowWizardInputGUI.php.

References $labeltext.

Referenced by insert().

{
}

+ Here is the caller graph for this function:

ilMatrixRowWizardInputGUI::getShowSavePhrase ( )

Definition at line 163 of file class.ilMatrixRowWizardInputGUI.php.

References $show_save_phrase.

Referenced by insert().

+ Here is the caller graph for this function:

ilMatrixRowWizardInputGUI::getShowWizard ( )

Definition at line 133 of file class.ilMatrixRowWizardInputGUI.php.

References $show_wizard.

Referenced by insert().

{
}

+ Here is the caller graph for this function:

ilMatrixRowWizardInputGUI::getUseOtherAnswer ( )

Definition at line 57 of file class.ilMatrixRowWizardInputGUI.php.

References $use_other_answer.

Referenced by insert().

+ Here is the caller graph for this function:

ilMatrixRowWizardInputGUI::getValues ( )

Get Values.

Returns
array Values

Definition at line 103 of file class.ilMatrixRowWizardInputGUI.php.

References $values.

{
return $this->values;
}
ilMatrixRowWizardInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

Reimplemented from ilTextInputGUI.

Definition at line 207 of file class.ilMatrixRowWizardInputGUI.php.

References $lng, $tpl, getAllowMove(), getCategoryText(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilUtil\getImagePath(), getLabelText(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getPostVar(), getShowSavePhrase(), getShowWizard(), ilTextInputGUI\getSize(), getUseOtherAnswer(), ilYuiUtil\initDomEvent(), and ilUtil\prepareFormOutput().

{
global $lng;
$tpl = new ilTemplate("tpl.prop_matrixrowwizardinput.html", true, true, "Modules/SurveyQuestionPool");
$i = 0;
if (is_object($this->values))
{
for ($i = 0; $i < $this->values->getCategoryCount(); $i++)
{
$cat = $this->values->getCategory($i);
$tpl->setCurrentBlock("prop_text_propval");
$tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($cat->title));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("prop_label_propval");
$tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($cat->label));
$tpl->parseCurrentBlock();
if ($this->getUseOtherAnswer())
{
$tpl->setCurrentBlock("other_answer_checkbox");
$tpl->setVariable("POST_VAR", $this->getPostVar());
$tpl->setVariable("OTHER_ID", $this->getPostVar() . "[other][$i]");
$tpl->setVariable("ROW_NUMBER", $i);
if ($cat->other)
{
$tpl->setVariable("CHECKED_OTHER", ' checked="checked"');
}
$tpl->parseCurrentBlock();
}
if ($this->getAllowMove())
{
$tpl->setCurrentBlock("move");
$tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
$tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
$tpl->setVariable("ID", $this->getPostVar() . "[$i]");
$tpl->setVariable("UP_BUTTON", ilUtil::getImagePath('a_up.gif'));
$tpl->setVariable("DOWN_BUTTON", ilUtil::getImagePath('a_down.gif'));
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock("row");
$class = ($i % 2 == 0) ? "even" : "odd";
if ($i == 0) $class .= " first";
if ($i == $this->values->getCategoryCount()-1) $class .= " last";
$tpl->setVariable("ROW_CLASS", $class);
$tpl->setVariable("POST_VAR", $this->getPostVar());
$tpl->setVariable("ROW_NUMBER", $i);
$tpl->setVariable("ID", $this->getPostVar() . "[answer][$i]");
$tpl->setVariable("ID_LABEL", $this->getPostVar() . "[label][$i]");
$tpl->setVariable("SIZE", $this->getSize());
$tpl->setVariable("SIZE_LABEL", 15);
$tpl->setVariable("MAXLENGTH", $this->getMaxLength());
if ($this->getDisabled())
{
$tpl->setVariable("DISABLED", " disabled=\"disabled\"");
$tpl->setVariable("DISABLED_LABEL", " disabled=\"disabled\"");
}
$tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]");
$tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]");
$tpl->setVariable("ADD_BUTTON", ilUtil::getImagePath('edit_add.png'));
$tpl->setVariable("REMOVE_BUTTON", ilUtil::getImagePath('edit_remove.png'));
$tpl->parseCurrentBlock();
}
}
if ($this->getShowWizard())
{
$tpl->setCurrentBlock("wizard");
$tpl->setVariable("CMD_WIZARD", 'cmd[wizard' . $this->getFieldId() . ']');
$tpl->setVariable("WIZARD_BUTTON", ilUtil::getImagePath('wizard.png'));
$tpl->setVariable("WIZARD_TEXT", $lng->txt('add_phrase'));
$tpl->parseCurrentBlock();
}
if ($this->getShowSavePhrase())
{
$tpl->setCurrentBlock('savephrase');
$tpl->setVariable("POST_VAR", $this->getPostVar());
$tpl->setVariable("VALUE_SAVE_PHRASE", $lng->txt('save_phrase'));
$tpl->parseCurrentBlock();
}
if ($this->getUseOtherAnswer())
{
$tpl->setCurrentBlock('other_answer_title');
$tpl->setVariable("OTHER_TEXT", $lng->txt('use_other_answer'));
$tpl->parseCurrentBlock();
}
$tpl->setVariable("ELEMENT_ID", $this->getPostVar());
$tpl->setVariable("ANSWER_TEXT", $this->getCategoryText());
$tpl->setVariable("LABEL_TEXT", $this->getLabelText());
$tpl->setVariable("ACTIONS_TEXT", $lng->txt('actions'));
$a_tpl->setCurrentBlock("prop_generic");
$a_tpl->setVariable("PROP_GENERIC", $tpl->get());
$a_tpl->parseCurrentBlock();
global $tpl;
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
$tpl->addJavascript("./Modules/SurveyQuestionPool/templates/default/matrixrowwizard.js");
}

+ Here is the call graph for this function:

ilMatrixRowWizardInputGUI::setAllowMove (   $a_allow_move)

Set allow move.

Parameters
boolean$a_allow_moveAllow move

Definition at line 113 of file class.ilMatrixRowWizardInputGUI.php.

{
$this->allowMove = $a_allow_move;
}
ilMatrixRowWizardInputGUI::setCategoryText (   $a_text)

Definition at line 138 of file class.ilMatrixRowWizardInputGUI.php.

{
$this->categorytext = $a_text;
}
ilMatrixRowWizardInputGUI::setLabelText (   $a_text)

Definition at line 148 of file class.ilMatrixRowWizardInputGUI.php.

{
$this->labeltext = $a_text;
}
ilMatrixRowWizardInputGUI::setShowSavePhrase (   $a_value)

Definition at line 158 of file class.ilMatrixRowWizardInputGUI.php.

{
$this->show_save_phrase = $a_value;
}
ilMatrixRowWizardInputGUI::setShowWizard (   $a_value)

Definition at line 128 of file class.ilMatrixRowWizardInputGUI.php.

{
$this->show_wizard = $a_value;
}
ilMatrixRowWizardInputGUI::setUseOtherAnswer (   $a_value)

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

{
$this->use_other_answer = ($a_value) ? true : false;
}
ilMatrixRowWizardInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

Reimplemented from ilTextInputGUI.

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

References ilTextInputGUI\$value.

{
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyCategories.php";
$this->values = new SurveyCategories();
if (is_array($a_value))
{
if (is_array($a_value['answer']))
{
foreach ($a_value['answer'] as $index => $value)
{
$this->values->addCategory($value, $a_value['other'][$index]);
}
}
}
}
ilMatrixRowWizardInputGUI::setValues (   $a_values)

Set Values.

Parameters
array$a_valueValue

Definition at line 93 of file class.ilMatrixRowWizardInputGUI.php.

{
$this->values = $a_values;
}

Field Documentation

ilMatrixRowWizardInputGUI::$allowMove = false
protected

Definition at line 34 of file class.ilMatrixRowWizardInputGUI.php.

Referenced by getAllowMove().

ilMatrixRowWizardInputGUI::$categorytext
protected

Definition at line 37 of file class.ilMatrixRowWizardInputGUI.php.

Referenced by getCategoryText().

ilMatrixRowWizardInputGUI::$labeltext
protected

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

Referenced by getLabelText().

ilMatrixRowWizardInputGUI::$show_save_phrase = false
protected

Definition at line 36 of file class.ilMatrixRowWizardInputGUI.php.

Referenced by getShowSavePhrase().

ilMatrixRowWizardInputGUI::$show_wizard = false
protected

Definition at line 35 of file class.ilMatrixRowWizardInputGUI.php.

Referenced by getShowWizard().

ilMatrixRowWizardInputGUI::$use_other_answer
protected

Definition at line 39 of file class.ilMatrixRowWizardInputGUI.php.

Referenced by getUseOtherAnswer().

ilMatrixRowWizardInputGUI::$values = array()
protected

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

Referenced by getValues().


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