Exemple #1
0
	<?php 
    if ($this->errors['body']) {
        ?>
<tr><td></td><td class='fst_must_have_field'><?php 
        echo $this->errors['body'];
        ?>
</td></tr><?php 
    }
    ?>
		<tr>
			<th><?php 
    echo JText::_('COMMENT_BODY');
    ?>
&nbsp;</th>
			<td colspan=2><textarea name='body' rows='5' cols='40' id='comment_body'><?php 
    echo FST_Helper::escape($this->post['body']);
    ?>
</textarea></td>
		</tr>
		
		<?php 
    if ($this->captcha) {
        ?>
		<?php 
        if ($this->errors['captcha']) {
            ?>
<tr><td></td><td class='fst_must_have_field'><?php 
            echo $this->errors['captcha'];
            ?>
</td></tr><?php 
        }
Exemple #2
0
	<?php 
    if ($this->errors['body']) {
        ?>
<tr><td></td><td class='fst_must_have_field'><?php 
        echo $this->errors['body'];
        ?>
</td></tr><?php 
    }
    ?>
		<tr>
			<th><?php 
    echo JText::_('COMMENT_BODY');
    ?>
&nbsp;</th>
			<td colspan=2><textarea name='body' rows='5' cols='40' id='comment_body'><?php 
    echo FST_Helper::escape($this->comment['body']);
    ?>
</textarea></td>
		</tr>
		<tr>
			<td></td>
			<td>
			<input type=submit value='<?php 
    echo JText::_('SAVE_COMMENT');
    ?>
' id='addcomment'>
				<input type=submit value='<?php 
    echo JText::_('CANCEL');
    ?>
' id='canceledit' uid='<?php 
    echo $this->uid;
Exemple #3
0
 static function FieldInput(&$field, &$errors, $errortype = "ticket", $context = array())
 {
     $output = "";
     $id = $field['id'];
     $userid = 0;
     if (array_key_exists('userid', $context)) {
         $userid = $context['userid'];
     }
     $ticketid = 0;
     if (array_key_exists('ticketid', $context)) {
         $ticketid = $context['ticketid'];
     }
     // if its a per user field, try to load the value
     $current = $field['default'];
     if ($field['peruser'] && $errortype == "ticket") {
         $uservalues = FSTCF::GetUserValues($userid, $ticketid);
         if (array_key_exists($field['id'], $uservalues)) {
             $current = $uservalues[$field['id']]['value'];
         }
     }
     $current = JRequest::getVar("custom_{$id}", $current);
     if ($field['type'] == "text") {
         $aparams = FSTCF::GetValues($field);
         $text_max = $aparams['text_max'];
         $text_size = $aparams['text_size'];
         $output = "<input name='custom_{$id}' id='custom_{$id}' value=\"" . FST_Helper::escape($current) . "\" maxlength='{$text_max}' size='{$text_size}'>\n";
     }
     if ($field['type'] == "radio") {
         $values = FSTCF::GetValues($field);
         $output = "";
         if (count($values) > 0) {
             foreach ($values as $value) {
                 $output .= "<input type='radio' id='custom_{$id}' name='custom_{$id}' value=\"" . FST_Helper::escape($value) . "\"";
                 if ($value == $current) {
                     $output .= " checked";
                 }
                 $output .= ">{$value}<br>\n";
             }
         }
     }
     if ($field['type'] == "combo") {
         $values = FSTCF::GetValues($field);
         $output = "<select name='custom_{$id}' id='custom_{$id}'>\n";
         $output .= "<option value=''>" . JText::_("PLEASE_SELECT") . "</option>\n";
         if (count($values) > 0) {
             foreach ($values as $value) {
                 $output .= "<option value=\"" . FST_Helper::escape($value) . "\"";
                 if ($value == $current) {
                     $output .= " selected";
                 }
                 $output .= ">{$value}</option>\n";
             }
         }
         $output .= "</select>";
     }
     if ($field['type'] == "area") {
         $aparams = FSTCF::GetValues($field);
         $area_width = $aparams['area_width'];
         $area_height = $aparams['area_height'];
         $output = "<textarea name='custom_{$id}' id='custom_{$id}' cols='{$area_width}' rows='{$area_height}' style='width:95%'>{$current}</textarea>\n";
     }
     if ($field['type'] == "checkbox") {
         $output = "<input type='checkbox' name='custom_{$id}' id='custom_{$id}'";
         if ($current == "on") {
             $output .= " checked";
         }
         $output .= ">\n";
     }
     if ($field['type'] == "plugin") {
         $aparams = FSTCF::GetValues($field);
         $plugin = FSTCF::get_plugin($aparams['plugin']);
         $output = $plugin->Input($current, $aparams['plugindata'], $context, $id);
     }
     $id = "custom_" . $field['id'];
     if (array_key_exists($id, $errors)) {
         if ($errortype == "ticket") {
             $output .= '<div class="fst_ticket_error" id="error_subject">' . $errors[$id] . '</div>';
         } else {
             $output .= '</td><td class="fst_must_have_field">' . $errors[$id];
         }
     }
     return $output;
 }