当前位置: 首页>>代码示例>>PHP>>正文


PHP ErrorHandler::getSingleton方法代码示例

本文整理汇总了PHP中ErrorHandler::getSingleton方法的典型用法代码示例。如果您正苦于以下问题:PHP ErrorHandler::getSingleton方法的具体用法?PHP ErrorHandler::getSingleton怎么用?PHP ErrorHandler::getSingleton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ErrorHandler的用法示例。


在下文中一共展示了ErrorHandler::getSingleton方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PageAdminPanel

 /**
  * Constructor
  * 
  * init superclass, create navigation
  */
 function PageAdminPanel()
 {
     // MANDATORY SECURITY CHECK IN CONSTRUCTOR OF EACH PAGE
     $rightsManager = RightsManager::getSingleton();
     if (!$rightsManager->currentUserIsAllowedTo('administrate')) {
         ErrorHandler::getSingleton()->standardError('PERMISSION_DENIED', basename($_SERVER['SCRIPT_NAME']));
     }
     $this->Page('Admin Panel');
     $this->nav = new Navigation('admin-menu');
     $this->nav->addEntry('return', 'return', Navigation::mainPageUrl());
 }
开发者ID:netiul,项目名称:cgkutrechtwest-gadgets,代码行数:16,代码来源:PageAdminPanel.class.php

示例2: PageContactEdit

 /**
  * Constructor: ONLY TO BE CALLED like this: Page::newPage(classname,$id,$add) factory method!! 
  * 
  * @param $idOrContact integer|Contact the id of the contact, or the contact that is to be edited
  * @param $add boolean whether the contact is to be added or not (cannot be detected through {@link $id}, because a contact can be passed if an error occurs to preserve already inserted information)
  * @param $xsltProcessing boolean allows to deactivate XSLT processing if FALSE. default: TRUE
  * @global Options admin options
  */
 function PageContactEdit($idOrContact, $add = false, $enableXSLTProcessing = TRUE)
 {
     global $options;
     $this->counters = array();
     $this->add = $add;
     $this->enableXSLTProcessing = $enableXSLTProcessing;
     if ($idOrContact === null) {
         $this->contact = Contact::newContact();
         $this->add = TRUE;
     } elseif (is_numeric($idOrContact)) {
         $this->contact = Contact::newContact($idOrContact);
     } else {
         $this->contact =& $idOrContact;
     }
     // MANDATORY SECURITY CHECK IN CONSTRUCTOR OF EACH PAGE
     $rightsManager = RightsManager::getSingleton();
     if ($add) {
         if (!$rightsManager->currentUserIsAllowedTo('create')) {
             ErrorHandler::getSingleton()->standardError('PERMISSION_DENIED', basename($_SERVER['SCRIPT_NAME']));
         }
         $this->Page('Add new entry');
     } else {
         if (!$rightsManager->currentUserIsAllowedTo('edit', $this->contact)) {
             ErrorHandler::getSingleton()->standardError('PERMISSION_DENIED', basename($_SERVER['SCRIPT_NAME']));
         }
         $this->Page($this->contact->contact['firstname'] . ' ' . $this->contact->contact['lastname']);
     }
     $this->menu = new Navigation('edit-menu');
     // disable save when XSLT will be processed. XSLT files MUST provide their own save button.
     if (!($this->enableXSLTProcessing && !empty($this->contact->contact['xsltDisplayType']))) {
         $this->menu->addEntry('save', 'save', 'javascript:saveEntry();');
     }
     if (isset($this->contact->contact['id'])) {
         $this->menu->addEntry('cancel', 'cancel', '?id=' . $this->contact->contact['id']);
     } else {
         $this->menu->addEntry('cancel', 'cancel', Navigation::previousPageUrl());
     }
     if (!$this->add) {
         $rightsManager = RightsManager::getSingleton();
         if ($rightsManager->mayDeleteContact($this->contact)) {
             $this->menu->addEntry('delete', 'delete', 'javascript:deleteEntry(' . $this->contact->contact['id'] . ');');
             if ($_SESSION['user']->isAtLeast('admin') && $options->getOption('deleteTrashMode')) {
                 $this->menu->addEntry('trash', 'trash', '?mode=trash&id=' . $this->contact->contact['id']);
             }
         }
     }
     if ($_SESSION['user']->isAtLeast('admin')) {
         // no putting on changed list
         $this->menu->addEntry('adminsave', '[adminsave]', 'javascript:adminsaveEntry();');
     }
 }
开发者ID:netiul,项目名称:cgkutrechtwest-gadgets,代码行数:59,代码来源:PageContactEdit.class.php


注:本文中的ErrorHandler::getSingleton方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。