Пример #1
0
function form_input($type, $name, $values = array(), array $errors = array(), array $attributes = array(), $class = '')
{
    $class .= error_class($errors, $name);
    $html = '<input type="' . $type . '" name="' . $name . '" id="form-' . $name . '" ' . form_value($values, $name) . ' class="' . $class . '" ';
    $html .= implode(' ', $attributes) . '/>';
    if (in_array('required', $attributes)) {
        $html .= '<span class="form-required">*</span>';
    }
    $html .= error_list($errors, $name);
    return $html;
}
Пример #2
0
<div id="terms-data" class="block">
  <h3><?php 
echo __('Terms & Conditions');
?>
</h3>
  <?php 
echo $invoiceForm['terms']->render(array('class' => 'terms ' . error_class($invoiceForm['terms'])));
?>

  <h3><?php 
echo __('Notes');
?>
</h3>
  <?php 
echo $invoiceForm['notes']->render(array('class' => 'notes ' . error_class($invoiceForm['notes'])));
?>
</div>
<?php

echo $form['country']->renderRow(array('class' => error_class($form['country'])));
Пример #4
0
/**
 * prints out the form if necessary
 */
function print_the_form($errors = array(), $fields = null)
{
    ?>
	<form method="post" action="#" validate>
		<div class="row">
			<div class="col-xs-12  col-sm-4">
				<div class="form-group<?php 
    error_class('name', $errors);
    ?>
">
					<label class="text-dark  control-label" for="name">Name <span class="warning">*</span></label>
					<input type="text" id="name" name="name" class="form-control  form-control--contact" value="<?php 
    inpt_value('name', $fields);
    ?>
" required>
				</div>
				<div class="form-group<?php 
    error_class('email', $errors);
    ?>
">
					<label class="text-dark  control-label" for="email">E-mail <span class="warning">*</span></label>
					<input type="text" id="email" name="email" class="form-control  form-control--contact" value="<?php 
    inpt_value('email', $fields);
    ?>
" required>
				</div>
				<div class="form-group<?php 
    error_class('subject', $errors);
    ?>
">
					<label class="text-dark  control-label" for="subject">Subject <span class="warning">*</span></label>
					<input type="text" id="subject" name="subject" class="form-control  form-control--contact" value="<?php 
    inpt_value('subject', $fields);
    ?>
" required>
				</div>
				<span class="hidden-xs">Fields marked with <span class="warning">*</span> are obligatory</span>
			</div>
			<div class="col-xs-12  col-sm-8">
				<div class="form-group<?php 
    error_class('message', $errors);
    ?>
">
					<label class="text-dark  control-label" for="message">Message <span class="warning">*</span></label>
					<textarea class="form-control  form-control--contact  form-control--big" id="message" name="message" rows="12" required><?php 
    inpt_value('message', $fields);
    ?>
</textarea>
				</div>
				<div class="right">
					<input type="hidden" value="1" name="submit" />
					<button type="submit" class="btn  btn-warning">Send now</button>
				</div>
			</div>
		</div>
	</form>
	<?php 
}
Пример #5
0
function error_die($error_number, $file_location)
{
    //Here I am provided the error details about its message and number used
    //You can change it according to your needs
    //This is our reporting system
    $error_details = array(1 => "File doesn't Available at the location Provided", 2 => "File Exists at the location but Class is not available in File");
    //Change the error number to report in developer correctly
    $new_error_number = array(1 => 5, 2 => 20);
    $new_error_message = array(5 => 'File is not Available at Current Location', 20 => 'Kindly Provide the correct location of Class or Create a New Class', 25 => 'Kindly Provide the Correct Number of Error Reporting');
    //Provided your reporting system and call according to it.
    if (isset($new_error_number[$error_number])) {
        //Calling your error function
        error_class($new_error_number[$error_number], $file_location, $new_error_message[$new_error_number[$error_number]]);
    } else {
        error_class(25, __FILE__, $new_error_message[25]);
    }
}
Пример #6
0
/** 
 * Returns a sfFormField rendered according to Siwapp specs. that is:
 * @param sfFormField or wrapper
 * @param array html attributes
 * @return string
 * @author JoeZ <*****@*****.**>
 */
