Esempio n. 1
0
 /**
  * @see FormElement::renderInput()
  *
  * @param array $params
  * @return string
  */
 public function renderInput($params = null)
 {
     $html = parent::renderInput($params);
     $template = '
                     <div class="clearfix question_value_block" style="cursor:move;">
                             <span class="tag">
                                 <input type="hidden" value="{$value}">
                                 <span class="label" style="max-width:250px;overflow:hidden;">{$label}</span>
                                 <a title=' . json_encode(OW::getLanguage()->text('admin', 'remove_value')) . ' class="remove" href="javascript://"></a>
                             </span>
                     </div>';
     $template = UTIL_String::replaceVars($template, array('label' => '', 'value' => 0));
     $json = json_encode(array('tagFieldId' => $this->tag->getId(), 'dataFieldId' => $this->getId(), 'value' => $this->value, 'order' => array_keys($this->value), 'template' => $template));
     OW::getDocument()->addOnloadScript("\n            if ( !window.addInfiniteQuestionValues )\n            {\n                window.addInfiniteQuestionValues = {};\n            }\n\n            window.addInfiniteQuestionValues[" . json_encode($this->getId()) . "] = new infiniteQuestionValuesField(" . $json . "); ");
     return $html;
 }