Exemplo n.º 1
0
 function onSubmit($vals)
 {
     // 1. prepare vals for insertion
     if ($vals['contact_url'] == 'http://') {
         $vals['contact_url'] = '';
     }
     if ($vals['loc_map'] == 'http://') {
         $vals['loc_map'] = '';
     }
     $vals['details'] = nl2br(wordwrap(htmlentities_compat($vals['details']), 70, "\n", true));
     if (!$vals['public'] || empty($vals['public'])) {
         $vals['public'] = 'no';
     }
     if (!$vals['media'] || empty($vals['media'])) {
         $vals['media'] = 'no';
     }
     if (!empty($vals['loc_addr2'])) {
         $vals['loc_address'] .= "\n" . $vals['loc_addr2'];
     }
     $data = array('title' => $vals['title'], 'date' => $vals['date'], 'until_date' => $vals['end_date'], 'time' => $vals['time'], 'until_time' => $vals['end_time'], 'category' => $vals['category'], 'audience' => $vals['audience'], 'details' => $vals['details'], 'contact' => $vals['contact'], 'contact_email' => $vals['contact_email'], 'contact_phone' => $vals['contact_phone'], 'contact_url' => $vals['contact_url'], 'loc_name' => $vals['loc_name'], 'loc_address' => $vals['loc_address'], 'loc_city' => $vals['loc_city'], 'loc_province' => $vals['loc_province'], 'loc_country' => $vals['loc_country'], 'sponsor' => $vals['sponsor'], 'rsvp' => $vals['rsvp'], 'public' => $vals['public'], 'media' => $vals['media'], 'sitellite_status' => 'draft', 'sitellite_access' => 'public');
     if (session_valid()) {
         $data['sitellite_owner'] = session_username();
         $data['sitellite_team'] = session_team();
     }
     // 2. submit event as 'draft'
     loader_import('cms.Versioning.Rex');
     $rex = new Rex('siteevent_event');
     $res = $rex->create($data, 'Event submission.');
     $vals['id'] = $res;
     // 3. email notification
     @mail(appconf('submissions'), 'Event Submission Notice', template_simple('submission_email.spt', $vals));
     // 4. thank you screen
     page_title(intl_get('Thank You!'));
     echo template_simple('submissions.spt');
 }
Exemplo n.º 2
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     parent::display($generate_html);
     global $intl, $simple;
     $attrstr = $this->getAttrs();
     $len = $this->length > 0 ? 'maxlength="' . $this->length . '" ' : '';
     if ($generate_html) {
         return "\t" . '<tr>' . "\n\t\t" . '<td class="label"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field"><input type="text" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" ' . $len . $this->extra . ' />' . ' &nbsp; <a href="#" onclick="window.open (\'' . site_prefix() . '/index/siteinvoice-currencies-action?sel=\' + document.forms[0].elements.' . $this->name . '.value, \'CurrencyWindow\', \'top=100,left=100,width=300,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,fullscreen=no\'); return false">Currency List</a>' . '</td>' . "\n\t" . '</tr>' . "\n";
     } else {
         return '<input type="text" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" ' . $this->extra . ' />';
     }
 }
Exemplo n.º 3
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     global $intl;
     if ($this->reference !== false) {
         $colspan = 3;
     } else {
         $colspan = 2;
     }
     if ($generate_html) {
         return "\t" . '<tr>' . "\n\t\t" . '<td colspan="' . $colspan . '" align="center" class="submit"><input type="submit" name="' . $this->name . '" value="' . htmlentities_compat($this->value, ENT_COMPAT, $intl->charset) . '" ' . $this->extra . ' /></td>' . "\n\t" . '</tr>' . "\n";
     } else {
         return '<input type="submit" name="' . $this->name . '" value="' . htmlentities_compat($this->value, ENT_COMPAT, $intl->charset) . '" ' . $this->extra . ' />';
     }
 }
Exemplo n.º 4
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     global $intl;
     $attrstr = $this->getAttrs();
     if ($generate_html) {
         return "\t" . '<tr>' . "\n\t\t" . '<td class="label"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $this->display_value . '</label></td>' . "\n\t\t" . '<td class="field"><input type="password" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" ' . $this->extra . ' /></td>' . "\n\t" . '</tr>' . "\n";
     } else {
         return '<input type="password" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" ' . $this->extra . ' />';
     }
 }
Exemplo n.º 5
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     global $simple;
     if ($this->setPath && $this->path) {
         session_set('filechooser_path', $this->path);
     }
     // initialize modal dialog event handlers
     static $included = false;
     if (!$included) {
         page_onclick('checkModal ()');
         page_onfocus('return checkModal ()');
         $included = true;
     }
     $attrstr = $this->getAttrs();
     if ($generate_html) {
         return "\t" . '<tr>' . "\n\t\t" . '<td class="label"><label for="' . $this->name . '"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field"><input type="text" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value) . '" ' . $this->extra . ' />&nbsp;' . $this->_link() . '</td>' . "\n\t" . '</tr>' . "\n";
     } else {
         return '<input type="file" ' . $attrstr . ' value="" ' . $this->extra . ' />';
     }
 }
Exemplo n.º 6
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     global $intl;
     $attrstr = $this->getAttrs();
     if ($generate_html) {
         return "\t" . '<tr>' . "\n\t\t" . '<td colspan="2" align="center"><input type="reset" ' . $attrstr . ' value="' . htmlentities_compat($this->value, ENT_COMPAT, $intl->charset) . '" ' . $this->extra . ' /></td>' . "\n\t" . '</tr>' . "\n";
     } else {
         return '<input type="reset" ' . $attrstr . ' value="' . htmlentities_compat($this->value, ENT_COMPAT, $intl->charset) . '" ' . $this->extra . ' />';
     }
 }
