本文整理汇总了PHP中PHPWS_Error::printError方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPWS_Error::printError方法的具体用法?PHP PHPWS_Error::printError怎么用?PHP PHPWS_Error::printError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPWS_Error
的用法示例。
在下文中一共展示了PHPWS_Error::printError方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action
/**
*
*
*
*
*/
function action()
{
switch ($_REQUEST['PHAT_REPORT_OP']) {
case 'list':
if (Current_User::allow('phatform', 'report_view')) {
$content = $this->report();
} else {
$this->accessDenied();
}
break;
case 'edit':
if (Current_User::allow('phatform', 'report_edit')) {
$content = $_SESSION['PHAT_FormManager']->menu() . $this->edit();
} else {
$this->accessDenied();
}
break;
case 'view':
if (Current_User::allow('phatform', 'report_view')) {
$content = $_SESSION['PHAT_FormManager']->menu() . $this->view();
} else {
$this->accessDenied();
}
break;
case 'confirmDelete':
if (Current_User::allow('phatform', 'report_delete')) {
$content = $this->confirmDelete();
} else {
$this->accessDenied();
}
break;
case 'delete':
if (Current_User::allow('phatform', 'report_delete')) {
$content = $this->delete();
} else {
$this->accessDenied();
}
break;
case 'export':
if (Current_User::allow('phatform', 'report_export')) {
include PHPWS_SOURCE_DIR . 'mod/phatform/inc/Export.php';
$error = export($this->_formId);
if (PHPWS_Error::isError($error)) {
javascript('alert', array('content' => PHPWS_Error::printError($error)));
$content = $this->report();
}
} else {
$this->accessDenied();
}
break;
}
if ($content) {
if (isset($_REQUEST['lay_quiet'])) {
Layout::nakedDisplay($content);
} else {
$GLOBALS['CNT_phatform']['content'] = $content;
}
}
}
示例2: action
/**
* The action function for this PHAT_Form.
*
*
* @return mixed $content Returns the contents handed to it from functions called within.
* @access public
*/
function action()
{
if (isset($_SESSION['PHAT_Message'])) {
$content = $_SESSION['PHAT_Message'];
$GLOBALS['CNT_phatform']['content'] .= $content;
$_SESSION['PHAT_Message'] = NULL;
}
switch ($_REQUEST['PHAT_FORM_OP']) {
case 'SaveFormSettings':
if (Current_User::allow('phatform', 'edit_forms')) {
if (isset($_REQUEST['PHAT_SaveSettings'])) {
$content = $this->_saveSettings();
$content = $_SESSION['PHAT_FormManager']->menu() . $content;
} else {
if ($_REQUEST['PHAT_EditElements']) {
if ($this->isSaved()) {
$content = $this->_confirmArchive();
} else {
$content = $_SESSION['PHAT_FormManager']->menu();
$content .= $this->view(TRUE);
}
}
}
} else {
$this->_accessDenied();
}
break;
case 'editSettings':
if (Current_User::allow('phatform', 'edit_forms')) {
$content = $_SESSION['PHAT_FormManager']->menu();
$content .= $this->editSettings();
} else {
$this->_accessDenied();
}
break;
case 'editElements':
if (Current_User::allow('phatform', 'edit_forms')) {
$content = $_SESSION['PHAT_FormManager']->menu();
$content .= $this->view(TRUE);
} else {
$this->_accessDenied();
}
break;
case 'report':
if (Current_User::allow('phatform', 'report_view')) {
$this->report = new PHAT_Report();
$content = $this->report->report();
} else {
$this->_accessDenied();
}
break;
case 'archive':
if (!Current_User::allow('phatform', 'archive_form')) {
$this->_accessDenied();
} else {
include PHPWS_SOURCE_DIR . 'mod/phatform/inc/Archive.php';
$error = NULL;
$error = archive($this->getId());
if (PHPWS_Error::isError($error)) {
javascript('alert', array('content' => PHPWS_Error::printError($error)));
} else {
$_SESSION['PHAT_Message'] = sprintf(dgettext('phatform', 'The form %s was successfully archived.'), '<b><i>' . $this->getLabel() . '</i></b>');
}
$_REQUEST['PHAT_FORM_OP'] = 'report';
$this->action();
}
break;
case 'ToolbarAction':
if (Current_User::allow('phatform', 'edit_forms')) {
$content = $this->_toolbarAction();
} else {
$this->_accessDenied();
}
break;
case 'EditAction':
if (Current_User::allow('phatform', 'edit_forms')) {
if (isset($_REQUEST['PHAT_Submit']) || isset($_REQUEST['PHAT_Next']) || isset($_REQUEST['PHAT_Back'])) {
$content = $_SESSION['PHAT_FormManager']->menu();
$content .= $this->view(TRUE);
} else {
$content = $this->_editAction();
}
} else {
$this->_accessDenied();
}
break;
case 'Action':
$content = $this->_formAction();
break;
case 'ArchiveConfirm':
$this->_confirmArchive();
break;
}
//.........这里部分代码省略.........
示例3: log
public static function log($value, $module = NULL, $funcName = NULL, $extraInfo = NULL)
{
if ((bool) PHPWS_LOG_ERRORS == FALSE) {
return;
}
if (!PHPWS_Error::isError($value)) {
$error = PHPWS_Error::get($value, $module, $funcName, $extraInfo);
} else {
$error = $value;
}
$final = PHPWS_Error::printError($error);
Error::logError($final);
}