本文整理汇总了PHP中module_security::purify_html方法的典型用法代码示例。如果您正苦于以下问题:PHP module_security::purify_html方法的具体用法?PHP module_security::purify_html怎么用?PHP module_security::purify_html使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类module_security
的用法示例。
在下文中一共展示了module_security::purify_html方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
</script>
<?php
$fieldset_data['elements']['tax'] = array('title' => 'Tax', 'fields' => array(ob_get_clean()));
$fieldset_data['elements']['currency'] = array('title' => 'Currency', 'field' => array('type' => 'select', 'options' => get_multiple('currency', '', 'currency_id'), 'name' => 'currency_id', 'value' => $job['currency_id'], 'options_array_id' => 'code'));
echo module_form::generate_fieldset($fieldset_data);
unset($fieldset_data);
if (module_config::c('job_enable_description', 1)) {
if (!module_job::can_i('edit', 'Jobs') && !$job['description']) {
// no description, no ability to edit description, don't show anything.
} else {
// can edit description
$fieldset_data = array('heading' => array('title' => _l('Job Description'), 'type' => 'h3'), 'class' => 'tableclass tableclass_form tableclass_full');
if (module_job::can_i('edit', 'Jobs')) {
$fieldset_data['elements'] = array(array('field' => array('type' => 'wysiwyg', 'name' => 'description', 'value' => $job['description'])));
} else {
$fieldset_data['elements'] = array(array('fields' => array(module_security::purify_html($job['description']))));
}
echo module_form::generate_fieldset($fieldset_data);
unset($fieldset_data);
}
}
/**** ADVANCED ***/
if (module_job::can_i('view', 'Job Advanced')) {
ob_start();
?>
<table border="0" cellspacing="0" cellpadding="2" class="tableclass tableclass_form tableclass_full">
<tbody>
<?php
if (class_exists('module_website', false) && module_website::is_plugin_enabled()) {
?>
示例2: array
$search_bar = array('elements' => array('name' => array('title' => _l('File Name / Description:'), 'field' => array('type' => 'text', 'name' => 'search[generic]', 'value' => isset($search['generic']) ? $search['generic'] : ''))));
if (class_exists('module_job', false)) {
$search_bar['elements']['job'] = array('title' => _l('Job:'), 'field' => array('type' => 'select', 'name' => 'search[job_id]', 'value' => isset($search['job_id']) ? $search['job_id'] : '', 'options' => module_job::get_jobs(), 'options_array_id' => 'name'));
}
echo module_form::search_bar($search_bar);
$table_manager = module_theme::new_table_manager();
$columns = array();
$columns['file_name'] = array('title' => 'File Name', 'callback' => function ($file) {
echo module_file::link_open($file['file_id'], true);
if (isset($file['file_url']) && strlen($file['file_url'])) {
echo ' ';
echo '<a href="' . htmlspecialchars($file['file_url']) . '">' . htmlspecialchars($file['file_url']) . '</a>';
}
}, 'cell_class' => 'row_action');
$columns['file_description'] = array('title' => 'Description', 'callback' => function ($file) {
echo module_security::purify_html($file['description']);
});
$columns['file_status'] = array('title' => 'Status', 'callback' => function ($file) {
echo nl2br(htmlspecialchars($file['status']));
});
$columns['file_size'] = array('title' => 'Size', 'callback' => function ($file) {
if ($file['bucket']) {
// how many files are under this bucket?
$search = array();
$search['bucket_parent_file_id'] = $file['file_id'];
echo _l('%s files', count(module_file::get_files($search)));
} else {
if (file_exists($file['file_path'])) {
echo module_file::format_bytes(filesize($file['file_path']));
}
}
示例3: get_form_element
//.........这里部分代码省略.........
if (isset($element['attributes'])) {
$attributes = $element['attributes'];
} else {
$attributes = array();
}
if (isset($attributes[0])) {
$new_attributes = array();
foreach ($attributes as $aid => $a) {
$new_attributes[$aid + 1] = $a;
}
$attributes = $new_attributes;
}
if (isset($attributes[$value])) {
echo $attributes[$value];
}
break;
case 'textarea':
case 'textbox':
echo nl2br(htmlspecialchars($value));
break;
case 'file':
if ($value) {
$file_data = @unserialize($value);
$file_link = 'includes/plugin_data/upload/' . $file_data['file'];
if (is_file($file_link)) {
$download_link = self::link_public_file_download($data_record['data_record_id'], $data_record['data_type_id'], $element['data_field_group_id'], $element['data_field_id']);
echo '<a href="' . $download_link . '" target="_blank">' . $file_data['name'] . '</a>';
} else {
echo 'File Not Found';
}
}
break;
case 'wysiwyg':
echo module_security::purify_html($value);
break;
case 'encrypted':
if (class_exists('module_encrypt', false)) {
ob_start();
$element['type'] = 'text';
module_form::generate_form_element($element);
$enc_html = ob_get_clean();
echo module_encrypt::parse_html_input('custom_data', $enc_html, false);
}
break;
case 'created_date_time':
echo isset($data_record['date_created']) && $data_record['date_created'] != '0000-00-00 00:00:00' ? print_date($data_record['date_created'], true) : _l('N/A');
break;
case 'created_date':
echo isset($data_record['date_created']) && $data_record['date_created'] != '0000-00-00 00:00:00' ? print_date($data_record['date_created'], false) : _l('N/A');
break;
case 'created_time':
echo isset($data_record['date_created']) && $data_record['date_created'] != '0000-00-00 00:00:00' ? date(module_config::c('time_format', 'g:ia'), strtotime($data_record['date_created'])) : _l('N/A');
break;
case 'updated_date_time':
echo isset($data_record['date_updated']) && $data_record['date_updated'] != '0000-00-00 00:00:00' ? print_date($data_record['date_updated'], true) : (isset($data_record['date_created']) && $data_record['date_created'] != '0000-00-00 00:00:00' ? print_date($data_record['date_created'], true) : _l('N/A'));
break;
case 'updated_date':
echo isset($data_record['date_updated']) && $data_record['date_updated'] != '0000-00-00 00:00:00' ? print_date($data_record['date_updated'], false) : (isset($data_record['date_created']) && $data_record['date_created'] != '0000-00-00 00:00:00' ? print_date($data_record['date_created'], false) : _l('N/A'));
break;
case 'updated_time':
echo isset($data_record['date_updated']) && $data_record['date_updated'] != '0000-00-00 00:00:00' ? date(module_config::c('time_format', 'g:ia'), strtotime($data_record['date_updated'])) : (isset($data_record['date_created']) && $data_record['date_created'] != '0000-00-00 00:00:00' ? date(module_config::c('time_format', 'g:ia'), strtotime($data_record['date_created'])) : _l('N/A'));
break;
case 'created_by':
echo isset($data_record['create_user_id']) && (int) $data_record['create_user_id'] > 0 ? module_user::link_open($data_record['create_user_id'], true) : _l('N/A');
break;
case 'updated_by':
示例4: get_replace_fields
public static function get_replace_fields($quote_id, $quote_data = false)
{
if (!$quote_data) {
$quote_data = self::get_quote($quote_id);
}
$data = array('quote_number' => htmlspecialchars($quote_data['name']), 'quote_name' => htmlspecialchars($quote_data['name']), 'project_type' => _l(module_config::c('project_name_single', 'Website')), 'print_link' => self::link_public_print($quote_id), 'quote_url' => self::link_public($quote_id), 'title' => module_config::s('admin_system_name'), 'create_date' => print_date($quote_data['date_create']));
if (isset($quote_data['customer_id']) && $quote_data['customer_id']) {
$customer_data = module_customer::get_replace_fields($quote_data['customer_id'], $quote_data['contact_user_id'] ? $quote_data['contact_user_id'] : false);
$data = array_merge($data, $customer_data);
// so we get total_amount_due and stuff.
}
$user_details = array('staff_first_name' => '', 'staff_last_name' => '', 'staff_email' => '', 'staff_phone' => '', 'staff_fax' => '', 'staff_mobile' => '');
if (isset($quote_data['user_id']) && $quote_data['user_id']) {
$user_data = module_user::get_user($quote_data['user_id'], false);
if ($user_data && $user_data['user_id'] == $quote_data['user_id']) {
$user_details = array('staff_first_name' => $user_data['name'], 'staff_last_name' => $user_data['last_name'], 'staff_email' => $user_data['email'], 'staff_phone' => $user_data['phone'], 'staff_fax' => $user_data['fax'], 'staff_mobile' => $user_data['mobile']);
}
}
$data = array_merge($data, $user_details);
foreach ($quote_data as $key => $val) {
if (strpos($key, 'date') !== false) {
$quote_data[$key] = print_date($val);
}
}
if (isset($quote_data['description'])) {
$quote_data['description'] = module_security::purify_html($quote_data['description']);
}
// $customer_data = $quote_data['customer_id'] ? module_customer::get_replace_fields($quote_data['customer_id']) : array();
// $website_data = $quote_data['website_id'] ? module_website::get_replace_fields($quote_data['website_id']) : array();
// $data = array_merge($data,$customer_data,$website_data,$quote_data);
$data = array_merge($data, $quote_data);
$website_url = $project_names = $project_names_and_url = array();
if ($quote_data['website_id']) {
$website_data = module_website::get_website($quote_data['website_id']);
if ($website_data && $website_data['website_id'] == $quote_data['website_id']) {
if (isset($website_data['url']) && $website_data['url']) {
$website_url[$website_data['website_id']] = module_website::urlify($website_data['url']);
$website_data['name_url'] = $website_data['name'] . ' (' . module_website::urlify($website_data['url']) . ')';
} else {
$website_data['name_url'] = $website_data['name'];
}
$project_names[$website_data['website_id']] = $website_data['name'];
$project_names_and_url[$website_data['website_id']] = $website_data['name_url'];
$fields = module_website::get_replace_fields($website_data['website_id'], $website_data);
foreach ($fields as $key => $val) {
if (!isset($data[$key]) || !$data[$key] && $val) {
$data[$key] = $val;
}
}
}
}
$data['website_name'] = $data['project_name'] = forum_text(count($project_names) ? implode(', ', $project_names) : '');
$data['website_name_url'] = forum_text(count($project_names_and_url) ? implode(', ', $project_names_and_url) : '');
$data['website_url'] = forum_text(count($website_url) ? implode(', ', $website_url) : '');
if (class_exists('module_group', false) && module_group::is_plugin_enabled()) {
// get the quote groups
$wg = array();
$g = array();
if ($quote_id > 0) {
$quote_data = module_quote::get_quote($quote_id);
foreach (module_group::get_groups_search(array('owner_table' => 'quote', 'owner_id' => $quote_id)) as $group) {
$g[$group['group_id']] = $group['name'];
}
/*// get the website groups
foreach(module_group::get_groups_search(array(
'owner_table' => 'website',
'owner_id' => $quote_data['website_id'],
)) as $group){
$wg[$group['group_id']] = $group['name'];
}*/
}
$data['quote_group'] = implode(', ', $g);
/*$data['website_group'] = implode(', ',$wg);*/
}
// addition. find all extra keys for this quote and add them in.
// we also have to find any EMPTY extra fields, and add those in as well.
if (class_exists('module_extra', false) && module_extra::is_plugin_enabled()) {
$all_extra_fields = module_extra::get_defaults('quote');
foreach ($all_extra_fields as $e) {
$data[$e['key']] = _l('N/A');
}
// and find the ones with values:
$extras = module_extra::get_extras(array('owner_table' => 'quote', 'owner_id' => $quote_id));
foreach ($extras as $e) {
$data[$e['extra_key']] = $e['extra'];
}
}
// also do this for customer fields
/*if($quote_data['customer_id']){
$all_extra_fields = module_extra::get_defaults('customer');
foreach($all_extra_fields as $e){
$data[$e['key']] = _l('N/A');
}
$extras = module_extra::get_extras(array('owner_table'=>'customer','owner_id'=>$quote_data['customer_id']));
foreach($extras as $e){
$data[$e['extra_key']] = $e['extra'];
}
}*/
return $data;
}
示例5: generate_form_element
//.........这里部分代码省略.........
>
<?php
break;
case 'textarea':
?>
<textarea name="<?php
echo $setting['name'];
?>
" rows="6" cols="50"<?php
echo $attributes;
?>
><?php
echo htmlspecialchars($setting['value']);
?>
</textarea>
<?php
break;
case 'wysiwyg':
self::load_wysiwyg();
?>
<?php
if (!isset($setting['options']) || !isset($setting['options']['inline']) || $setting['options']['inline']) {
?>
<div style="border:1px solid #EFEFEF;" data-name="<?php
echo $setting['name'];
?>
" <?php
echo $attributes;
?>
><?php
echo module_security::purify_html($setting['value']);
?>
</div>
<?php
if ($setting['name'] != $setting['id']) {
?>
<!-- we update this on change, needed because tinymce jquery has issues with name[] form elements -->
<input type="hidden" name="<?php
echo $setting['name'];
?>
" id="<?php
echo $setting['id'];
?>
_postback" value="<?php
echo htmlspecialchars(module_security::purify_html($setting['value']));
?>
">
<?php
}
?>
<?php
} else {
?>
<textarea name="<?php
echo $setting['name'];
?>
" rows="6" cols="50"<?php
echo $attributes;
?>
><?php
示例6: unset
$hide__ines[$line_number] = $line;
unset($print__ines[$line_number]);
} else {
// not hidden yet.
$print__ines[$line_number] = $line;
}
}
ksort($hide__ines);
ksort($print__ines);
//echo module_security::purify_html(implode("\n",$hide__ines)); echo '<hr>';
echo module_security::purify_html(implode("\n", $print__ines));
//print_r($print__ines);
if (count($hide__ines)) {
echo '<a href="#" onclick="jQuery(this).parent().find(\'div\').show(); jQuery(this).hide(); return false;">' . _l('- show quoted text -') . '</a> ';
echo '<div style="display:none;">';
echo module_security::purify_html(implode("\n", $hide__ines));
echo '</div>';
//print_r($hide__ines);
}
} else {
echo $text;
}
/*if($ticket_message['cache']=='autoreply'){
?>
</div>
<?php
}else */
if ($do_we_hide) {
?>
</div>
示例7: isset
$value = isset($data['date_updated']) && $data['date_updated'] != '0000-00-00 00:00:00' ? date(module_config::c('time_format', 'g:ia'), strtotime($data['date_updated'])) : (isset($data['date_created']) && $data['date_created'] != '0000-00-00 00:00:00' ? date(module_config::c('time_format', 'g:ia'), strtotime($data['date_created'])) : _l('N/A'));
break;
case 'created_by':
$value = isset($data['create_user_id']) && (int) $data['create_user_id'] > 0 ? module_user::link_open($data['create_user_id'], true) : _l('N/A');
break;
case 'updated_by':
$value = isset($data['update_user_id']) && (int) $data['update_user_id'] > 0 ? module_user::link_open($data['update_user_id'], true) : (isset($data['create_user_id']) && (int) $data['create_user_id'] > 0 ? module_user::link_open($data['create_user_id'], true) : _l('N/A'));
break;
}
} else {
switch ($settings['field_type']) {
case 'encrypted':
$value = '*******';
break;
case 'wysiwyg':
$value = module_security::purify_html($value);
break;
case 'select':
// todo - do this for the other field types as well..
$settings['value'] = $value;
$value = $module->get_form_element($settings, true, $data);
break;
case 'url':
if (!is_array($value)) {
$value = array($value);
}
$foo = array();
foreach ($value as $v) {
$foo[] = '<a href="' . htmlspecialchars($v) . '" target="_blank">' . htmlspecialchars($v) . '</a>';
}
$value = implode(', ', $foo);
示例8: _e
<?php
}
?>
</td>
</tr>
<tr>
<th>
<?php
_e('Message:');
?>
</th>
<td id="email_message">
<?php
if (!$can_edit_emails) {
if (strlen($email['html_content'])) {
echo module_security::purify_html($email['html_content']);
} else {
echo forum_text($email['text_content']);
}
} else {
?>
<textarea name="content" id="email_content_editor" rows="10" cols="30" style="width:450px; height: 350px;"><?php
echo htmlspecialchars($email['text_content']);
?>
</textarea>
<script type="text/javascript" src="<?php
echo _BASE_HREF;
?>
js/tiny_mce3.4.4/jquery.tinymce.js"></script>
<script type="text/javascript">