Exemplo n.º 7
0
 /**
  * Returns the given result object represented as XML.
  * $root_node allows you to specify the name of the root node of
  * the XML structure.
  * 
  * @access	public
  * @param	object	$data_obj
  * @param	string	$root_node
  * @return	string
  * 
  */
 function toXML($data_obj, $root_node = 'row')
 {
     if (is_object($data_obj)) {
         $xml = "<{$root_node}>\n";
         foreach (get_object_vars($data_obj) as $key => $value) {
             $value = htmlentities_compat($value);
             $xml .= "\t<{$key}>{$value}</{$key}>\n";
         }
         return $xml . "</{$root_node}>\n";
     } else {
         return false;
     }
 }
Exemplo n.º 8
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     global $intl;
     if (!isset($this->data_value)) {
         $this->data_value = $this->default_value;
     }
     $this->attrstr = $this->getAttrs();
     $this->invalid = $this->invalid();
     $this->attrstr = str_replace('"' . $this->name . '"', '"' . $this->name . '[]"', $this->attrstr);
     $this->values = split(',', $this->data_value);
     $vals = $this->values;
     if ($generate_html) {
         if ($this->align == 'vertical') {
             if ($this->columns == 1) {
                 return template_simple($this->_vertical_template, $this);
             } elseif ($this->columns == 2) {
                 list($this->value1, $this->value2) = array_chunk($this->value, ceil(count($this->value) / 2), true);
                 return template_simple($this->_vertical_template2, $this);
             } elseif ($this->columns == 3) {
                 list($this->value1, $this->value2, $this->value3) = array_chunk($this->value, ceil(count($this->value) / 3), true);
                 return template_simple($this->_vertical_template3, $this);
             } elseif ($this->columns == 4) {
                 list($this->value1, $this->value2, $this->value3, $this->value4) = array_chunk($this->value, ceil(count($this->value) / 4), true);
                 return template_simple($this->_vertical_template4, $this);
             }
         } else {
             return template_simple($this->_horizontal_template, $this);
         }
         /*
         $data = "\t<tr>\n\t\t" . '<td colspan="2">';
         if (! empty ($this->display_value)) {
         	$data .= '<fieldset><legend' . $this->invalid () . '>' . $this->display_value . '</legend>';
         }
         $data .= "\n";
         foreach ($this->value as $value => $display) {
         	if (in_array ($value, $vals)) {
         		$selected = ' checked="checked"';
         	} else {
         		$selected = '';
         	}
         	$data .= TABx3 . '<input type="checkbox" name="' . $this->name . '[]" value="' . htmlentities_compat ($value, ENT_COMPAT, $intl->charset) . '"' . $selected . ' ' . $this->extra . ' /><label for="' . $this->name . '[]">' . $display . '</label><br />' . "\n";
         }
         $data .= TABx2;
         if (! empty ($this->display_value)) {
         	$data .= '</fieldset>';
         }
         return $data . '</td>' . "\n\t" . '</tr>' . "\n";
         */
     } else {
         $data = '';
         foreach ($this->value as $value => $display) {
             if (in_array($value, $vals)) {
                 $selected = ' checked="checked"';
             } else {
                 $selected = '';
             }
             $data .= '<input type="checkbox" name="' . $this->name . '[]" value="' . htmlentities_compat($value, ENT_COMPAT, $intl->charset) . '"' . $selected . ' ' . $this->extra . ' /><label for="' . $this->name . '[]">' . $display . '</label><br />' . "\n";
         }
         return $data;
     }
 }