function render_tag($field, $attrs = array())
{
    $attrs['class'] = isset($attrs['class']) ? $attrs['class'] . ' ' . error_class($field) : error_class($field);
    $attrs['title'] = $field->renderHelp();
    return $field->render($attrs) . $field->renderError();
}
Пример #7
0
        <a id="addNewSeries" href="#" class="to:seriess"><?php 
echo __('Add a new series value');
?>
</a><br/>
        <?php 
echo __('The initial value will only be used for the first saved invoice of the series if there are no invoices assigned.');
?>
      </small>
    </fieldset>
    
    <fieldset class="left">
      <h3><?php 
echo __('PDF Settings');
?>
</h3>
      <ul>
        <?php 
echo $form['pdf_size']->renderRow(array('class' => error_class($form['pdf_size'])));
?>
        <?php 
echo $form['pdf_orientation']->renderRow(array('class' => error_class($form['pdf_orientation'])));
?>
      </ul>
    </fieldset>
    
    <?php 
include_partial('submit');
?>
  </form>
</div>
Пример #8
0
/**
 * prints out the form if necessary
 */
function print_the_form($errors = array(), $fields = null)
{
    ?>
 
    					<!--  = contact form =  -->
    					<form method="post" action="#" class="form form-inline form-contact">
                            <div class="control-group push-down-20<?php 
    error_class('name', $errors);
    ?>
">
                                <input type="text" aria-required="true" tabindex="1" size="30" value="<?php 
    inpt_value('name', $fields);
    ?>
" id="name" name="name" required>
                                <label for="name" class="control-label">Name<span class="red-clr bold">*</span></label>
                                <?php 
    show_error('name', $errors);
    ?>
                            </div>
                            
                            <div class="control-group push-down-20<?php 
    error_class('email', $errors);
    ?>
">
                                <input type="email" aria-required="true" tabindex="2" size="30" value="<?php 
    inpt_value('email', $fields);
    ?>
" id="email" name="email" required>
                                <label for="email">Mail<span class="red-clr bold">*</span></label>
                                <?php 
    show_error('email', $errors);
    ?>
                            </div>
                            
                            <div class="control-group push-down-20<?php 
    error_class('url', $errors);
    ?>
">
                                <input type="text" tabindex="3" size="30" value="<?php 
    inpt_value('url', $fields);
    ?>
" id="url" name="url">
                                <label for="url">Website</label>
                                <?php 
    show_error('url', $errors);
    ?>
                            </div>
    
                            <div class="control-group push-down-20<?php 
    error_class('message', $errors);
    ?>
">
                                <textarea class="input-block-level" tabindex="4" rows="7" cols="70" id="message" name="message" placeholder="Your Message goes here ..." required><?php 
    inpt_value('message', $fields);
    ?>
</textarea>
                                <?php 
    show_error('message', $errors);
    ?>
                            </p>
                            <p>
                                <input type="hidden" value="1" name="submit" />
                                <button class="btn btn-primary bold" type="submit" tabindex="5" id="submit">SEND EMAIL</button>
                            </p>
                        </form>
                        <!--  = /contact form =  -->

	
	<?php 
}
Пример #9
0
      <h3><?php 
echo __('Translate the application');
?>
</h3>
      <ul>
        <?php 
echo $form['language']->renderRow(array('class' => error_class($form['language'])));
?>
      </ul>
      <ul id="country_container"></ul>
    </fieldset>
    
    <fieldset class="left">
      <h3><?php 
echo __('Make it easy');
?>
</h3>
      <ul>
        <?php 
echo $form['nb_display_results']->renderRow(array('class' => error_class($form['nb_display_results'])));
echo $form['search_filter']->renderRow(array('class' => error_class($form['search_filter'])));
echo $form['series']->renderRow(array('class' => error_class($form['series'])));
?>
      </ul>
    </fieldset>
    
    <?php 
include_partial('submit');
?>
  </form>
</div>