當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PHPWS_DB::sqlFriendlyName方法代碼示例

本文整理匯總了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()');
         }
     }
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:35,代碼來源:Radiobutton.php

示例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>');
         }
     }
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:51,代碼來源:Textfield.php

示例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'));
         }
     }
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:51,代碼來源:Textarea.php

示例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()');
         }
     }
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:36,代碼來源:Checkbox.php


注:本文中的PHPWS_DB::sqlFriendlyName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。