Exemplo n.º 9
0
    /**
     * Returns the display HTML for this widget.  The optional
     * parameter determines whether or not to automatically display the widget
     * nicely, or whether to simply return the widget (for use in a template).
     * 
     * @access	public
     * @param	boolean	$generate_html
     * @return	string
     * 
     */
    function display($generate_html = 0)
    {
        global $intl, $simple;
        if (!isset($this->data_value)) {
            $this->data_value = $this->default_value;
        }
        $this->value = $this->getTemplates();
        $attrstr = $this->getAttrs();
        if ($generate_html) {
            $data = "\t" . '<tr>' . "\n\t\t" . '<td class="label"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field"><select ' . $attrstr . ' ' . $this->extra . ' >' . "\n";
            foreach ($this->value as $value => $display) {
                if ($value == 'admin') {
                    continue;
                }
                $display = str_replace('_', ' ', ucwords($display));
                if ($value == $this->data_value) {
                    $selected = ' selected="selected"';
                } else {
                    $selected = '';
                }
                $data .= "\t" . '<option value="' . $value . '"' . $selected . '>' . $display . '</option>' . "\n";
            }
            $data .= '</select> &nbsp; ';
            $data .= '<script language="javascript" type="text/javascript">
				function preview_template (f) {
					o = f.elements.' . $this->name . '.options[f.elements.' . $this->name . '.selectedIndex].value;
					if (o.length == 0) {
						w = window.open (\'' . site_prefix() . '/index/cms-templatepreview-action?tpl=' . conf('Server', 'default_template') . '\', \'TemplatePreview\', \'top=50,left=50,height=500,width=780,resizable=yes,scrollbars=yes\');
					} else {
						w = window.open (\'' . site_prefix() . '/index/cms-templatepreview-action?tpl=\' + o, \'TemplatePreview\', \'top=50,left=50,height=500,width=780,resizable=yes,scrollbars=yes\');
					}
					return false;
				}
			</script><input type="submit" value="' . intl_get('Preview Template') . '" onclick="return preview_template (this.form)" />';
            $data .= '</td>' . "\n\t" . '</tr>' . "\n";
            return $data;
        } else {
            $data = '<select ' . $attrstr . ' ' . $this->extra . ' >' . "\n";
            foreach ($this->value as $value => $display) {
                $display = str_replace('_', ' ', ucwords($display));
                if ($value == $this->data_value) {
                    $selected = ' selected="selected"';
                } else {
                    $selected = '';
                }
                $data .= "\t" . '<option value="' . htmlentities_compat($value, ENT_COMPAT, $intl->charset) . '"' . $selected . '>' . $display . '</option>' . "\n";
            }
            return $data . '</select>';
        }
    }
Exemplo n.º 10
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     global $intl;
     if (!isset($this->data_value)) {
         $this->data_value = $this->default_value;
     }
     $vals = split(',', $this->data_value);
     if ($generate_html) {
         $data = "\t" . '<tr>' . "\n\t\t" . '<td valign="top" class="label"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $this->display_value . '</label></td>' . "\n\t\t" . '<td class="field"><select name="' . $this->name . '[]" multiple="multiple" size="' . $this->size . '" ' . $this->extra . ' >' . "\n";
         foreach ($this->value as $value => $display) {
             if (in_array($value, $vals)) {
                 $selected = ' selected="selected"';
             } else {
                 $selected = '';
             }
             $data .= "\t" . '<option value="' . htmlentities_compat($value, ENT_COMPAT, $intl->charset) . '"' . $selected . '>' . $display . '</option>' . "\n";
         }
         return $data . '</select></td>' . "\n\t" . '</tr>' . "\n";
     } else {
         $data = '<select name="' . $this->name . '[]" multiple="multiple" size="' . $this->size . '" ' . $this->extra . ' >' . "\n";
         foreach ($this->value as $value => $display) {
             if (in_array($value, $vals)) {
                 $selected = ' selected="selected"';
             } else {
                 $selected = '';
             }
             $data .= "\t" . '<option value="' . htmlentities_compat($value, ENT_COMPAT, $intl->charset) . '"' . $selected . '>' . $display . '</option>' . "\n";
         }
         return $data . '</select>';
     }
 }
Exemplo n.º 11
0
/**
 * Returns a bar that displays "Highlighting Search Terms: a, b, c <Search Again>".
 *
 * @param string
 * @param string
 * @return string
 * @package Misc
 */
function search_bar($query, $url = '/index/sitellite-search-action')
{
    return '
	<p><table border="0" cellpadding="0" cellspacing="0" width="100%">
		<tr>
			<td style="background-color: #feb; padding: 3px; margin-top: 20px; color: #444; border-bottom: 1px solid #777">
				' . intl_get('Highlighting Search Terms') . ': <strong>' . htmlentities_compat($query) . '</strong>
			</td>

			<td align="right" style="background-color: #feb; padding: 3px; margin-top: 20px; text-align: right; border-bottom: 1px solid #777">
				<a style="color: #444;" href="' . site_prefix() . $url . '">' . intl_get('Search Again') . '</a>
			</td>
		</tr>
	</table></p>' . NEWLINEx2;
}
Exemplo n.º 12
0
    /**
     * Returns the display HTML for this widget.  The optional
     * parameter determines whether or not to automatically display the widget
     * nicely, or whether to simply return the widget (for use in a template).
     * 
     * @access	public
     * @param	boolean	$generate_html
     * @return	string
     * 
     */
    function display($generate_html = 0)
    {
        parent::display($generate_html);
        global $intl, $simple;
        if ($this->cols == '') {
            $this->cols = 40;
        }
        if ($this->rows == '') {
            $this->rows = 8;
        }
        $attrstr = $this->getAttrs();
        if ($generate_html) {
            static $script = false;
            if (!$script) {
                $out = '<script language="javascript" type="text/javascript">
					function xed_wysiwyg_popup (f, field_name) {
						form_name = "' . $this->form->name . '";
						window.open ("' . site_prefix() . '/index/xed-editor-action?template=' . $this->template . '&form_name=" + form_name + "&field_name=" + field_name + "&body=" + f.elements[field_name].value, "wysiwygEditor", "top=50,left=50,height=550,width=700,resizable=yes");
						return false;
					}
				</script>';
                $script = true;
            } else {
                $out = '';
            }
            if ($this->labelPosition == 'left') {
                return $out . "\n\t" . '<tr>' . "\n\t\t" . '<td class="label" valign="top"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field"><textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea><br />' . '<input type="submit" value="' . intl_get('WYSIWYG Editor') . '" onclick="return xed_wysiwyg_popup (this.form, \'' . $this->name . '\')" /></td>' . "\n\t" . '</tr>' . "\n";
            } else {
                return $out . "\n\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="label"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t" . '</tr>' . "\n\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="field"><textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea><br />' . '<input type="submit" value="' . intl_get('WYSIWYG Editor') . '" onclick="return xed_wysiwyg_popup (this.form, \'' . $this->name . '\')" /></td>' . "\n\t" . '</tr>' . "\n";
            }
        } else {
            return '<textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea>';
        }
    }
Exemplo n.º 13
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     global $intl, $simple;
     if (!isset($this->data_value)) {
         $this->data_value = $this->default_value;
     }
     $attrstr = $this->getAttrs();
     if (empty($this->data_value)) {
         $this->data_value = session_team();
     }
     if (empty($this->owner)) {
         $this->owner = $this->getOwner($this->owner);
     }
     if (session_role() == 'master') {
         // allow all
         $this->value = assocify(session_get_teams());
     } elseif (session_username() == $this->owner) {
         // allow specific ones
         $this->value = assocify(session_allowed_teams_list(true));
     } else {
         // show info instead
         loader_import('saf.MailForm.Widget.Info');
         $info = new MF_Widget_info($this->name);
         $info->extra = $this->extra;
         $info->setValue($this->data_value);
         return $info->display($generate_html);
     }
     asort($this->value);
     $adv = $this->advanced ? ' class="advanced"' : '';
     if ($generate_html) {
         $data = "\t" . '<tr' . $adv . '>' . "\n\t\t" . '<td class="label"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field"><select ' . $attrstr . ' ' . $this->extra . ' >' . "\n";
         foreach ($this->value as $value => $display) {
             $display = str_replace('_', ' ', ucwords($display));
             if ($value == $this->data_value) {
                 $selected = ' selected="selected"';
             } else {
                 $selected = '';
             }
             $data .= "\t" . '<option value="' . $value . '"' . $selected . '>' . $display . '</option>' . "\n";
         }
         return $data . '</select></td>' . "\n\t" . '</tr>' . "\n";
     } else {
         $data = '<select ' . $attrstr . ' ' . $this->extra . ' >' . "\n";
         foreach ($this->value as $value => $display) {
             $display = str_replace('_', ' ', ucwords($display));
             if ($value == $this->data_value) {
                 $selected = ' selected="selected"';
             } else {
                 $selected = '';
             }
             $data .= "\t" . '<option value="' . htmlentities_compat($value, ENT_COMPAT, $intl->charset) . '"' . $selected . '>' . $display . '</option>' . "\n";
         }
         return $data . '</select>';
     }
 }
Exemplo n.º 14
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     parent::display($generate_html);
     global $intl, $simple;
     $attrstr = $this->getAttrs();
     if (empty($this->data_value)) {
         if (empty($this->default_value)) {
             $this->data_value = session_username();
         } else {
             $this->data_value = $this->default_value;
         }
     }
     $adv = $this->advanced ? ' class="advanced"' : '';
     if ($generate_html) {
         return "\t" . '<tr' . $adv . '>' . "\n\t\t" . '<td class="label"><label for="' . $this->name . '"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field"><strong>' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</strong><input type="hidden" name="' . $this->name . '" value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" /></td>' . "\n\t" . '</tr>' . "\n";
     } else {
         return '<input type="text" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" ' . $this->extra . ' />';
     }
 }
