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

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

+ Inheritance diagram for ilCategoryWizardInputGUI:
+ Collaboration diagram for ilCategoryWizardInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor.
 setShowNeutralCategory ($a_value)
 getShowNeutralCategory ()
 setNeutralCategory ($a_text)
 getNeutralCategory ()
 setNeutralCategoryScale ($a_scale)
 getNeutralCategoryScale ()
 setNeutralCategoryTitle ($a_title)
 getNeutralCategoryTitle ()
 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 ()
 setShowSavePhrase ($a_value)
 getShowSavePhrase ()
 getDisabledScale ()
 setDisabledScale ($a_value)
 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.
 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 Member Functions

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

Protected Attributes

 $values = array()
 $allowMove = false
 $disabled_scale = true
 $show_wizard = false
 $show_save_phrase = false
 $categorytext
 $show_neutral_category = false
 $neutral_category
 $neutral_category_title
 $neutral_category_scale
- Protected Attributes inherited from ilTextInputGUI
 $value
 $maxlength = 200
 $size = 40
 $validationRegexp
 $validationFailureMessage = ''
 $suffix
 $style_css
 $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

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.ilCategoryWizardInputGUI.php 23300 2010-03-21 21:21:48Z hschottm

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

Constructor & Destructor Documentation

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilTextInputGUI.

Definition at line 50 of file class.ilCategoryWizardInputGUI.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');
}

Member Function Documentation

ilCategoryWizardInputGUI::calcNeutralCategoryScale ( )
protected

Definition at line 59 of file class.ilCategoryWizardInputGUI.php.

Referenced by insert().

{
if (is_object($this->values))
{
return $this->values->getCategoryCount()+1;
}
else
{
return 99;
}
}

+ Here is the caller graph for this function:

