本文整理汇总了PHP中Handler类的典型用法代码示例。如果您正苦于以下问题:PHP Handler类的具体用法?PHP Handler怎么用?PHP Handler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Handler类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: HandleAdminData
function HandleAdminData($obj, $post, $url = null)
{
$handler = new Handler($obj);
try {
$handler->Handle($post);
if (!empty($url)) {
header("Location: /admin/{$url}");
exit;
}
} catch (Exception $e) {
global $smarty;
$smarty->assign('error_txt', $e->getMessage());
}
}
开发者ID:koninka,项目名称:Hackathon,代码行数:14,代码来源:handler.php
示例2: conferenceEventLogType
/**
* View conference event log by record type.
*/
function conferenceEventLogType($args)
{
$assocType = isset($args[1]) ? (int) $args[0] : null;
$assocId = isset($args[2]) ? (int) $args[1] : null;
$this->validate();
$this->setupTemplate(true);
$conference =& Request::getConference();
$rangeInfo =& Handler::getRangeInfo('eventLogEntries', array($assocType, $assocId));
$logDao =& DAORegistry::getDAO('ConferenceEventLogDAO');
while (true) {
$eventLogEntries =& $logDao->getConferenceLogEntriesByAssoc($conference->getId(), null, $assocType, $assocId, $rangeInfo);
if ($eventLogEntries->isInBounds()) {
break;
}
unset($rangeInfo);
$rangeInfo =& $eventLogEntries->getLastPageRangeInfo();
unset($eventLogEntries);
}
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('showBackLink', true);
$templateMgr->assign('isDirector', Validation::isDirector());
$templateMgr->assign_by_ref('conference', $conference);
$templateMgr->assign_by_ref('eventLogEntries', $eventLogEntries);
$templateMgr->display('manager/conferenceEventLog.tpl');
}
开发者ID:jalperin,项目名称:ocs,代码行数:28,代码来源:ConferenceHistoryHandler.inc.php
示例3: configure
/**
* [configure description]
* @param array $params [description]
* @return [type] [description]
*/
public static function configure(array $params)
{
extract($params);
/**
* Setting the default date timezone
*/
date_default_timezone_set($timezone);
/**
* Setting the default charset encoding
*/
mb_internal_encoding($charset);
ini_set('default_charset', $charset);
define('URL', $url);
/**
* Determing that the $web_path is a real directory
* @var string $web_path
*/
if (is_dir($web_path)) {
if (realpath($web_path) !== false) {
define('WEBPATH', (isset($_SERVER['HTTPS']) ? 'https://' : 'http://') . getenv('HTTP_HOST') . '/' . $web_path . '/');
}
} else {
if (!is_dir($web_path)) {
Handler::handler(E_USER_ERROR, 'The ' . $web_path . ' is not a valid directory', 'index.php', 146);
}
}
}
开发者ID:smoothframework,项目名称:smooth,代码行数:32,代码来源:App.php
示例4: authorize
/**
* @copydoc PKPHandler::authorize()
*/
function authorize($request, &$args, $roleAssignments)
{
// User must be logged in
import('lib.pkp.classes.security.authorization.UserRequiredPolicy');
$this->addPolicy(new UserRequiredPolicy($request));
return parent::authorize($request, $args, $roleAssignments);
}
开发者ID:energylevels,项目名称:pkp-lib,代码行数:10,代码来源:ProfileTabHandler.inc.php
示例5: display
function display(&$args, $request)
{
$templateMgr =& TemplateManager::getManager();
parent::display($args, $request);
$issueDao =& DAORegistry::getDAO('IssueDAO');
$publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
$articleGalleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
$journal =& Request::getJournal();
switch (array_shift($args)) {
case 'exportGalley':
$articleId = array_shift($args);
$galleyId = array_shift($args);
$article =& $publishedArticleDao->getPublishedArticleByArticleId($articleId);
$galley =& $articleGalleyDao->getGalley($galleyId, $articleId);
if ($article && $galley && ($issue =& $issueDao->getIssueById($article->getIssueId(), $journal->getId()))) {
$this->exportArticle($journal, $issue, $article, $galley);
break;
}
default:
// Display a list of articles for export
$this->setBreadcrumbs();
AppLocale::requireComponents(LOCALE_COMPONENT_PKP_SUBMISSION);
$publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
$rangeInfo = Handler::getRangeInfo('articles');
$articleIds = $publishedArticleDao->getPublishedArticleIdsAlphabetizedByJournal($journal->getId(), false);
$totalArticles = count($articleIds);
$articleIds = array_slice($articleIds, $rangeInfo->getCount() * ($rangeInfo->getPage() - 1), $rangeInfo->getCount());
import('lib.pkp.classes.core.VirtualArrayIterator');
$iterator = new VirtualArrayIterator(ArticleSearch::formatResults($articleIds), $totalArticles, $rangeInfo->getPage(), $rangeInfo->getCount());
$templateMgr->assign_by_ref('articles', $iterator);
$templateMgr->display($this->getTemplatePath() . 'index.tpl');
break;
}
}
开发者ID:yuricampos,项目名称:ojs,代码行数:34,代码来源:EruditExportPlugin.inc.php
示例6: backIssues
/**
* Displays the listings of back (published) issues
*/
function backIssues($args, $request)
{
$this->validate();
$this->setupTemplate(EDITOR_SECTION_ISSUES);
$journal =& $request->getJournal();
$issueDao =& DAORegistry::getDAO('IssueDAO');
$rangeInfo = Handler::getRangeInfo('issues');
$templateMgr =& TemplateManager::getManager();
$templateMgr->addJavaScript('lib/pkp/js/lib/jquery/plugins/jquery.tablednd.js');
$templateMgr->addJavaScript('lib/pkp/js/functions/tablednd.js');
$templateMgr->assign_by_ref('issues', $issueDao->getPublishedIssues($journal->getId(), $rangeInfo));
$allIssuesIterator = $issueDao->getPublishedIssues($journal->getId());
$issueMap = array();
while ($issue =& $allIssuesIterator->next()) {
$issueMap[$issue->getId()] = $issue->getIssueIdentification();
unset($issue);
}
$templateMgr->assign('allIssues', $issueMap);
$templateMgr->assign('rangeInfo', $rangeInfo);
$currentIssue =& $issueDao->getCurrentIssue($journal->getId());
$currentIssueId = $currentIssue ? $currentIssue->getId() : null;
$templateMgr->assign('currentIssueId', $currentIssueId);
$templateMgr->assign('helpTopicId', 'publishing.index');
$templateMgr->assign('usesCustomOrdering', $issueDao->customIssueOrderingExists($journal->getId()));
$templateMgr->display('editor/issues/backIssues.tpl');
}
开发者ID:reconciler,项目名称:ojs,代码行数:29,代码来源:IssueManagementHandler.inc.php
示例7: searches
function searches($args)
{
$this->validate();
$journal = Request::getJournal();
$rtDao =& DAORegistry::getDAO('RTDAO');
$rangeInfo = Handler::getRangeInfo('searches');
$versionId = isset($args[0]) ? $args[0] : 0;
$version =& $rtDao->getVersion($versionId, $journal->getId());
$contextId = isset($args[1]) ? $args[1] : 0;
$context =& $rtDao->getContext($contextId);
if ($context && $version && $context->getVersionId() == $version->getVersionId()) {
$this->setupTemplate(true, $version, $context);
$templateMgr =& TemplateManager::getManager();
$templateMgr->addJavaScript('lib/pkp/js/jquery.tablednd_0_5.js');
$templateMgr->addJavaScript('lib/pkp/js/tablednd.js');
$templateMgr->assign_by_ref('version', $version);
$templateMgr->assign_by_ref('context', $context);
import('lib.pkp.classes.core.ArrayItemIterator');
$templateMgr->assign_by_ref('searches', new ArrayItemIterator($context->getSearches(), $rangeInfo->getPage(), $rangeInfo->getCount()));
$templateMgr->assign('helpTopicId', 'journal.managementPages.readingTools.contexts');
$templateMgr->display('rtadmin/searches.tpl');
} else {
Request::redirect(null, null, 'versions');
}
}
开发者ID:master3395,项目名称:CBPPlatform,代码行数:25,代码来源:RTSearchHandler.inc.php
示例8: LuceneHandler
/**
* Constructor
* @param $request Request
*/
function LuceneHandler(&$request)
{
parent::Handler();
$router =& $request->getRouter();
$journal =& $router->getContext($request);
$this->addCheck(new HandlerValidatorCustom($this, false, null, null, create_function('$journal', 'return !$journal || $journal->getSetting(\'publishingMode\') != PUBLISHING_MODE_NONE;'), array($journal)));
}
开发者ID:yuricampos,项目名称:ojs,代码行数:11,代码来源:LuceneHandler.inc.php
示例9: emails
/**
* Display a list of the emails within the current conference.
*/
function emails()
{
$this->validate();
$this->setupTemplate(true);
$conference =& Request::getConference();
$rangeInfo = Handler::getRangeInfo('emails', array());
$emailTemplateDao =& DAORegistry::getDAO('EmailTemplateDAO');
$emailTemplatesArray =& $emailTemplateDao->getEmailTemplates(Locale::getLocale(), $conference->getId());
import('core.ArrayItemIterator');
if ($rangeInfo && $rangeInfo->isValid()) {
while (true) {
$emailTemplates = new ArrayItemIterator($emailTemplatesArray, $rangeInfo->getPage(), $rangeInfo->getCount());
if ($emailTemplates->isInBounds()) {
break;
}
unset($rangeInfo);
$rangeInfo =& $emailTemplates->getLastPageRangeInfo();
unset($emailTemplates);
}
} else {
$emailTemplates = new ArrayItemIterator($emailTemplatesArray);
}
$templateMgr =& TemplateManager::getManager();
// The bread crumbs depends on whether we're doing scheduled conference or conference
// management. FIXME: this is going to be a common situation, and this isn't
// an elegant way of testing for it.
if (Request::getRequestedPage() === 'manager') {
$templateMgr->assign('pageHierarchy', array(array(Request::url(null, 'index', 'manager'), 'manager.conferenceSiteManagement')));
} else {
$templateMgr->assign('pageHierarchy', array(array(Request::url(null, null, 'manager'), 'manager.schedConfManagement')));
}
$templateMgr->assign_by_ref('emailTemplates', $emailTemplates);
$templateMgr->assign('helpTopicId', 'conference.generalManagement.emails');
$templateMgr->display('manager/emails/emails.tpl');
}
开发者ID:jalperin,项目名称:ocs,代码行数:38,代码来源:EmailHandler.inc.php
示例10: authorize
/**
* @see PKPHandler::authorize()
* @param $request PKPRequest
* @param $args array
* @param $roleAssignments array
*/
function authorize(&$request, $args, $roleAssignments)
{
$stageId = $request->getUserVar('stageId');
import('classes.security.authorization.OmpWorkflowStageAccessPolicy');
$this->addPolicy(new OmpWorkflowStageAccessPolicy($request, $args, $roleAssignments, 'monographId', $stageId));
return parent::authorize($request, $args, $roleAssignments);
}
开发者ID:ramonsodoma,项目名称:omp,代码行数:13,代码来源:SubmissionParticipantsHandler.inc.php
示例11: authorize
/**
* @copydoc PKPHandler::authorize()
*/
function authorize($request, &$args, $roleAssignments)
{
$stageId = (int) $request->getUserVar('stageId');
import('classes.security.authorization.WorkflowStageAccessPolicy');
$this->addPolicy(new WorkflowStageAccessPolicy($request, $args, $roleAssignments, 'submissionId', $stageId));
return parent::authorize($request, $args, $roleAssignments);
}
开发者ID:energylevels,项目名称:pkp-lib,代码行数:10,代码来源:PublicationEntryHandler.inc.php
示例12: validateJson
public static function validateJson($string)
{
$isJson = Uteis::isJson($string);
if ($isJson === false) {
Handler::error('Falha na integração: Formato json inválido ' . json_encode(URI::get_segments()), is_string($string) ? $string : '');
}
return true;
}
开发者ID:sostenesgomes,项目名称:middleware-vtex,代码行数:8,代码来源:VtexRest.php
示例13: authorize
/**
* @copydoc PKPHandler::authorize()
*/
function authorize($request, &$args, $roleAssignments)
{
import('lib.pkp.classes.security.authorization.ContextRequiredPolicy');
$this->addPolicy(new ContextRequiredPolicy($request));
import('classes.security.authorization.OjsJournalMustPublishPolicy');
$this->addPolicy(new OjsJournalMustPublishPolicy($request));
return parent::authorize($request, $args, $roleAssignments);
}
开发者ID:mariojp,项目名称:ojs,代码行数:11,代码来源:LuceneHandler.inc.php
示例14: authorize
/**
* @copydoc PKPHandler::authorize()
*/
function authorize($request, &$args, $roleAssignments)
{
// Some operations need a review round id in request.
$reviewRoundOps = $this->_getReviewRoundOps();
import('lib.pkp.classes.security.authorization.internal.ReviewRoundRequiredPolicy');
$this->addPolicy(new ReviewRoundRequiredPolicy($request, $args, 'reviewRoundId', $reviewRoundOps));
return parent::authorize($request, $args, $roleAssignments);
}
开发者ID:pkp,项目名称:pkp-lib,代码行数:11,代码来源:PKPEditorDecisionHandler.inc.php
示例15: setResponseHeader
public static function setResponseHeader($resource)
{
Handler::$responseHeader = 'Não definido';
if ($resource instanceof SoapClient) {
Handler::$responseHeader = $resource->__getLastResponseHeaders();
}
return true;
}
开发者ID:sostenesgomes,项目名称:middleware-vtex,代码行数:8,代码来源:VtexSoap.php
示例16: handle
/**
* Handle the request.
*
* This approach by using a template method pattern ensures you that
* each subclass will not forget to call the successor. Beside, the returned
* boolean value indicates you if the request have been processed or not.
*
* @param Request $req
*
* @return bool
*/
public final function handle(Request $req)
{
$req->forDebugOnly = get_called_class();
$processed = $this->processing($req);
if (!$processed) {
// the request has not been processed by this handler => see the next
if (!is_null($this->successor)) {
$processed = $this->successor->handle($req);
}
}
return $processed;
}
开发者ID:calvincanas,项目名称:DesignPatternsPHP,代码行数:23,代码来源:Handler.php
示例17: __construct
public function __construct($type = USE_ECHO, $separator = self::DEFAULT_SEPARATOR, $expandArrays = true)
{
parent::__construct(null);
$this->_type = $type;
$this->_separator = $separator;
$this->_expandArrays = $expandArrays;
}
开发者ID:burdiuz,项目名称:php-pap,代码行数:7,代码来源:OutputHandler.php
示例18: testGenerateOutputWithFlairException
/**
* tests that output is generated as expected using no template and a Flair exception
*
* @author Daniel Sherman
* @test
* @depends testConstruct
* @depends testGenerateDefaultOutput
* @covers ::generateOutput
*/
public function testGenerateOutputWithFlairException()
{
$stub = $this->getMockBuilder('Flair\\Exception\\Exception')->disableOriginalConstructor()->getMock();
$stub->method('getId')->willReturn('123456789');
$this->expectOutputString('Issue: 123456789');
self::$handler->generateOutput($stub);
}
开发者ID:flairphp,项目名称:flair,代码行数:16,代码来源:HandlerTest.php
示例19: setupTemplate
/**
* Setup common template variables.
* @param $subclass boolean set to true if caller is below this handler in the hierarchy
*/
function setupTemplate($subclass = false)
{
parent::setupTemplate();
$templateMgr =& TemplateManager::getManager();
$templateMgr->setCacheability(CACHEABILITY_PUBLIC);
$templateMgr->assign('pageHierachy', array(array(Request::url(null, null, 'announcements'), 'announcement.announcements')));
}
开发者ID:anorton,项目名称:pkp-lib,代码行数:11,代码来源:PKPAnnouncementHandler.inc.php
示例20: setupTemplate
/**
* Setup common template variables.
* @param $subclass boolean set to true if caller is below this handler in the hierarchy
*/
function setupTemplate($subclass = false)
{
parent::setupTemplate();
AppLocale::requireComponents(LOCALE_COMPONENT_PKP_ADMIN, LOCALE_COMPONENT_OJS_ADMIN, LOCALE_COMPONENT_OJS_MANAGER);
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('pageHierarchy', $subclass ? array(array(Request::url(null, 'user'), 'navigation.user'), array(Request::url(null, 'admin'), 'admin.siteAdmin')) : array(array(Request::url(null, 'user'), 'navigation.user')));
}
开发者ID:EreminDm,项目名称:water-cao,代码行数:11,代码来源:AdminHandler.inc.php
注:本文中的Handler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论