Exemplo n.º 15
0
 }
 $row = $rex->getCurrent($row->{$rex->key});
 if (empty($row->{$rex->info['Collection']['title_field']})) {
     $row->{$rex->info['Collection']['title_field']} = $row->{$rex->key};
 }
 $tmp = new StdClass();
 foreach ($data['headers'] as $field) {
     $tmp->{$field->name} = $row->{$field->name};
     if ($data['fields'][$field->name]['filter']) {
         $filter = $data['fields'][$field->name]['filter'];
         $tmp->{$field->name} = $filter($tmp->{$field->name});
     } elseif ($data['fields'][$field->name]['virtual']) {
         $virtual = $data['fields'][$field->name]['virtual'];
         $tmp->{$field->name} = $virtual($row);
     } else {
         $tmp->{$field->name} = htmlentities_compat($tmp->{$field->name});
     }
     $align[$field->name] = $data['fields'][$field->name]['align'] ? $data['fields'][$field->name]['align'] : 'left';
     $width[$field->name] = $data['fields'][$field->name]['width'] ? $data['fields'][$field->name]['width'] : 'auto';
     if (isset($rex->info['browse:' . $field->name]['length']) && strlen($tmp->{$field->name}) > $rex->info['browse:' . $field->name]['length']) {
         $tmp->{$field->name} = rtrim(substr($tmp->{$field->name}, 0, $rex->info['browse:' . $field->name]['length'] - 3)) . '...';
     }
 }
 if (!isset($row->{$rex->key})) {
     $pkeys = preg_split('/, ?/', $rex->key);
     $row->{$rex->key} = '';
     $sep = '';
     foreach ($pkeys as $pk) {
         $row->{$rex->key} .= $sep . $row->{$pk};
         $sep = '|';
     }
Exemplo n.º 16
0
    /**
     * Returns the display HTML for this widget.  The optional
     * parameter determines whether or not to automatically display the widget
     * nicely, or whether to simply return the widget (for use in a template).
     * 
     * @access	public
     * @param	boolean	$generate_html
     * @return	string
     * 
     */
    function display($generate_html = 0)
    {
        $data = '';
        $attrstr = $this->getAttrs();
        if ($generate_html) {
            static $includedJS = false;
            if (!$includedJS) {
                $data .= '<link rel="stylesheet" type="text/css" href="' . site_prefix() . '/js/calendar/calendar-' . $this->style . '.css" />' . NEWLINE;
                page_add_script(site_prefix() . '/js/calendar/calendar.js');
                page_add_script(site_prefix() . '/js/calendar/lang/calendar-' . $this->lang . '.js');
                page_add_script(site_prefix() . '/js/calendar/calendar-setup.js');
                $includedJS = true;
            }
            $showsTime = $this->showsTime ? 'true' : 'false';
            $adv = $this->advanced ? ' class="advanced"' : '';
            $data .= '<tr' . $adv . '>
				<td class="label"' . $this->invalid() . '>
					<label for="' . $this->name . '">' . template_simple($this->label_template, $this, '', true) . '</label>
				</td>
				<td class="field">
					<input type="hidden" name="' . $this->name . '" id="mf-calendar-' . $this->name . '" value="' . htmlentities_compat($this->data_value, ENT_COMPAT, intl_charset()) . '" ' . $attrstr . ' ' . $this->extra . ' />
					<table border="0" cellpadding="3" cellspacing="0" width="100%">
						<tr>
							<td width="50%">
								<span id="mf-calendar-' . $this->name . '-display" style="font-weight: bold">' . $this->displayValue() . '</span>
							</td>
							<td width="50%">
								<input type="submit" id="mf-calendar-' . $this->name . '-trigger" value="' . intl_get('Select Date') . '" />' . '
								&nbsp;
								<input type="submit" value="' . intl_get('Clear') . '" onclick="this.form.elements[\'' . $this->name . '\'].value = \'\'; document.getElementById(\'mf-calendar-' . $this->name . '-display\').innerHTML = \'' . intl_get('No date selected.') . '\'; return false" />
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<script language="javascript" type="text/javascript">
				Calendar.setup ({
					inputField	: "mf-calendar-' . $this->name . '",
					ifFormat	: "' . $this->format . '",
					displayArea	: "mf-calendar-' . $this->name . '-display",
					daFormat	: "' . $this->displayFormat . '",
					button		: "mf-calendar-' . $this->name . '-trigger",
					align		: "Bl",
					showsTime	: ' . $showsTime . ',
					timeFormat	: "' . $this->timeFormat . '"
				});
			</script>' . NEWLINEx2;
        } else {
            $showsTime = $this->showsTime ? 'true' : 'false';
            $data .= '<input type="text" name="' . $this->name . '" id="mf-calendar-' . $this->name . '" value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" ' . $attrstr . ' ' . $this->extra . ' />
					&nbsp;
					<input type="submit" id="mf-calendar-' . $this->name . '-trigger" value="' . intl_get('Select Date') . '" onclick="alert (\'We\\\'re sorry, but the calendar popup is not available in your browser at this time.\'); return false" />
				<script language="javascript" type="text/javascript">
				Calendar.setup (
					{
						inputField	: "mf-calendar-' . $this->name . '",	// ID of the input field
						ifFormat	: "' . $this->format . '",		// the date format
						button		: "mf-calendar-' . $this->name . '-trigger",	// ID of the button
						showsTime	: ' . $showsTime . ',
						timeFormat	: "' . $this->timeFormat . '"
					}
				);
			</script>' . NEWLINEx2;
        }
        return $data;
    }
Exemplo n.º 17
0
function siteforum_filter_htmlentities($regs)
{
    return '<code>' . htmlentities_compat($regs[1]) . '</code>';
}
Exemplo n.º 18
0
 /**
  * Renders a GUI representation of the collection's facets, which
  * can be used to perform compound searches.
  *
  * $cols may be 2 or 3.  Default is 3.
  *
  * Note: If you are seeing the text "../../cms/html/facets.spt"
  * instead of the rendered facets, make sure your app has an "html"
  * folder.
  *
  * @param integer
  * @return string
  */
 function renderFacets($cols = 3)
 {
     $data = array('bookmark' => $this->bookmark, 'facets' => array(), 'selected' => array());
     $selected = array();
     foreach ($this->facets as $k => $f) {
         $this->facets[$k]->rex =& $this;
         $r = $this->facets[$k]->getSelected();
         if ($r !== false) {
             $selected[$this->facets[$k]->field] = $r;
         }
         $r = $this->facets[$k]->render();
         if (!$r) {
             continue;
         }
         $data['facets'][$this->facets[$k]->field] = $r;
     }
     foreach ($selected as $k => $v) {
         $data['selected'][] = '<strong>' . $this->facets[$k]->display . '</strong>: ' . htmlentities_compat($this->facets[$k]->getValue($v)) . ' &nbsp;<a href="' . $this->facets[$k]->getBrowseUri() . '">[ ' . intl_get('Cancel') . ' ]</a>';
     }
     if (count($selected) > 0) {
         $data['selected'] = array_chunk_fill($data['selected'], 2, true, '&nbsp;');
     }
     if ($cols == 3) {
         $data['facets'] = array_chunk_fill($data['facets'], 3, true, '&nbsp;');
         return template_simple('facets.spt', $data);
     } elseif ($cols == 2) {
         $data['facets'] = array_chunk_fill($data['facets'], 2, true, '&nbsp;');
         return template_simple('facets_twocols.spt', $data);
     } elseif ($cols == 1) {
         $data['facets'] = array_chunk_fill($data['facets'], 1, true, '&nbsp;');
         return template_simple('facets_onecol.spt', $data);
     } else {
         $data['facets'] = array_chunk_fill($data['facets'], 3, true, '&nbsp;');
         return template_simple('facets.spt', $data);
     }
 }
Exemplo n.º 19
0
 function formatBody($txt)
 {
     $html = preg_replace('/(\\r\\n|\\n\\r|\\r|\\n)/s', '<br />\\1', htmlentities_compat($txt));
     $html = preg_replace('/(\\r\\n|\\n\\r|\\r|\\n)&gt;([^\\r\\n]*)/s', '\\1<blockquote>\\2</blockquote>', $html);
     $html = preg_replace('/<\\/blockquote>([\\r\\n]+)<blockquote>/s', '\\1', $html);
     return $html;
 }
Exemplo n.º 20
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     global $intl, $simple;
     if (!isset($this->data_value)) {
         $this->data_value = $this->default_value;
     }
     $attrstr = $this->getAttrs();
     $adv = $this->advanced ? ' class="advanced"' : '';
     if ($this->reference !== false) {
         if (empty($this->reference)) {
             $this->reference = '&nbsp;';
         }
         $ref = '<td class="reference">' . $this->reference . '</td>';
     } else {
         $ref = '';
     }
     if ($generate_html) {
         $data = "\t" . '<tr' . $adv . '>' . "\n\t\t" . '<td class="label"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field"><select ' . $attrstr . ' ' . $this->extra . ' >' . "\n";
         foreach ($this->value as $value => $display) {
             $display = str_replace('_', ' ', ucwords($display));
             if ((string) $value == (string) $this->data_value) {
                 $selected = ' selected="selected"';
             } else {
                 $selected = '';
             }
             $data .= "\t" . '<option value="' . $value . '"' . $selected . '>' . $display . '</option>' . "\n";
         }
         return $data . '</select></td>' . $ref . "\n\t" . '</tr>' . "\n";
     } else {
         $data = '<select ' . $attrstr . ' ' . $this->extra . ' >' . "\n";
         foreach ($this->value as $value => $display) {
             $display = str_replace('_', ' ', ucwords($display));
             if ((string) $value == (string) $this->data_value) {
                 $selected = ' selected="selected"';
             } else {
                 $selected = '';
             }
             $data .= "\t" . '<option value="' . htmlentities_compat($value, ENT_COMPAT, $intl->charset) . '"' . $selected . '>' . $display . '</option>' . "\n";
         }
         return $data . '</select>';
     }
 }
