当前位置: 首页>>代码示例>>PHP>>正文


PHP htmlentities_compat函数代码示例

本文整理汇总了PHP中htmlentities_compat函数的典型用法代码示例。如果您正苦于以下问题:PHP htmlentities_compat函数的具体用法?PHP htmlentities_compat怎么用?PHP htmlentities_compat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了htmlentities_compat函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 . ' />' . ' &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 . ' />';
     }
 }
开发者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 . ' />&nbsp;' . $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> &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>';
        }
    }
开发者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


注:本文中的htmlentities_compat函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。