本文整理汇总了PHP中DispatchManager类的典型用法代码示例。如果您正苦于以下问题:PHP DispatchManager类的具体用法?PHP DispatchManager怎么用?PHP DispatchManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DispatchManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute(HTTPRequestCustom $request)
{
$id = $request->get_int('id', 0);
$id_stream = $request->get_int('id_stream', 0);
$db_querier = PersistenceContext::get_querier();
if ($this->subscriber_exist($id) || $id_stream !== 0 && $id !== 0) {
if (!NewsletterAuthorizationsService::id_stream($id_stream)->moderation_subscribers()) {
NewsletterAuthorizationsService::get_errors()->moderation_subscribers();
}
$condition = "WHERE subscriber_id = :id AND stream_id = :id_stream";
$parameters = array('id' => $id, 'id_stream' => $id_stream);
$db_querier->delete(NewsletterSetup::$newsletter_table_subscriptions, $condition, $parameters);
$condition = "WHERE subscriber_id = :id";
$parameters = array('id' => $id);
$is_last = PersistenceContext::get_querier()->count(NewsletterSetup::$newsletter_table_subscriptions, $condition, $parameters) == 0;
if ($is_last) {
$condition = "WHERE id = :id";
$parameters = array('id' => $id);
$db_querier->delete(NewsletterSetup::$newsletter_table_subscribers, $condition, $parameters);
}
NewsletterStreamsCache::invalidate();
$controller = new UserErrorController(LangLoader::get_message('success', 'status-messages-common'), LangLoader::get_message('process.success', 'status-messages-common'), UserErrorController::SUCCESS);
DispatchManager::redirect($controller);
} else {
$controller = new UserErrorController(LangLoader::get_message('error', 'status-messages-common'), LangLoader::get_message('error-subscriber-not-existed', 'common', 'newsletter'));
DispatchManager::redirect($controller);
}
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:28,代码来源:NewsletterDeleteSubscriberController.class.php
示例2: execute
public function execute(HTTPRequestCustom $request)
{
$id = $request->get_getint('id', 0);
if (!empty($id) && AppContext::get_current_user()->check_level(User::MEMBER_LEVEL)) {
try {
$this->downloadfile = DownloadService::get_downloadfile('WHERE download.id = :id', array('id' => $id));
} catch (RowNotFoundException $e) {
$error_controller = PHPBoostErrors::unexisting_page();
DispatchManager::redirect($error_controller);
}
}
if ($this->downloadfile !== null && $this->downloadfile->is_visible()) {
if (!PersistenceContext::get_querier()->row_exists(PREFIX . 'events', 'WHERE id_in_module=:id_in_module AND module=\'download\' AND current_status = 0', array('id_in_module' => $this->downloadfile->get_id()))) {
$contribution = new Contribution();
$contribution->set_id_in_module($this->downloadfile->get_id());
$contribution->set_entitled(StringVars::replace_vars(LangLoader::get_message('contribution.deadlink', 'common'), array('link_name' => $this->downloadfile->get_name())));
$contribution->set_fixing_url(DownloadUrlBuilder::edit($this->downloadfile->get_id())->relative());
$contribution->set_description(LangLoader::get_message('contribution.deadlink_explain', 'common'));
$contribution->set_poster_id(AppContext::get_current_user()->get_id());
$contribution->set_module('download');
$contribution->set_type('alert');
$contribution->set_auth(Authorizations::capture_and_shift_bit_auth(DownloadService::get_categories_manager()->get_heritated_authorizations($this->downloadfile->get_id_category(), Category::MODERATION_AUTHORIZATIONS, Authorizations::AUTH_CHILD_PRIORITY), Category::MODERATION_AUTHORIZATIONS, Contribution::CONTRIBUTION_AUTH_BIT));
ContributionService::save_contribution($contribution);
}
DispatchManager::redirect(new UserContributionSuccessController());
} else {
$error_controller = PHPBoostErrors::unexisting_page();
DispatchManager::redirect($error_controller);
}
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:30,代码来源:DownloadDeadLinkController.class.php
示例3: execute
public function execute(HTTPRequestCustom $request)
{
AppContext::get_session()->csrf_get_protect();
$config = BugtrackerConfig::load();
$parameter = $request->get_string('parameter', '');
if (in_array($parameter, array('type', 'category', 'severity', 'priority', 'version'))) {
switch ($parameter) {
case 'type':
$config->set_default_type(0);
break;
case 'category':
$config->set_default_category(0);
break;
case 'severity':
$config->set_default_severity(0);
break;
case 'priority':
$config->set_default_priority(0);
break;
case 'version':
$config->set_default_version(0);
break;
}
BugtrackerConfig::save();
AppContext::get_response()->redirect(BugtrackerUrlBuilder::configuration());
} else {
$controller = new UserErrorController(LangLoader::get_message('error', 'status-messages-common'), LangLoader::get_message('error.e_unexist_parameter', 'common', 'bugtracker'));
$controller->set_response_classname(UserErrorController::ADMIN_RESPONSE);
DispatchManager::redirect($controller);
}
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:31,代码来源:AdminBugtrackerDeleteDefaultParameterController.class.php
示例4: build_response
private function build_response()
{
$response = new AdminMenuDisplayResponse($this->views);
$response->get_graphical_environment()->set_page_title('Importation');
$response->add_link($this->lang['menu.title'], DispatchManager::get_url('../wpimport', '/admin/import'), 'wpimport.png');
return $response;
}
开发者ID:ppelisset,项目名称:WPImport,代码行数:7,代码来源:WPImportStartController.class.php
示例5: execute
public function execute(HTTPRequestCustom $request)
{
$module_id = $request->get_getstring('module_id', '');
if (empty($module_id)) {
AppContext::get_response()->redirect(Environment::get_home_page());
}
$this->init();
$module_category_id = $request->get_getint('module_category_id', 0);
$feed_name = $request->get_getstring('feed_name', Feed::DEFAULT_FEED_NAME);
$feed = new ATOM($module_id, $feed_name, $module_category_id);
if ($feed !== null && $feed->is_in_cache()) {
$this->tpl->put('SYNDICATION', $feed->read());
} else {
$eps = AppContext::get_extension_provider_service();
if ($eps->provider_exists($module_id, FeedProvider::EXTENSION_POINT)) {
$provider = $eps->get_provider($module_id);
$feeds = $provider->feeds();
$data = $feeds->get_feed_data_struct($module_category_id, $feed_name);
if ($data === null) {
AppContext::get_response()->set_header('content-type', 'text/html');
DispatchManager::redirect(PHPBoostErrors::unexisting_element());
} else {
$feed->load_data($data);
$feed->cache();
$this->tpl->put('SYNDICATION', $feed->export());
}
} else {
DispatchManager::redirect(PHPBoostErrors::module_not_installed());
}
}
return $this->build_response($this->tpl);
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:32,代码来源:DisplayAtomSyndicationController.class.php
示例6: execute
public function execute(HTTPRequestCustom $request)
{
$id = $request->get_getint('id', 0);
if (!empty($id)) {
try {
$this->weblink = WebService::get_weblink('WHERE web.id = :id', array('id' => $id));
} catch (RowNotFoundException $e) {
$error_controller = PHPBoostErrors::unexisting_page();
DispatchManager::redirect($error_controller);
}
}
if ($this->weblink !== null && !DownloadAuthorizationsService::check_authorizations($this->weblink->get_id_category())->read()) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
} else {
if ($this->weblink !== null && $this->weblink->is_visible()) {
$this->weblink->set_number_views($this->weblink->get_number_views() + 1);
WebService::update_number_views($this->weblink);
WebCache::invalidate();
AppContext::get_response()->redirect($this->weblink->get_url()->absolute());
} else {
$error_controller = PHPBoostErrors::unexisting_page();
DispatchManager::redirect($error_controller);
}
}
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:26,代码来源:WebVisitWebLinkController.class.php
示例7: check_authorizations
private function check_authorizations()
{
if (!NewsletterAuthorizationsService::check_authorizations()->subscribe()) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:NewsletterSubscribeController.class.php
示例8: execute
public function execute(HTTPRequestCustom $request)
{
$id = $request->get_getint('id');
$this->init();
$extended_field = new ExtendedField();
$extended_field->set_id($id);
$exist_field = ExtendedFieldsDatabaseService::check_field_exist_by_id($extended_field);
if ($exist_field) {
$this->extended_field = ExtendedFieldsCache::load()->get_extended_field($id);
$this->build_form($request);
} else {
$error_controller = PHPBoostErrors::unexisting_page();
DispatchManager::redirect($error_controller);
}
$this->tpl = new StringTemplate('# INCLUDE MSG #
# INCLUDE FORM #
<script>
jQuery(document).ready(function() {
' . $this->get_events_select_type() . '});
</script>');
$this->tpl->add_lang($this->lang);
$this->tpl->put_all(array('FIELD_TYPE' => $this->extended_field['field_type']));
if ($this->submit_button->has_been_submited() && $this->form->validate()) {
$extended_field = $this->save($id);
$error = ExtendedFieldsService::get_error();
if (!empty($error)) {
$this->tpl->put('MSG', MessageHelper::display($error, MessageHelper::ERROR, 5));
} else {
AppContext::get_response()->redirect($this->form->get_value('referrer') ? $this->form->get_value('referrer') : AdminExtendedFieldsUrlBuilder::fields_list(), StringVars::replace_vars($this->lang['message.success.edit'], array('name' => $extended_field->get_name())));
}
}
$this->tpl->put('FORM', $this->form->display());
return new AdminExtendedFieldsDisplayResponse($this->tpl, $this->lang['extended-field-edit']);
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:34,代码来源:AdminExtendedFieldMemberEditController.class.php
示例9: check_authorizations
private function check_authorizations()
{
if (!BugtrackerAuthorizationsService::check_authorizations()->read()) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:BugtrackerStatsListController.class.php
示例10: get_url
/**
* @param bool $relative If false, compute the absolute url, else, returns the relative one
* @return Return the absolute feed Url
*/
public function get_url($relative = false)
{
$url = DispatchManager::get_url('/syndication', '/rss/' . $this->module_id . '/' . $this->category . '/' . $this->name . '/');
if ($relative) {
return $url->relative();
}
return $url->absolute();
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:12,代码来源:FeedMenu.class.php
示例11: build_response
private function build_response(View $tpl)
{
$title = LangLoader::get_message('configuration', 'admin');
$response = new AdminMenuDisplayResponse($tpl);
$response->set_title($title);
$response->add_link($this->lang['config.title'], DispatchManager::get_url('/QuestionCaptcha', '/admin/config/'));
$env = $response->get_graphical_environment();
$env->set_page_title($title);
return $response;
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:10,代码来源:AdminQuestionCaptchaConfig.class.php
示例12: __construct
public function __construct($view, $title_page)
{
parent::__construct($view);
$lang = LangLoader::get('admin-contents-common');
$this->set_title($lang['comments']);
$this->add_link($lang['comments.config'], DispatchManager::get_url('/admin/content/', '/comments/config/'));
$this->add_link($lang['comments.management'], UserUrlBuilder::comments());
$env = $this->get_graphical_environment();
$env->set_page_title($title_page);
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:10,代码来源:AdminCommentsDisplayResponse.class.php
示例13: execute
public function execute(HTTPRequestCustom $request)
{
$this->init();
if (!$this->user->check_level(User::MEMBER_LEVEL)) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
$this->build_form();
return $this->build_response($this->tpl);
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:10,代码来源:UserHomeProfileController.class.php
示例14: check_authorizations
private function check_authorizations(ShoutboxMessage $message)
{
if (!$message->is_authorized_to_delete()) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
if (AppContext::get_current_user()->is_readonly()) {
$controller = PHPBoostErrors::user_in_read_only();
DispatchManager::redirect($controller);
}
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:11,代码来源:ShoutboxDeleteController.class.php
示例15: get_pagination
private function get_pagination($number_users_online)
{
$page = AppContext::get_request()->get_getint('page', 1);
$pagination = new ModulePagination($page, $number_users_online, (int) $this->config->get_number_members_per_page());
$pagination->set_url(OnlineUrlBuilder::home('%d'));
if ($pagination->current_page_is_empty() && $page > 1) {
$error_controller = PHPBoostErrors::unexisting_page();
DispatchManager::redirect($error_controller);
}
return $pagination;
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:11,代码来源:OnlineHomeController.class.php
示例16: check_authorizations
private function check_authorizations()
{
if (!$this->downloadfile->is_authorized_to_delete()) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
if (AppContext::get_current_user()->is_readonly()) {
$error_controller = PHPBoostErrors::user_in_read_only();
DispatchManager::redirect($error_controller);
}
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:11,代码来源:DownloadDeleteController.class.php
示例17: check_authorizations
private function check_authorizations()
{
if (!BugtrackerAuthorizationsService::check_authorizations()->moderation() && $this->current_user->get_id() != $this->bug->get_assigned_to_id()) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
if (AppContext::get_current_user()->is_readonly()) {
$controller = PHPBoostErrors::user_in_read_only();
DispatchManager::redirect($controller);
}
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:11,代码来源:BugtrackerChangeBugStatusController.class.php
示例18: get_article
private function get_article(HTTPRequestCustom $request)
{
$id = $request->get_getint('id', 0);
if (!empty($id)) {
try {
return ArticlesService::get_article('WHERE articles.id=:id', array('id' => $id));
} catch (RowNotFoundException $e) {
$error_controller = PHPBoostErrors::unexisting_page();
DispatchManager::redirect($error_controller);
}
}
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:12,代码来源:ArticlesDeleteController.class.php
示例19: get_pagination
private function get_pagination()
{
$nbr_streams = PersistenceContext::get_querier()->count(NewsletterSetup::$newsletter_table_streams);
$page = AppContext::get_request()->get_getint('page', 1);
$pagination = new ModulePagination($page, $nbr_streams, $this->nbr_streams_per_page);
$pagination->set_url(NewsletterUrlBuilder::home('%d'));
if ($pagination->current_page_is_empty() && $page > 1) {
$error_controller = PHPBoostErrors::unexisting_page();
DispatchManager::redirect($error_controller);
}
return $pagination;
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:12,代码来源:NewsletterHomeController.class.php
示例20: execute
public function execute(HTTPRequestCustom $request)
{
$this->init();
$user_id = $request->get_getint('user_id', AppContext::get_current_user()->get_id());
try {
$this->user_infos = PersistenceContext::get_querier()->select_single_row(PREFIX . 'member', array('*'), 'WHERE user_id=:user_id', array('user_id' => $user_id));
} catch (RowNotFoundException $e) {
$error_controller = PHPBoostErrors::unexisting_element();
DispatchManager::redirect($error_controller);
}
$this->build_form($this->user_infos['user_id']);
$this->tpl->put('FORM', $this->form->display());
return $this->build_response($this->tpl, $user_id);
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:14,代码来源:UserViewProfileController.class.php
注:本文中的DispatchManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论