Exemplo n.º 21
0
function sitepoll_filter_comment_body($body)
{
    return preg_replace('|(http://[^\\r\\n\\t ]+)|is', '<a href="\\1" target="_blank">\\1</a>', str_replace(NEWLINE, '<br />' . NEWLINE, htmlentities_compat($body)));
}
Exemplo n.º 22
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     parent::display($generate_html);
     global $intl, $simple;
     if ($this->cols == '') {
         $this->cols = 40;
     }
     if ($this->rows == '') {
         $this->rows = 8;
     }
     $this->label_template = '{filter none}{display_value}{end filter}';
     $this->display_value = str_replace(array(' strong,', ' em,', ' a,', ' blockquote,', ' code)'), array(' <a href="#" onclick="return siteforum_insert_tag (\'strong\')">strong</a>,', ' <a href="#" onclick="return siteforum_insert_tag (\'em\')">em</a>,', ' <a href="#" onclick="return siteforum_insert_tag (\'a\')">a</a>,', ' <a href="#" onclick="return siteforum_insert_tag (\'blockquote\')">blockquote</a>,', ' <a href="#" onclick="return siteforum_insert_tag (\'code\')">code</a>)'), $this->display_value);
     $attrstr = $this->getAttrs();
     if ($generate_html) {
         if ($this->labelPosition == 'left') {
             return "\t" . '<tr>' . "\n\t\t" . '<td class="label" valign="top"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field"><textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea></td>' . "\n\t" . '</tr>' . "\n";
         } else {
             return "\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="label"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t" . '</tr>' . "\n\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="field"><textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea></td>' . "\n\t" . '</tr>' . "\n";
         }
     } else {
         return '<textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea>';
     }
 }
