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


PHP PHPWS_Error::printError方法代碼示例

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

示例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;
     }
//.........這裏部分代碼省略.........
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:101,代碼來源:Form.php

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


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