本文整理汇总了PHP中htmlentities_compat函数 的典型用法代码示例。如果您正苦于以下问题:PHP htmlentities_compat函数的具体用法?PHP htmlentities_compat怎么用?PHP htmlentities_compat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了htmlentities_compat函数 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: onSubmit
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');
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:35, 代码来源:index.php
示例2: display
/**
* 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 . ' />' . ' <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 . ' />';
}
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:22, 代码来源:Currencies.php
示例3: display
/**
* 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 . ' />';
}
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:24, 代码来源:Submit.php
示例4: display
/**
* 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 . ' />';
}
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:20, 代码来源:Password.php
示例5: display
/**
* 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 . ' /> ' . $this->_link() . '</td>' . "\n\t" . '</tr>' . "\n";
} else {
return '<input type="file" ' . $attrstr . ' value="" ' . $this->extra . ' />';
}
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:30, 代码来源:Filechooser.php
示例6: display
/**
* 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 . ' />';
}
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:20, 代码来源:Reset.php
示例7: toXML
/**
* 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;
}
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:24, 代码来源:Query.php
示例8: display
/**
* 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;
}
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:71, 代码来源:Checkbox.php
示例9: display
/**
* 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> ';
$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>';
}
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:60, 代码来源:Templates.php
示例10: display
/**
* 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>';
}
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:41, 代码来源:Multiple.php
示例11: search_bar
/**
* 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;
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:23, 代码来源:Search.php
示例12: display
/**
* 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>';
}
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:44, 代码来源:Xarea.php
示例13: display
/**
* 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>';
}
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:65, 代码来源:Team.php
示例14: display
/**
* 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 . ' />';
}
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:29, 代码来源:Owner.php
示例15: StdClass
}
$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 = '|';
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:31, 代码来源:index.php
示例16: display
/**
* 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') . '" />' . '
<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 . ' />
<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;
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:76, 代码来源:Calendar.php
示例17: siteforum_filter_htmlentities
function siteforum_filter_htmlentities($regs)
{
return '<code>' . htmlentities_compat($regs[1]) . '</code>';
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:4, 代码来源:Filters.php
示例18: renderFacets
/**
* 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)) . ' <a href="' . $this->facets[$k]->getBrowseUri() . '">[ ' . intl_get('Cancel') . ' ]</a>';
}
if (count($selected) > 0) {
$data['selected'] = array_chunk_fill($data['selected'], 2, true, ' ');
}
if ($cols == 3) {
$data['facets'] = array_chunk_fill($data['facets'], 3, true, ' ');
return template_simple('facets.spt', $data);
} elseif ($cols == 2) {
$data['facets'] = array_chunk_fill($data['facets'], 2, true, ' ');
return template_simple('facets_twocols.spt', $data);
} elseif ($cols == 1) {
$data['facets'] = array_chunk_fill($data['facets'], 1, true, ' ');
return template_simple('facets_onecol.spt', $data);
} else {
$data['facets'] = array_chunk_fill($data['facets'], 3, true, ' ');
return template_simple('facets.spt', $data);
}
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:49, 代码来源:Rex.php
示例19: formatBody
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)>([^\\r\\n]*)/s', '\\1<blockquote>\\2</blockquote>', $html);
$html = preg_replace('/<\\/blockquote>([\\r\\n]+)<blockquote>/s', '\\1', $html);
return $html;
}
开发者ID:vojtajina, 项目名称:sitellite, 代码行数:7, 代码来源:Message.php
GitbookIO/gitbook:
阅读:944| 2022-08-17
链塔小程序本周优化说明
●优化报告分类,用户可以快速定位所需报告
●报告页面优化
阅读:566| 2022-07-18
juleswhite/mobile-cloud-asgn1
阅读:1015| 2022-08-30
The OpenSSL 3.0.4 release introduced a serious bug in the RSA implementation for
阅读:708| 2022-07-08
kyamagu/matlab-json: Use official API: https://mathworks.com/help/matlab/json-fo
阅读:912| 2022-08-17
书名:墙壁眼睛膝盖 作者:温柔一刀 类别:欲望丛林,饮食男女。 簡介:Wall(我)Eye(爱)Kn
阅读:646| 2022-11-06
sevenjay/cpp-markdown: Cpp-Markdown is a freely-available Markdown text-to-HTML
阅读:569| 2022-08-18
mathjax/MathJax-i18n: MathJax localization
阅读:382| 2022-08-16
星座名称 黄道带时间(一般认知) 恒星时间 太阳所在星座时间 对应的农历节气 白羊座
阅读:581| 2022-07-30
众所周知,我们的身份证号码里面包含的信息有很多,如出生日期、性别和识别码等,如果
阅读:245| 2022-11-06
请发表评论