Exemplo n.º 23
0
 function render()
 {
     global $cgi;
     $out = '<form id="facet-' . $this->field . '">' . NEWLINE;
     foreach ($this->preserve as $name) {
         $out .= '<input type="hidden" name="' . $name . '" value="' . $cgi->{$name} . '" />' . NEWLINE;
     }
     foreach ($cgi->param as $k) {
         if ($k != $this->field && strpos($k, '_') === 0 && !in_array($k, $this->ignore)) {
             // assume it's a facet
             $out .= '<input type="hidden" name="' . $k . '" value="' . $cgi->{$k} . '" />' . NEWLINE;
         }
     }
     $out .= '<strong>' . intl_get($this->display) . ':</strong>' . NEWLINE . TAB . '<input type="text" name="_' . $this->field . '" value="' . htmlentities_compat($cgi->{'_' . $this->field}) . '" style="width: 125px" />' . NEWLINE . TAB . '<input type="submit" value="' . intl_get('Search') . '" />' . NEWLINE;
     $out .= '</form>' . NEWLINE;
     return $out;
 }
Exemplo n.º 24
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     parent::display($generate_html);
     global $intl, $simple;
     $attrstr = $this->getAttrs();
     if ($this->filter) {
         if ($this->filter_import) {
             loader_import($this->filter_import);
         }
         $display = call_user_func($this->filter, $this->data_value);
     } else {
         $display = $this->data_value;
     }
     $disp = $display;
     if ($this->htmlentities) {
         $disp = htmlentities_compat($disp, ENT_COMPAT, $intl->charset);
     }
     if ($generate_html) {
         return "\t" . '<tr>' . "\n\t\t" . '<td class="label" valign="top"><label for="' . $this->name . '"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field" valign="top"><strong>' . $disp . '</strong><input type="hidden" name="' . $this->name . '" value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" ' . $this->extra . ' /></td>' . "\n\t" . '</tr>' . "\n";
     } else {
         return '<input type="text" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '" ' . $this->extra . ' />';
     }
 }
