예제 #1
0
 static function errorMessage($message, $name = '', $attributes = array())
 {
     if (!isset($attributes['class'])) {
         $attributes['class'] = 'error-message';
     }
     if (!$message) {
         if (!isset($attributes['style'])) {
             $attributes['style'] = '';
         }
         $attributes['style'] .= ';display:none;';
     }
     if ($name != '' && !isset($attributes['id'])) {
         //Warning: This doesn't work with page with multiple forms
         $attributes['id'] = 'error-message-' . $name;
     }
     $message = HtmlHelper::escape($message);
     $attributes = HtmlHelper::formatAttributes($attributes);
     return "<div {$attributes}>{$message}</div>";
 }
예제 #2
0
 final function open($attributes = array())
 {
     $html_id = $this->_id;
     if (isset($attributes['id'])) {
         $html_id = $attributes['id'];
         unset($attributes['id']);
     }
     $attributes = HtmlHelper::formatAttributes($attributes);
     $validation_script = '';
     if ($this->_client_validation_enabled) {
         $this->enableClientValidation();
         $validation_script = HtmlHelper::inlineJavascript("Phaxsi.Validator.Current = Phaxsi.Validator.List['{$html_id}'] = new Phaxsi.Validator.Manager('{$html_id}');\r\n" . "Phaxsi.Validator.DefaultErrorMessages = " . JsonHelper::encode(Validator::getDefaultErrorMessages()) . ";");
         $this->_javascript .= HtmlHelper::inlineJavascript("Phaxsi.Validator.Current.attachToSubmit();");
     }
     #For xhtml strict compliance
     $target_str = $this->_target == '_self' ? '' : 'target="' . $this->_target . '"';
     return "<form id=\"{$html_id}\" accept-charset=\"" . $this->_charset . "\" action=\"" . HtmlHelper::escape($this->_action) . "\" method=\"{$this->_method}\"  {$attributes} {$target_str} enctype=\"{$this->_enc_type}\">\r\n" . $validation_script;
 }
예제 #3
0
 static function paragraph($text, $attributes = "")
 {
     $att = HtmlHelper::formatAttributes($attributes);
     return preg_replace("/\\b.+/", '<p ' . $att . '>$0</p>', $text);
 }
예제 #4
0
<div class="viewer">
	
	<?php 
foreach ($rows as $row) {
    ?>
		<table class="main">
			<tr>
				<?php 
    foreach ($row as $i => $section) {
        ?>
					<td class="section <?php 
        echo $i == 0 ? 'first' : '';
        ?>
" <?php 
        echo HtmlHelper::formatAttributes($section['attributes']);
        ?>
>

						<?php 
        if (!empty($section['title'])) {
            ?>
							<h3><?php 
            echo $section['title'];
            ?>
</h3>
						<?php 
        }
        ?>

						<?php