本文整理汇总了PHP中PHPWS_DB::sqlFriendlyName方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPWS_DB::sqlFriendlyName方法的具体用法?PHP PHPWS_DB::sqlFriendlyName怎么用?PHP PHPWS_DB::sqlFriendlyName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPWS_DB
的用法示例。
在下文中一共展示了PHPWS_DB::sqlFriendlyName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
/**
* Save this PHAT_Radiobutton
*
* @return mixed Content if going to getOptions stage, content for edit if first form not filled in properly,
* or PHPWS_Error on failure.
* @access public
*/
function save()
{
$error = FALSE;
$label = $this->getLabel();
if (!$_SESSION['PHAT_FormManager']->form->checkLabel($_REQUEST['PHAT_ElementName']) && strcasecmp($label, $_REQUEST['PHAT_ElementName']) != 0 || PHPWS_Error::isError($this->setLabel(PHPWS_DB::sqlFriendlyName($_REQUEST['PHAT_ElementName'])))) {
$currentError = PHPWS_Error::get(PHATFORM_INVALID_NAME, 'phatform', 'PHAT_Radiobutton::save()');
$error = TRUE;
}
$result = $this->setBlurb($_REQUEST['PHAT_ElementBlurb']);
if (PHPWS_Error::isError($result)) {
$currentError = $result;
$error = TRUE;
}
if (isset($_REQUEST['PHAT_ElementRequired'])) {
$this->setRequired(TRUE);
} else {
$this->setRequired(FALSE);
}
if ($error) {
return $currentError;
} else {
if (is_numeric($_REQUEST['PHAT_ElementNumOptions']) && $_REQUEST['PHAT_ElementNumOptions'] > 0 || isset($_REQUEST['PHAT_OptionSet'])) {
return $this->getOptions();
} else {
return PHPWS_Error::get(PHATFORM_ZERO_OPTIONS, 'phatform', 'PHAT_Radiobutton::save()');
}
}
}
示例2: save
/**
* Save this PHAT_Textfield
*
* @return string A message on success and PHPWS_Error on failure
* @access public
*/
function save()
{
$error = FALSE;
$result = $this->setValue($_REQUEST['PHAT_ElementValue']);
if (PHPWS_Error::isError($result)) {
$currentError = $result;
$error = TRUE;
}
if (!$_SESSION['PHAT_FormManager']->form->checkLabel($_REQUEST['PHAT_ElementName']) && $this->getLabel() != $_REQUEST['PHAT_ElementName'] || PHPWS_Error::isError($this->setLabel(PHPWS_DB::sqlFriendlyName($_REQUEST['PHAT_ElementName'])))) {
$message = dgettext('phatform', 'The name you entered for the Textfield is not valid or is already in use with this form.');
$currentError = PHPWS_Error::get(PHATFORM_INVALID_NAME, 'phatform', 'PHAT_Checkbox::save()', $_REQUEST['PHAT_ElementName']);
$error = TRUE;
}
$result = $this->setBlurb($_REQUEST['PHAT_ElementBlurb']);
if (PHPWS_Error::isError($result)) {
$currentError = $result;
$error = TRUE;
}
if (isset($_REQUEST['PHAT_ElementRequired'])) {
$this->setRequired(TRUE);
} else {
$this->setRequired(FALSE);
}
$size = PHPWS_Text::parseInput($_REQUEST['PHAT_ElementSize']);
if ($size) {
$this->_size = $size;
} else {
$this->_size = PHAT_DEFAULT_SIZE;
}
$maxsize = PHPWS_Text::parseInput($_REQUEST['PHAT_ElementMaxsize']);
if ($maxsize) {
$this->_maxsize = $maxsize;
} else {
$this->_maxsize = PHAT_DEFAULT_MAXSIZE;
}
if ($error) {
return $currentError;
} else {
if (PHPWS_Error::isError($this->commit())) {
return PHPWS_Error::get(PHATFORM_ELEMENT_FAIL, 'phatform', 'PHAT_Textfield::save');
} else {
return sprintf(dgettext('phatform', 'The %s element was saved successfully.'), '<b><i>Textfield</i></b>');
}
}
}
示例3: save
/**
* Save this PHAT_Textarea
*
* @return mixed Message on success and PHPWS_Error on failure
* @access public
*/
function save()
{
$error = FALSE;
$result = $this->setValue($_REQUEST['PHAT_ElementValue']);
if (PHPWS_Error::isError($result)) {
$currentError = $result;
$error = TRUE;
}
$label = $this->getLabel();
if (!$_SESSION['PHAT_FormManager']->form->checkLabel($_REQUEST['PHAT_ElementName']) && strcasecmp($label, $_REQUEST['PHAT_ElementName']) != 0 || PHPWS_Error::isError($this->setLabel(PHPWS_DB::sqlFriendlyName($_REQUEST['PHAT_ElementName'])))) {
$currentError = PHPWS_Error::get(PHATFORM_INVALID_NAME, 'phatform', 'PHAT_Textarea::save()');
$error = TRUE;
}
$result = $this->setBlurb($_REQUEST['PHAT_ElementBlurb']);
if (PHPWS_Error::isError($result)) {
$currentError = $result;
$error = TRUE;
}
if (isset($_REQUEST['PHAT_ElementRequired'])) {
$this->setRequired(TRUE);
} else {
$this->setRequired(FALSE);
}
$rows = PHPWS_Text::parseInput($_REQUEST['PHAT_ElementRows']);
if ($rows) {
$this->_rows = $rows;
} else {
$this->_rows = PHAT_DEFAULT_ROWS;
}
$cols = PHPWS_Text::parseInput($_REQUEST['PHAT_ElementCols']);
if ($cols) {
$this->_cols = $cols;
} else {
$this->_cols = PHAT_DEFAULT_COLS;
}
if ($error) {
return $currentError;
} else {
if (PHPWS_Error::isError($this->commit())) {
return PHPWS_Error::get(PHATFORM_ELEMENT_FAIL, 'phatform', 'PHAT_Textarea::save()', array(dgettext('phatform', 'Textarea')));
} else {
return sprintf(dgettext('phatform', 'The %s element was saved successfully.'), dgettext('phatform', 'Textarea'));
}
}
}
示例4: save
/**
* Save this PHAT_Checkbox
*
* @return mixed Content if going to getOptions stage, content for edit if first form not filled in properly,
* or PHPWS_Error on failure.
* @access public
*/
function save()
{
$error = FALSE;
$label = $this->getLabel();
if (!$_SESSION['PHAT_FormManager']->form->checkLabel($_REQUEST['PHAT_ElementName']) && strcasecmp($label, $_REQUEST['PHAT_ElementName']) != 0 || PHPWS_Error::isError($this->setLabel(PHPWS_DB::sqlFriendlyName($_REQUEST['PHAT_ElementName'])))) {
$message = dgettext('phatform', 'The name you entered for the Checkbox is not valid or is already in use with this form.');
$currentError = PHPWS_Error::get(PHATFORM_INVALID_NAME, 'phatform', 'PHAT_Checkbox::save()', $_REQUEST['PHAT_ElementName']);
$error = TRUE;
}
$result = $this->setBlurb($_REQUEST['PHAT_ElementBlurb']);
if (PHPWS_Error::isError($result)) {
$currentError = $result;
$error = TRUE;
}
if (isset($_REQUEST['PHAT_ElementRequired'])) {
$this->setRequired(TRUE);
} else {
$this->setRequired(FALSE);
}
if ($error) {
return $currentError;
} else {
if (is_numeric($_REQUEST['PHAT_ElementNumOptions']) && $_REQUEST['PHAT_ElementNumOptions'] > 0 || isset($_REQUEST['PHAT_OptionSet'])) {
return $this->getOptions();
} else {
return PHPWS_Error::get(PHATFORM_ZERO_OPTIONS, 'phatform', 'PHAT_Checkbox::save()');
}
}
}