Exemplo n.º 25
0
    /**
     * Returns the display HTML for this widget.  The optional
     * parameter determines whether or not to automatically display the widget
     * nicely, or whether to simply return the widget (for use in a template).
     * 
     * @access	public
     * @param	boolean	$generate_html
     * @return	string
     * 
     */
    function display($generate_html = 0)
    {
        global $simple;
        // initialize modal dialog event handlers
        static $included = false;
        if (!$included) {
            page_onclick('checkModal ()');
            page_onfocus('return checkModal ()');
            $included = true;
        }
        $attrstr = $this->getAttrs();
        if ($generate_html) {
            return '<tr>
				<td class="label"' . $this->invalid() . '>
					<label for="' . $this->name . '" id="' . $this->name . '-label">' . $simple->fill($this->label_template, $this, '', true) . '</label>
				</td>
				<td class="field">
					<input type="hidden" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value) . '" ' . $this->extra . ' />
					<table border="0" cellpadding="3" cellspacing="0" width="100%">
						<tr>
							<td width="60%">
								<span id="mf-pagechooser-' . pagebrowser_filter_name($this->name) . '-display" style="font-weight: bold">' . $this->displayValue($this->data_value) . '</span>
							</td>
							<td width="40%">
								' . $this->_link() . '
							</td>
						</tr>
					</table>
				</td>
			</tr>';
            //return "\t" . '<tr>' . "\n\t\t" . '<td class="label"><label for="' . $this->name . '"' . $this->invalid () . '>' . $simple->fill ($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" .
            //	'<td class="field"><input type="hidden" ' . $attrstr . ' value="' . htmlentities_compat ($this->data_value) . '" ' . $this->extra . ' />&nbsp;' . $this->_link () . '</td>' . "\n\t" . '</tr>' . "\n";
        } else {
            return '<input type="hidden" ' . $attrstr . ' value="' . htmlentities_compat($this->data_value) . '" ' . $this->extra . ' />
				<table border="0" cellpadding="0" cellspacing="0" width="100%">
					<tr>
						<td width="50%">
							<span id="mf-pagechooser-' . pagebrowser_filter_name($this->name) . '-display" style="font-weight: bold">' . $this->displayValue($this->data_value) . '</span>
						</td>
						<td width="50%" align="right">
							' . $this->_link() . '
						</td>
					</tr>
				</table>';
        }
    }
Exemplo n.º 26
0
    $original = '';
}
if (!empty($parameters['ifname'])) {
    // called as an rpc service, return the cleaned data via saf.Misc.RPC
    //loader_import ('saf.Misc.RPC');
    //echo rpc_response ($parameters['ifname'], $parameters['data']);
    $parameters['data'] = the_cleaners($parameters[$parameters['ifname']]);
    $parameters['data'] = preg_replace("/(\r\n|\n\r|\r|\n)/", "'\n\t\t+ '\\n", addslashes($parameters['data']));
    $parameters['data'] = str_replace('</script>', '</\' + \'script>', $parameters['data']);
    page_template('dialog');
    page_title(intl_get('Document has been cleaned.'));
    page_add_script(template_simple('clean_reply.spt', $parameters));
    echo '<p><a href="#" onclick="window.close ()">' . intl_get('Close Window') . '</a></p>';
    return;
} elseif ($parameters['ws'] == 'true') {
    // called as a web service, return the cleaned data only
    echo $parameters['data'];
    exit;
}
echo '<h1>Cleaners Test</h1>
<form method="post">
<p>Please enter some HTML to clean:</p>
<p><textarea name="data" cols="100" rows="20">' . htmlentities_compat($original) . '</textarea></p>
<p><input type="submit" value="Clean!" /></p>';
if (!empty($parameters['data'])) {
    echo '<hr />
<p>I have washed your HTML, sir:</p>
<p><textarea name="original" cols="100" rows="20">' . htmlentities_compat($parameters['data']) . '</textarea></p>';
}
echo '</form>';
exit;
Exemplo n.º 27
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     global $intl, $simple;
     if (!isset($this->data_value)) {
         $this->data_value = $this->default_value;
     }
     if ($generate_html) {
         $data = "\t" . '<tr>' . "\n\t\t" . '<td valign="top" class="label"><label for="' . $this->name . '"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field"><table border="0" cellpadding="0" cellspacing="0"><tr><td class="item"><select name="' . $this->name . '" size="' . $this->size . '" ' . $this->extra . ' >' . "\n";
         foreach ($this->value as $value => $display) {
             if ($value == $this->data_value) {
                 $selected = ' selected="selected"';
             } else {
                 $selected = '';
             }
             $data .= "\t" . '<option value="' . $value . '"' . $selected . '>' . $display . '</option>' . "\n";
         }
         return $data . '</select></td><td class="item">' . $this->buttons() . '</td></tr></table></td>' . "\n\t" . '</tr>' . "\n";
     } else {
         $data = '<table border="0" cellpadding="0" cellspacing="0"><tr><td class="field"><select name="' . $this->name . '" size="' . $this->size . '" ' . $this->extra . ' >' . "\n";
         foreach ($this->value as $value => $display) {
             if ($value == $this->data_value) {
                 $selected = ' selected="selected"';
             } else {
                 $selected = '';
             }
             $data .= "\t" . '<option value="' . htmlentities_compat($value, ENT_COMPAT, $intl->charset) . '"' . $selected . '>' . $display . '</option>' . "\n";
         }
         return $data . '</select></td><td class="field">' . $this->buttons() . '</td></tr></table>';
     }
 }
