本文整理汇总了PHP中CBTxt::html_entity_decode方法的典型用法代码示例。如果您正苦于以下问题:PHP CBTxt::html_entity_decode方法的具体用法?PHP CBTxt::html_entity_decode怎么用?PHP CBTxt::html_entity_decode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBTxt
的用法示例。
在下文中一共展示了CBTxt::html_entity_decode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validate
/**
* Validator:
* Validates $value for $field->required and other rules
* Override
*
* @param moscomprofilerFields $field
* @param moscomprofilerUser $user RETURNED populated: touch only variables related to saving this field (also when not validating for showing re-edit)
* @param string $columnName Column to validate
* @param string $value (RETURNED:) Value to validate, Returned Modified if needed !
* @param array $postdata Typically $_POST (but not necessarily), filtering required.
* @param string $reason 'edit' for save profile edit, 'register' for registration, 'search' for searches
* @return boolean True if validate, $this->_setErrorMSG if False
*/
function validate(&$field, &$user, $columnName, &$value, &$postdata, $reason)
{
$validated = parent::validate($field, $user, $columnName, $value, $postdata, $reason);
if ($validated) {
if ($field->name == 'username') {
$version = checkJversion();
if ($version >= 1) {
// "^[a-zA-Z](([\.\-a-zA-Z0-9@])?[a-zA-Z0-9]*)*$", "i");
// $regex = '/^[\\<|\\>|"|\'|\\%|\\;|\\(|\\)|\\&|\\+|\\-]*$/i';
$regex = '/^[\\<|\\>|"|\\\'|\\%|\\;|\\(|\\)|\\&]*$/i';
} elseif ($version == -1) {
$regex = "[^A-Za-z0-9]";
} else {
$regex = '/[\\<|\\>|"|\'|\\%|\\;|\\(|\\)|\\&|\\+|\\-]/i';
}
$validated = !preg_match($regex, $value);
if (!$validated) {
$this->_setValidationError($field, $user, $reason, sprintf(CBTxt::html_entity_decode(_VALID_AZ09), CBTxt::html_entity_decode(_PROMPT_UNAME), 2));
}
}
}
return $validated;
}
示例2: edituser
function edituser($user, $option, $newCBuser, &$postdata)
{
global $_CB_framework, $_PLUGINS;
$results = $_PLUGINS->trigger('onBeforeUserProfileEditDisplay', array(&$user, 2));
if ($_PLUGINS->is_errors()) {
echo "<script type=\"text/javascript\">alert(\"" . str_replace(array("\n", '<br />'), array('\\n', '\\n'), addslashes($_PLUGINS->getErrorMSG())) . "\"); window.history.go(-1); </script>\n";
exit;
}
_CBsecureAboveForm('edituser');
outputCbTemplate(2);
initToolTip(2);
$tabs = new cbTabs($_CB_framework->getUi() == 2 && !isset($_REQUEST['tab']) ? 1 : 0, 2);
// use cookies in backend to remember selected tab.
$tabcontent = $tabs->getEditTabs($user, $postdata);
outputCbJs(2);
global $_CB_Backend_Title;
//OLD: $_CB_Backend_Title = array( 0 => array( 'cbicon-48-users', "Community Builder User: <small>" . ( $user->id ? "Edit" . ' [ '. $user->username .' ]' : "New" ) . '</small>' ) );
//NEW:
$_CB_Backend_Title = array(0 => array('cbicon-48-users', CBTxt::T('Community Builder User') . ": <small>" . ($user->id ? CBTxt::T('Edit') . ' [ ' . $user->username . ' ]' : CBTxt::T('New')) . '</small>'));
ob_start();
if (defined('_CB_VALIDATE_NEW')) {
cbimport('cb.validator');
cbValidator::renderGenericJs();
?>
$('div.cbtoolbaractions .cbtoolbaraction').click( function() {
if ( $(this).attr('href') ) {
var taskVal = $(this).attr('href').substring(1);
} else if ( $(this).attr('value') ) {
taskVal = $(this).attr('value').substring(1);
}
$('#cbcheckedadminForm input[name=task]').val( taskVal );
if (taskVal == 'showusers') {
$('#cbcheckedadminForm')[0].submit();
} else {
$('#cbcheckedadminForm').submit();
}
return false;
} );
<?php
$cbjavascript = ob_get_contents();
ob_end_clean();
$_CB_framework->outputCbJQuery($cbjavascript, array('metadata', 'validate'));
} else {
// old way:
?>
var cbDefaultFieldbackgroundColor;
function cbFrmSubmitButton() {
var me = this.elements;
<?php
$version = checkJversion();
if ($version == 1) {
// var r = new RegExp("^[a-zA-Z](([\.\-a-zA-Z0-9@])?[a-zA-Z0-9]*)*$", "i");
?>
var r = new RegExp("^[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]*$", "i");
<?php
} elseif ($version == -1) {
?>
var r = new RegExp("[^A-Za-z0-9]", "i");
<?php
} else {
?>
var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", "i");
<?php
}
?>
var errorMSG = '';
var iserror=0;
if (cbDefaultFieldbackgroundColor === undefined) cbDefaultFieldbackgroundColor = ((me['username'].style.getPropertyValue) ? me['username'].style.getPropertyValue("backgroundColor") : me['username'].style.backgroundColor);
<?php
echo $tabs->fieldJS;
?>
if (me['username'].value == "") {
errorMSG += "<?php
echo str_replace(array("\n", "\r"), ' ', CBTxt::html_entity_decode(_REGWARN_UNAME));
?>
\n";
me['username'].style.backgroundColor = "red";
iserror=1;
} else if (r.exec(me['username'].value) || (me['username'].value.length < 3)) {
errorMSG += "<?php
echo str_replace(array("\n", "\r"), ' ', sprintf(CBTxt::html_entity_decode(_VALID_AZ09), CBTxt::html_entity_decode(_PROMPT_UNAME), 2));
?>
\n";
me['username'].style.backgroundColor = "red";
iserror=1;
} else if (me['username'].style.backgroundColor.slice(0,3)=="red") {
me['username'].style.backgroundColor = cbDefaultFieldbackgroundColor;
}
if ((me['password'].value != "") && (me['password'].value != me['password__verify'].value)){
errorMSG += "<?php
echo CBTxt::html_entity_decode(_REGWARN_VPASS2);
?>
\n";
me['password'].style.backgroundColor = "red"; me['password__verify'].style.backgroundColor = "red";
iserror=1;
} else {
if (me['password'].style.backgroundColor.slice(0,3)=="red") me['password'].style.backgroundColor = cbDefaultFieldbackgroundColor;
if (me['password__verify'].style.backgroundColor.slice(0,3)=="red") me['password__verify'].style.backgroundColor = cbDefaultFieldbackgroundColor;
//.........这里部分代码省略.........
示例3: registerForm
static function registerForm($option, $emailpass, &$user, &$postvars, $regErrorMSG = null, $stillDisplayLoginModule = false)
{
global $_CB_framework, $_CB_database, $ueConfig, $_PLUGINS;
$results = $_PLUGINS->trigger('onBeforeRegisterFormDisplay', array(&$user, $regErrorMSG));
if ($_PLUGINS->is_errors()) {
echo "<script type=\"text/javascript\">alert(\"" . $_PLUGINS->getErrorMSG() . "\"); window.history.go(-1); </script>\n";
exit;
}
$cbTemplate = HTML_comprofiler::_cbTemplateLoad();
outputCbTemplate(1);
outputCbJs(1);
initToolTip(1);
$output = 'htmledit';
$formatting = isset($ueConfig['use_divs']) && $ueConfig['use_divs'] ? 'divs' : 'tabletrs';
// gets registration tabs from plugins (including the contacts tab core plugin for username, password, etc:
$tabs = new cbTabs(0, 1, null, false);
// do not output unused JS code in registration page (IE7 and Safari bugs on that)
//$tabcontent = $tabs->getEditTabs( $user, $postvars, $output, 'tabletrs', 'register', false );
$tabcontent = $tabs->getEditTabs($user, $postvars, $output, $formatting, 'register', false);
// outputs the site terms and conditions link and approval checkbox: Not yet a CB field //TBD
if ($ueConfig['reg_enable_toc']) {
global $_CB_OneTwoRowsStyleToggle;
$class = 'sectiontableentry' . $_CB_OneTwoRowsStyleToggle;
$_CB_OneTwoRowsStyleToggle = $_CB_OneTwoRowsStyleToggle == 1 ? 2 : 1;
if ($formatting == 'divs') {
$tabcontent .= "\t<div class=\"" . $class . " cb_form_line cbclearboth\" id=\"cbfr_termsc\">\n" . '<div class="cb_field"><div id="cbfv_termsc">';
} else {
$tabcontent .= "\t<tr class=\"" . $class . "\" id=\"cbfr_termsc\">\n" . "\t\t<td> </td>\n<td class='fieldCell'>";
}
$tabcontent .= "<div class=\"cbSnglCtrlLbl\"><input type='checkbox' name='acceptedterms' id='acceptedterms' class='required' value='1' mosReq='0' mosLabel='" . htmlspecialchars(_UE_TOC) . "' /> <label for='acceptedterms'>" . sprintf(_UE_TOC_LINK, "<a href='" . cbSef(htmlspecialchars($ueConfig['reg_toc_url'])) . "' target='_BLANK'> ", "</a>") . '</label>' . getFieldIcons($_CB_framework->getUi(), 1, null, null, null) . "</div>";
if ($formatting == 'divs') {
$tabcontent .= "</div></div></div>\n";
} else {
$tabcontent .= "</td>\n" . "\t</tr>\n";
}
}
$_CB_framework->setPageTitle(_UE_REGISTRATION);
$_CB_framework->appendPathWay(_UE_REGISTRATION);
// starts outputing:
// $cbSpoofField = cbSpoofField();
$cbSpoofString = cbSpoofString(null, 'registerForm');
// $regAntiSpamFieldName = cbGetRegAntiSpamFieldName();
$regAntiSpamValues = cbGetRegAntiSpams();
// <script type="text/javascript" src="includes/js/mambojavascript.js"></script>
ob_start();
if (defined('_CB_VALIDATE_NEW')) {
cbimport('cb.validator');
cbValidator::renderGenericJs();
$cbjavascript = ob_get_contents();
ob_end_clean();
$_CB_framework->outputCbJQuery($cbjavascript, array('metadata', 'validate'));
} else {
// old way:
?>
var cbDefaultFieldBackground;
function cbFrmSubmitButton() {
var me = this.elements;
<?php
$version = checkJversion();
if ($version == 1) {
// var r = new RegExp("^[a-zA-Z](([\.\-a-zA-Z0-9@])?[a-zA-Z0-9]*)*$", "i");
?>
var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&]", "i");
<?php
} elseif ($version == -1) {
?>
var r = new RegExp("[^A-Za-z0-9]", "i");
<?php
} else {
?>
var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", "i");
<?php
}
?>
var errorMSG = '';
var iserror=0;
if (cbDefaultFieldBackground === undefined && typeof(me['username'])!='undefined') cbDefaultFieldBackground = ((me['username'].style.getPropertyValue) ? me['username'].style.getPropertyValue("backgroundColor") : me['username'].style.backgroundColor);
<?php
echo $tabs->fieldJS;
?>
if (typeof(me['username'])!='undefined' && me['username'].value == "") {
errorMSG += "<?php
echo CBTxt::html_entity_decode(_REGWARN_UNAME);
?>
\n";
me['username'].style.backgroundColor = "red";
iserror=1;
} else if (typeof(me['username'])!='undefined' && ( r.exec(me['username'].value) || (me['username'].value.length < 3))) {
errorMSG += "<?php
printf(CBTxt::html_entity_decode(_VALID_AZ09), CBTxt::html_entity_decode(_PROMPT_UNAME), 2);
?>
\n";
me['username'].style.backgroundColor = "red";
iserror=1;
} else if (typeof(me['username'])!='undefined' && me['username'].style.backgroundColor.slice(0,3)=="red") { me['username'].style.backgroundColor = cbDefaultFieldBackground;
<?php
if ($emailpass != "1") {
?>
}
if (typeof(me['password'])!='undefined' && me['password'].value.length < 6) {
//.........这里部分代码省略.........