本文整理汇总了PHP中Checker::checkName方法的典型用法代码示例。如果您正苦于以下问题:PHP Checker::checkName方法的具体用法?PHP Checker::checkName怎么用?PHP Checker::checkName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Checker
的用法示例。
在下文中一共展示了Checker::checkName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showEditGroupGeneralRes
function showEditGroupGeneralRes()
{
$displaySysAdmin = new DisplaySysAdmin();
$survey = new Survey($_SESSION['SUID']);
$gid = getFromSessionParams('gid');
$_SESSION['GID'] = $gid;
$content = "";
if ($gid != '') {
//edit
$group = $survey->getGroup($gid);
$content = $displaySysAdmin->displaySuccess(Language::messageGroupChanged(loadvar(SETTING_GROUP_NAME)));
} else {
//add group!
if (loadvar(SETTING_GROUP_NAME) != "") {
$group = new Group();
$group->setSuid($_SESSION['SUID']);
$_SESSION['GID'] = $group->getGid();
$content = $displaySysAdmin->displaySuccess(Language::messageGroupAdded(loadvar(SETTING_GROUP_NAME)));
}
}
$checker = new Checker($_SESSION['SUID']);
if ($gid == '') {
$checks = $checker->checkName(loadvar(SETTING_GROUP_NAME));
if (sizeof($checks) > 0) {
$content = implode("<br/>", $checks);
return $this->showAddGroup($content);
}
}
/* ADD ALL SORTS OF CHECKS!! */
if ($gid != '' || loadvar(SETTING_GROUP_NAME) != "") {
$group->setName(trim(loadvar(SETTING_GROUP_NAME)));
$group->setTemplate(loadvar(SETTING_GROUP_TEMPLATE));
if (loadvar(SETTING_GROUP_TEMPLATE) == TABLE_TEMPLATE_CUSTOM) {
$group->setCustomTemplate(loadvarAllowHTML(SETTING_GROUP_CUSTOM_TEMPLATE));
} else {
$group->setCustomTemplate("");
}
if (Config::xiExtension()) {
$group->setXiTemplate(loadvar(SETTING_GROUP_XI_TEMPLATE));
}
$group->save();
$checker = new Checker($_SESSION['SUID']);
$checks = $checker->checkGroup($group);
if (sizeof($checks) > 0) {
$content .= $displaySysAdmin->displayError(implode("<br/>", $checks));
}
}
/* compile */
$compiler = new Compiler($_SESSION['SUID'], getSurveyVersion($survey));
$mess = $compiler->generateGroups(array($group));
if (loadvar(SETTING_GROUP_TEMPLATE) == TABLE_TEMPLATE_CUSTOM) {
$mess = $compiler->generateGetFillsGroups(array($group));
$mess = $compiler->generateInlineFieldsGroups(array($group));
}
/* update last page */
$_SESSION['LASTPAGE'] = substr($_SESSION['LASTPAGE'], 0, strripos($_SESSION['LASTPAGE'], "res"));
if ($gid != '') {
return $displaySysAdmin->showEditGroup($_SESSION['GID'], $content);
} else {
return $this->showSection($content);
}
}