Exemplo n.º 28
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     parent::display($generate_html);
     global $intl, $simple;
     if ($this->cols == '') {
         $this->cols = 40;
     }
     if ($this->rows == '') {
         $this->rows = 8;
     }
     $attrstr = $this->getAttrs();
     if ($generate_html) {
         if ($this->labelPosition == 'left') {
             return "\t" . '<tr>' . "\n\t\t" . '<td class="label" valign="top"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t\t" . '<td class="field"><textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea></td>' . "\n\t" . '</tr>' . "\n";
         } else {
             if (empty($this->alt)) {
                 return "\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="field"><textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea></td>' . "\n\t" . '</tr>' . "\n";
             } else {
                 return "\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="label"><label for="' . $this->name . '" id="' . $this->name . '-label"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t" . '</tr>' . "\n\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="field"><textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea></td>' . "\n\t" . '</tr>' . "\n";
             }
         }
     } else {
         return '<textarea ' . $attrstr . ' rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea>';
     }
 }
Exemplo n.º 29
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     global $simple;
     $this->options_formatted = '';
     foreach ($this->options as $k => $v) {
         $this->options_formatted .= $k . '=' . $v . ';';
     }
     // this next line relies on a properly configured browscap.ini file,
     // which can be found at http://www.cyscape.com/browscap/
     global $loader, $intl;
     $loader->import('saf.Ext.phpsniff');
     $ua = new phpSniff();
     if ($ua->property('browser') == 'ie' && $ua->property('platform') == 'win' && $ua->property('version') >= '5.5') {
         if ($generate_html) {
             return "\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="label"><label for="' . $this->name . '"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t" . '</tr>' . "\n\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="field"><textarea name="' . $this->name . '" ' . $this->extra . ' style="display:none">' . htmlentities($this->data_value) . '</textarea>' . '<object id="rt_' . $this->name . '" style="BACKGROUND-COLOR: buttonface" data="' . $this->directory . '/richedit.html" width="' . $this->width . '" height="' . $this->height . '" type="text/x-scriptlet" VIEWASTEXT></object></td>' . "\n\t" . '</tr>' . $simple->fill($this->js, $this) . "\n";
         } else {
             return '<textarea name="' . $this->name . '" ' . $this->extra . ' style="display:none">' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea>' . '<object id="rt_' . $this->name . '" style="BACKGROUND-COLOR: buttonface" data="' . $this->directory . '/richedit.html" width="' . $this->width . '" height="' . $this->height . '" type="text/x-scriptlet" VIEWASTEXT></object>' . $simple->fill($this->js, $this);
         }
     } else {
         if ($this->cols == '') {
             $this->cols = 40;
         }
         if ($this->rows == '') {
             $this->rows = 8;
         }
         if ($generate_html) {
             return "\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="label"><label for="' . $this->name . '"' . $this->invalid() . '>' . $simple->fill($this->label_template, $this, '', true) . '</label></td>' . "\n\t" . '</tr>' . "\n\t" . '<tr>' . "\n\t\t" . '<td colspan="2" class="field"><textarea name="' . $this->name . '" rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities($this->data_value) . '</textarea></td>' . "\n\t" . '</tr>' . "\n";
         } else {
             return '<textarea name="' . $this->name . '" rows="' . $this->rows . '" cols="' . $this->cols . '" ' . $this->extra . ' >' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea>';
         }
     }
 }
Exemplo n.º 30
0
<p><a href="http://groups.google.com/group/sitellite" target="_blank">http://groups.google.com/group/sitellite</a></p>

<p>You can also view our commercial support options here:</p>

<p><a href="http://www.simian.ca/" target="_blank">http://www.simian.ca/</a></p>

<p>Please click "Next" to continue whenever you are ready, and on behalf of
<a href="http://www.simian.ca/" target="_blank">Simian Systems</a> and the entire <a href="http://www.sitellite.org/" target="_blank">Sitellite community</a>,
thanks for your interest in Sitellite and welcome to the neighbourhood!</p>';
        break;
    case 1:
        $data['step'] = 1;
        $data['next_step'] = 2;
        $data['title'] = 'License';
        $data['next'] = 'Requirements';
        $data['body'] = '<div style="font-size: 11px; height: 350px; width: 548px; overflow: auto; border: 1px solid #eee"><pre>' . htmlentities_compat(@join('', @file('inc/LICENSE'))) . '</pre></div>' . '<p style="float: right; padding-right: 30px; padding-top: 5px"><input type="radio" name="agree" value="yes" /> I agree<br />' . '<input type="radio" name="agree" value="no" checked="checked" /> I do not agree</p>';
        if ($cgi->agree == 'no') {
            $data['body'] .= '<script language="javascript" type="text/javascript">
				alert (\'You must agree to the license to continue the installation.\');
			</script>';
        }
        break;
    case 2:
        if ($cgi->agree == 'no') {
            header('Location: ?step=1&agree=no');
            exit;
        }
        loader_import('ext.phpsniff');
        $ua = new phpSniff();
        if (PHP_VERSION < '4.2') {
            // requires php 4.2+