本文整理汇总了PHP中phpbb\controller\helper类的典型用法代码示例。如果您正苦于以下问题:PHP helper类的具体用法?PHP helper怎么用?PHP helper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了helper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_page_viewonline
/**
*
*/
public function add_page_viewonline($event)
{
if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/mchat') === 0) {
$event['location'] = $this->user->lang('MCHAT_TITLE');
$event['location_url'] = $this->helper->route('dmzx_mchat_controller');
}
}
示例2: article
/**
* Display an article
*
* @param string $article URL of the article
* @return object
*/
public function article($article)
{
$this->user->add_lang_ext('tas2580/wiki', 'common');
if (!$this->auth->acl_get('u_wiki_view')) {
trigger_error('NOT_AUTHORISED');
}
$this->template->assign_block_vars('navlinks', array('FORUM_NAME' => $this->user->lang['WIKI'], 'U_VIEW_FORUM' => $this->helper->route('tas2580_wiki_index', array())));
$this->template->assign_vars(array('WIKI_FOOTER' => $this->user->lang('WIKI_FOOTER', base64_decode('aHR0cHM6Ly90YXMyNTgwLm5ldA=='), base64_decode('dGFzMjU4MA=='))));
include $this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext;
include $this->phpbb_root_path . 'includes/functions_posting.' . $this->php_ext;
$action = $this->request->variable('action', '');
$id = $this->request->variable('id', 0);
switch ($action) {
case 'edit':
return $this->edit->edit_article($article);
case 'versions':
return $this->compare->view_versions($article);
case 'compare':
$from = $this->request->variable('from', 0);
$to = $this->request->variable('to', 0);
return $this->compare->compare_versions($article, $from, $to);
case 'delete':
return $this->delete->version($id);
case 'detele_article':
return $this->delete->article($article);
case 'active':
return $this->edit->active($id);
case 'deactivate':
return $this->edit->deactivate($article);
default:
return $this->view->view_article($article, $id);
}
}
示例3: handle
public function handle()
{
$title = $this->display();
$this->template->assign_vars(array('L_FAQ_TITLE' => $title, 'S_IN_FAQ' => true));
make_jumpbox(append_sid("{$this->root_path}viewforum.{$this->php_ext}"));
return $this->helper->render('faq_body.html', $title);
}
示例4: page
/**
* Controller for route /paypal
*
* @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
*/
public function page()
{
$this->user->add_lang_ext('tas2580/paypal', 'common');
$amount_list = '';
$sql = 'SELECT *
FROM ' . $this->table_amount . '
ORDER BY amount_value';
$result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result)) {
$amount_list .= '<option value="' . number_format($row['amount_value'] / 100, 2) . '">' . number_format($row['amount_value'] / 100, 2) . '</option>';
}
$sql = 'SELECT *
FROM ' . $this->table_items . '
ORDER BY item_name';
$result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result)) {
$this->template->assign_block_vars('items', array('ITEM_NAME' => $row['item_name'], 'ITEM' => generate_text_for_display($row['item_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], 7), 'ITEM_ID' => $row['item_id']));
}
$sql = 'SELECT *
FROM ' . $this->table_config;
$result = $this->db->sql_query($sql);
$row = $this->db->sql_fetchrow($result);
$this->template->assign_vars(array('PAYPAL_TITLE' => $row['paypal_title'], 'PAYPAL_TEXT' => generate_text_for_display($row['paypal_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], 7), 'PAYPAL_EMAIL' => $row['paypal_email'], 'AMOUNT_LIST' => $amount_list, 'PAYPAL_ACTION' => $row['paypal_sandbox'] == 1 ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr', 'S_SANDBOX' => $row['paypal_sandbox'] == 1 ? true : false, 'S_CURL' => function_exists('curl_init'), 'CURRENCY_CODE' => $this->currency_code_select($row['paypal_currency']), 'CURRENCY' => $row['paypal_currency'], 'USER_ID' => $this->user->data['user_id'], 'IPN_URL' => $this->helper->route('tas2580_paypal_ipn', array(), true, '', \Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL), 'RETURN_URL' => $this->helper->route('tas2580_paypal_controller', array(), true, '', \Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL)));
return $this->helper->render('paypal_body.html', $row['paypal_title']);
}
示例5: prepare_user_reputation_data
/**
* Display user reputation on user profile page
*
* @param object $event The event object
* @return null
* @access public
*/
public function prepare_user_reputation_data($event)
{
$data = $event['data'];
$template_data = $event['template_data'];
$template_data = array_merge($template_data, array('USER_REPUTATION' => $data['user_reputation'], 'U_VIEW_USER_REPUTATION' => $this->helper->route('reputation_details_controller', array('uid' => $data['user_id'])), 'U_RATE_USER' => $this->helper->route('reputation_user_rating_controller', array('uid' => $data['user_id'])), 'U_REPUTATION_REFERER' => $this->helper->get_current_url(), 'S_RATE_USER' => $this->config['rs_user_rating'] && $this->auth->acl_get('u_rs_rate') ? true : false, 'S_VIEW_REPUTATION' => $this->auth->acl_get('u_rs_view') ? true : false));
$event['template_data'] = $template_data;
}
示例6: page_header
/**
* Add link to header
*
* @param object $event The event object
* @return null
* @access public
*/
public function page_header($event)
{
if ($this->auth->acl_get('u_usermap_view')) {
$this->user->add_lang_ext('tas2580/usermap', 'link');
$this->template->assign_vars(array('U_USERMAP' => $this->helper->route('tas2580_usermap_index', array())));
}
}
示例7: downloader
/**
* @param $id post_id
* @param $part Code part
* @return mixed Render output to the template
**/
public function downloader($id = 0, $part = 0)
{
$id = (int) $id;
// If download function was disabled
if (!$this->enable_download) {
$this->template->assign_var('S_CODEBOX_PLUS_ERROR', $this->user->lang['CODEBOX_PLUS_ERROR_DOWNLOAD_DISABLED']);
return $this->helper->render('codebox_plus.html', $this->user->lang['CODEBOX_PLUS_DOWNLOAD']);
}
// Prevent bots
if ($this->enable_prevent_bots && $this->user->data['is_bot']) {
redirect(append_sid("{$this->root_path}index.{$this->php_ext}"));
}
// Check permission
$sql = 'SELECT forum_id FROM ' . POSTS_TABLE . ' WHERE post_id = ' . $id;
$result = $this->db->sql_query($sql);
$row = $this->db->sql_fetchrow($result);
$this->db->sql_freeresult($result);
if (!$this->auth->acl_get('f_read', $row['forum_id'])) {
$this->template->assign_var('S_CODEBOX_PLUS_ERROR', $this->user->lang['CODEBOX_PLUS_ERROR_NO_PERMISSION']);
return $this->helper->render('codebox_plus.html', $this->user->lang['CODEBOX_PLUS_DOWNLOAD']);
}
// Login to download
if ($this->enable_login_required && !$this->user->data['is_registered']) {
login_box($this->helper->route('o0johntam0o_codeboxplus_download_controller', array('id' => $id, 'part' => $part)), $this->user->lang['CODEBOX_PLUS_ERROR_LOGIN_REQUIRED']);
}
// Captcha
if ($this->enable_captcha) {
$tmp_captcha = $this->captcha->get_instance($this->config['captcha_plugin']);
$tmp_captcha->init(CONFIRM_LOGIN);
$ok = false;
if ($this->request->is_set_post('submit')) {
$tmp_captcha->validate();
if ($tmp_captcha->is_solved()) {
$tmp_captcha->reset();
$ok = true;
}
}
// If the form was not submitted yet or the CAPTCHA was not solved
if (!$ok) {
// Too many request...
if ($tmp_captcha->get_attempt_count() >= $this->max_attempt) {
$this->template->assign_var('S_CODEBOX_PLUS_ERROR', $this->user->lang['CODEBOX_PLUS_ERROR_CONFIRM']);
return $this->helper->render('codebox_plus.html', $this->user->lang['CODEBOX_PLUS_DOWNLOAD']);
}
$this->template->assign_vars(array('S_CODE_DOWNLOADER_ACTION' => $this->helper->route('o0johntam0o_codeboxplus_download_controller', array('id' => $id, 'part' => $part)), 'S_CONFIRM_CODE' => true, 'CAPTCHA_TEMPLATE' => $tmp_captcha->get_template()));
return $this->helper->render('codebox_plus.html', $this->user->lang['CODEBOX_PLUS_DOWNLOAD']);
} else {
// Downloading
$this->codebox_output($id, $part);
garbage_collection();
return $this->helper->render('codebox_plus.html', $this->user->lang['CODEBOX_PLUS_DOWNLOAD']);
//exit_handler();
}
} else {
// Downloading
$this->codebox_output($id, $part);
return $this->helper->render('codebox_plus.html', $this->user->lang['CODEBOX_PLUS_DOWNLOAD']);
}
}
示例8: base
public function base()
{
if (!$this->auth->acl_get('a_')) {
return $this->settings->finish('SLIDER_INVALID_LOGIN', 400, 4, 'slider_home');
}
$this->slider_settings();
return $this->helper->render('nivoslider.html', 'Options Panel');
}
示例9: viewonline_page
public function viewonline_page($event)
{
if ($event['on_page'][1] == 'app') {
if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/contact') === 0) {
$event['location'] = $this->user->lang('CONTACTFORM_VIEWONLINE');
$event['location_url'] = $this->helper->route('phpbbde_contactform_main_controller');
}
}
}
示例10: location_viewonline
public function location_viewonline($event)
{
if ($event['on_page'][1] == 'app') {
if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/rating') === 0) {
$event['location'] = $this->user->lang['VIEWING_RATING'];
$event['location_url'] = $this->helper->route("bb3top_rating_top");
}
}
}
示例11: handle
public function handle()
{
if (!function_exists('display_forums')) {
include $this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext;
}
display_forums('', $this->config['load_moderators']);
$this->template->assign_block_vars('navlinks', array('FORUM_NAME' => $this->user->lang('FORUM'), 'U_VIEW_FORUM' => $this->helper->route('blitze_sitemaker_forum')));
return $this->helper->render('index_body.html', $this->user->lang('FORUM_INDEX'));
}
示例12: attachments_data
public function attachments_data($event)
{
$topic_id = $event['topic_id'];
$sql = 'SELECT COUNT(attach_id) as num_attachments
FROM ' . ATTACHMENTS_TABLE . " a\n\t\t\tWHERE topic_id = {$topic_id}\n\t\t\t\tAND a.is_orphan = 0";
$result = $this->db->sql_query($sql);
$num_attachments = $this->db->sql_fetchfield('num_attachments');
$this->db->sql_freeresult($result);
$this->template->assign_vars(array('U_ATTACHMENTS_TOPIC' => $this->helper->route("bb3mobi_attach_cat", array('t' => $topic_id)), 'TOTAL_ATTACH_TOPIC' => (int) $num_attachments));
}
示例13: page_header
public function page_header($event)
{
$nru_group_id = $this->functions->getnruid();
if (!$this->config['appform_nru'] && $nru_group_id === (int) $this->user->data['group_id'] || $this->user->data['is_bot'] || $this->user->data['user_id'] == ANONYMOUS) {
$this->template->assign_var('U_APP_FORM', false);
return;
}
$this->user->add_lang_ext('rmcgirr83/applicationform', 'common');
$this->template->assign_var('U_APP_FORM', $this->helper->route('rmcgirr83_applicationform_displayform'));
}
示例14: add_page_header_links
public function add_page_header_links($event)
{
$this->template->assign_vars(array('DONATION_ACHIEVEMENT_ENABLE' => isset($this->config['donation_achievement_enable']) ? $this->config['donation_achievement_enable'] : false, 'DONATION_ACHIEVEMENT' => isset($this->config['donation_achievement']) ? $this->config['donation_achievement'] : false, 'DONATION_INDEX_ENABLE' => isset($this->config['donation_index_enable']) ? $this->config['donation_index_enable'] : false, 'DONATION_INDEX_TOP' => isset($this->config['donation_index_top']) ? $this->config['donation_index_top'] : false, 'DONATION_INDEX_BOTTOM' => isset($this->config['donation_index_bottom']) ? $this->config['donation_index_bottom'] : false, 'DONATION_GOAL_ENABLE' => isset($this->config['donation_goal_enable']) ? $this->config['donation_goal_enable'] : false, 'DONATION_GOAL' => isset($this->config['donation_goal']) ? $this->config['donation_goal'] : false, 'DONATION_GOAL_CURRENCY_ENABLE' => isset($this->config['donation_goal_currency_enable']) ? $this->config['donation_goal_currency_enable'] : false, 'DONATION_GOAL_CURRENCY' => isset($this->config['donation_goal_currency']) ? $this->config['donation_goal_currency'] : false, 'S_DONATE_ENABLED' => isset($this->config['donation_enable']) ? $this->config['donation_enable'] : false));
if (!empty($this->config['donation_goal_enable']) && $this->config['donation_goal'] > 0) {
$donation_goal_number = $this->config['donation_achievement'] * 100 / $this->config['donation_goal'];
$donation_goal_rest = $this->config['donation_goal'] - $this->config['donation_achievement'];
$this->template->assign_vars(array('DONATION_GOAL_NUMBER' => round($donation_goal_number), 'DONATION_GOAL_REST' => $donation_goal_rest));
}
$this->template->assign_vars(array('U_DONATE' => $this->controller_helper->route('dmzx_donation_controller')));
}
示例15: page_header
public function page_header($event)
{
$nru_group_id = $this->applicationform->getnruid();
if (!$this->config['appform_nru'] && $nru_group_id === (int) $this->user->data['group_id'] || $this->user->data['is_bot'] || $this->user->data['user_id'] == ANONYMOUS) {
$this->template->assign_var('U_APP_FORM', false);
return false;
}
$version = phpbb_version_compare($this->config['version'], '3.2.0-b2', '>=');
$this->user->add_lang_ext('rmcgirr83/applicationform', 'common');
$this->template->assign_vars(array('U_APP_FORM' => $this->helper->route('rmcgirr83_applicationform_displayform'), 'S_FORUM_VERSION' => $version));
}