ilCategoryWizardInputGUI::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 221 of file class.ilCategoryWizardInputGUI.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 $answervalue)
{
if (((strlen($answervalue)) == 0) && ($this->getRequired()))
{
$this->setAlert($lng->txt("msg_input_is_required"));
return FALSE;
}
}
}
// check neutral column
if (array_key_exists('neutral', $foundvalues))
{
if ((strlen($foundvalues['neutral']) == 0) && ($this->getRequired))
{
$this->setAlert($lng->txt("msg_input_is_required"));
return false;
}
}
/*
if (is_array($foundvalues['scale']))
{
foreach ($foundvalues['scale'] as $scale)
{
if ((strlen($scale)) == 0)
{
$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:

ilCategoryWizardInputGUI::getAllowMove ( )

Get allow move.

Returns
boolean Allow move

Definition at line 171 of file class.ilCategoryWizardInputGUI.php.

References $allowMove.

Referenced by insert().

{
}

+ Here is the caller graph for this function:

ilCategoryWizardInputGUI::getCategoryText ( )

Definition at line 191 of file class.ilCategoryWizardInputGUI.php.

References $categorytext.

Referenced by insert().

{
}

+ Here is the caller graph for this function:

ilCategoryWizardInputGUI::getDisabledScale ( )

Definition at line 206 of file class.ilCategoryWizardInputGUI.php.

References $disabled_scale.

Referenced by insert().

{
}

+ Here is the caller graph for this function:

ilCategoryWizardInputGUI::getNeutralCategory ( )

Definition at line 86 of file class.ilCategoryWizardInputGUI.php.

References $neutral_category.

Referenced by insert().

+ Here is the caller graph for this function:

ilCategoryWizardInputGUI::getNeutralCategoryScale ( )

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

References $neutral_category_scale.

Referenced by insert().

+ Here is the caller graph for this function:

ilCategoryWizardInputGUI::getNeutralCategoryTitle ( )

Definition at line 106 of file class.ilCategoryWizardInputGUI.php.

References $neutral_category_title.

Referenced by insert().

+ Here is the caller graph for this function:

ilCategoryWizardInputGUI::getShowNeutralCategory ( )

Definition at line 76 of file class.ilCategoryWizardInputGUI.php.

References $show_neutral_category.

Referenced by insert().

+ Here is the caller graph for this function:

ilCategoryWizardInputGUI::getShowSavePhrase ( )

Definition at line 201 of file class.ilCategoryWizardInputGUI.php.

References $show_save_phrase.

Referenced by insert().

+ Here is the caller graph for this function:

ilCategoryWizardInputGUI::getShowWizard ( )

Definition at line 181 of file class.ilCategoryWizardInputGUI.php.

References $show_wizard.

Referenced by insert().

{
}

+ Here is the caller graph for this function:

ilCategoryWizardInputGUI::getValues ( )

Get Values.

Returns
array Values

Definition at line 151 of file class.ilCategoryWizardInputGUI.php.

References $values.

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

Insert property html.

Returns
int Size

Reimplemented from ilTextInputGUI.

Definition at line 277 of file class.ilCategoryWizardInputGUI.php.

References $lng, $tpl, calcNeutralCategoryScale(), getAllowMove(), getCategoryText(), ilFormPropertyGUI\getDisabled(), getDisabledScale(), ilFormPropertyGUI\getFieldId(), ilUtil\getImagePath(), ilTextInputGUI\getMaxLength(), getNeutralCategory(), getNeutralCategoryScale(), getNeutralCategoryTitle(), ilFormPropertyGUI\getPostVar(), getShowNeutralCategory(), getShowSavePhrase(), getShowWizard(), ilTextInputGUI\getSize(), ilYuiUtil\initDomEvent(), and ilUtil\prepareFormOutput().

{
global $lng;
$tpl = new ilTemplate("tpl.prop_categorywizardinput.html", true, true, "Modules/SurveyQuestionPool");
$i = 0;
if (is_object($this->values))
{
for ($i = 0; $i < $this->values->getCategoryCount(); $i++)
{
$tpl->setCurrentBlock("prop_text_propval");
$tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->values->getCategory($i)));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("prop_scale_propval");
$tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->values->getScale($i)));
$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("SIZE", $this->getSize());
$tpl->setVariable("MAXLENGTH", $this->getMaxLength());
if ($this->getDisabled())
{
$tpl->setVariable("DISABLED", " disabled=\"disabled\"");
}
$tpl->setVariable("SCALE_ID", $this->getPostVar() . "[scale][$i]");
if ($this->getDisabledScale())
{
$tpl->setVariable("DISABLED_SCALE", " 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->getShowNeutralCategory())
{
if (strlen($this->getNeutralCategory()))
{
$tpl->setCurrentBlock("prop_text_neutral_propval");
$tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getNeutralCategory()));
$tpl->parseCurrentBlock();
}
if (strlen($this->getNeutralCategoryTitle()))
{
$tpl->setCurrentBlock("neutral_category_title");
$tpl->setVariable("CATEGORY_TITLE", ilUtil::prepareFormOutput($this->getNeutralCategoryTitle()));
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock("prop_scale_neutral_propval");
$scale = (strlen($this->getNeutralCategoryScale())) ? $this->getNeutralCategoryScale() : $this->calcNeutralCategoryScale();
$tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($scale));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock('neutral_row');
$tpl->setVariable("POST_VAR", $this->getPostVar());
$tpl->setVariable("ID", $this->getPostVar() . "_neutral");
$tpl->setVariable("SIZE", $this->getSize());
$tpl->setVariable("MAXLENGTH", $this->getMaxLength());
if ($this->getDisabled())
{
$tpl->setVariable("DISABLED", " disabled=\"disabled\"");
}
$tpl->setVariable("SCALE_ID", $this->getPostVar() . "_neutral_scale");
if ($this->getDisabledScale())
{
$tpl->setVariable("DISABLED_SCALE", " disabled=\"disabled\"");
}
$tpl->parseCurrentBlock();
}
$tpl->setVariable("ELEMENT_ID", $this->getPostVar());
$tpl->setVariable("ANSWER_TEXT", $this->getCategoryText());
$tpl->setVariable("SCALE_TEXT", $lng->txt('scale'));
$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/categorywizard.js");
}

+ Here is the call graph for this function:

ilCategoryWizardInputGUI::setAllowMove (   $a_allow_move)

Set allow move.

Parameters
boolean$a_allow_moveAllow move

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

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

Definition at line 186 of file class.ilCategoryWizardInputGUI.php.

{
$this->categorytext = $a_text;
}
ilCategoryWizardInputGUI::setDisabledScale (   $a_value)

Definition at line 211 of file class.ilCategoryWizardInputGUI.php.

{
$this->disabled_scale = $a_value;
}
ilCategoryWizardInputGUI::setNeutralCategory (   $a_text)

Definition at line 81 of file class.ilCategoryWizardInputGUI.php.

Referenced by setValue().

{
$this->neutral_category = $a_text;
}

+ Here is the caller graph for this function:

ilCategoryWizardInputGUI::setNeutralCategoryScale (   $a_scale)

Definition at line 91 of file class.ilCategoryWizardInputGUI.php.

{
$this->neutral_category_scale = $a_scale;
}
ilCategoryWizardInputGUI::setNeutralCategoryTitle (   $a_title)

Definition at line 101 of file class.ilCategoryWizardInputGUI.php.

{
$this->neutral_category_title = $a_title;
}
ilCategoryWizardInputGUI::setShowNeutralCategory (   $a_value)

Definition at line 71 of file class.ilCategoryWizardInputGUI.php.

{
$this->show_neutral_category = $a_value;
}
ilCategoryWizardInputGUI::setShowSavePhrase (   $a_value)

Definition at line 196 of file class.ilCategoryWizardInputGUI.php.

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

Definition at line 176 of file class.ilCategoryWizardInputGUI.php.

{
$this->show_wizard = $a_value;
}
ilCategoryWizardInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

Reimplemented from ilTextInputGUI.

Definition at line 116 of file class.ilCategoryWizardInputGUI.php.

References ilTextInputGUI\$value, and setNeutralCategory().

{
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);
}
}
}
if (array_key_exists('neutral', $a_value))
{
$this->setNeutralCategory($a_value['neutral']);
}
}

+ Here is the call graph for this function:

ilCategoryWizardInputGUI::setValues (   $a_values)

Set Values.

Parameters
array$a_valueValue

Definition at line 141 of file class.ilCategoryWizardInputGUI.php.

{
$this->values = $a_values;
}

Field Documentation

ilCategoryWizardInputGUI::$allowMove = false
protected

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

Referenced by getAllowMove().

ilCategoryWizardInputGUI::$categorytext
protected

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

Referenced by getCategoryText().

ilCategoryWizardInputGUI::$disabled_scale = true
protected

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

Referenced by getDisabledScale().

ilCategoryWizardInputGUI::$neutral_category
protected

Definition at line 40 of file class.ilCategoryWizardInputGUI.php.

Referenced by getNeutralCategory().

ilCategoryWizardInputGUI::$neutral_category_scale
protected

Definition at line 42 of file class.ilCategoryWizardInputGUI.php.

Referenced by getNeutralCategoryScale().

ilCategoryWizardInputGUI::$neutral_category_title
protected

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

Referenced by getNeutralCategoryTitle().

ilCategoryWizardInputGUI::$show_neutral_category = false
protected

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

Referenced by getShowNeutralCategory().

ilCategoryWizardInputGUI::$show_save_phrase = false
protected

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

Referenced by getShowSavePhrase().

ilCategoryWizardInputGUI::$show_wizard = false
protected

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

Referenced by getShowWizard().

ilCategoryWizardInputGUI::$values = array()
protected

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

Referenced by getValues().


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