function backend_keywords($name, $input = null, $options = array(), $methode = null) { $keywords = getVal($input, $methode, $name); if ($keywords) { $keywords = substr($keywords, 1, -1); $keywords = str_replace('][', ',', $keywords) . ','; } $keywordsArr = explode(",", $keywords); $code = '<div id="keywordsStock" style="width:325px">'; foreach ($keywordsArr as $key) { $keyObj = Document::getDocumentInstance($key); if ($keyObj = Document::getDocumentInstance($key)) { $code .= '<div id="key_' . $key . '" class="s" onclick="removeKeyword(\'' . $key . '\')">' . $keyObj->getLabel() . '</div>'; } } $code .= '</div>'; $code .= input_hidden_tag($name, $keywords, array('id' => 'keywords')); $code .= '<br><div style="clear:both"></div>'; $code .= getDivLabel($options, $name); if ($options['size']) { $size = $options['size']; } else { $size = 50; } $code .= '<input type="text" id="keyword" autocomplete="off" size="' . $size . '" onfocus="document.getElementById(\'fk\').style.display = \'none\'" onkeyup="getKeywords(this.value, document.getElementById(\'fk\'))">  <input type="button" value="' . $options['btnLabel'] . '" onclick="addKeyword(document.getElementById(\'keyword\').value)"><div id="fk"></div>'; return $code; }
function frontend_date($name, $input = null, $options = array(), $methode = null) { $context = sfContext::getInstance(); $request = $context->getRequest(); $errors = $request->getErrors(); if (array_key_exists("err" . $name, $errors)) { $options["class"] .= " error"; } $errSpan = ""; $code = getDivLabel($options, $name); if (in_array('validate', $options)) { $errSpan = "<span id='" . $name . "Error'></span>"; } $code .= input_date_tag($name, getVal($input, $methode, $name), clearOptions($options)); $code .= $errSpan; return $code; }