Merge branch '2.1.x'
This commit is contained in:
@@ -66,7 +66,7 @@ class portal_module
|
||||
define('PORTAL_CONFIG_TABLE', $this->phpbb_container->getParameter('board3.portal.config.table'));
|
||||
}
|
||||
|
||||
if(!function_exists('obtain_portal_config'))
|
||||
if (!function_exists('obtain_portal_config'))
|
||||
{
|
||||
include($this->root_path . 'includes/functions.' . $this->php_ext);
|
||||
}
|
||||
@@ -145,7 +145,7 @@ class portal_module
|
||||
'MODULE_SHOW_IMAGE' => (in_array($this->portal_columns->number_to_string($module_data['module_column']), array('center', 'top', 'bottom'))) ? false : true,
|
||||
));
|
||||
|
||||
if($module_data['module_classname'] != '\board3\portal\modules\custom')
|
||||
if ($module_data['module_classname'] != '\board3\portal\modules\custom')
|
||||
{
|
||||
$groups_ary = explode(',', $module_data['module_group_ids']);
|
||||
|
||||
@@ -154,7 +154,7 @@ class portal_module
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
ORDER BY group_id ASC';
|
||||
$result = $this->db->sql_query($sql);
|
||||
while($row = $this->db->sql_fetchrow($result))
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$this->template->assign_block_vars('permission_setting', array(
|
||||
'SELECTED' => (in_array($row['group_id'], $groups_ary)) ? true : false,
|
||||
@@ -194,7 +194,7 @@ class portal_module
|
||||
// Reset module
|
||||
$reset_module = $this->request->variable('module_reset', 0);
|
||||
|
||||
if($reset_module && !empty($module_data))
|
||||
if ($reset_module && !empty($module_data))
|
||||
{
|
||||
$this->modules_manager->reset_module($id, $mode, $module_id, $module_data);
|
||||
}
|
||||
@@ -243,7 +243,7 @@ class portal_module
|
||||
continue;
|
||||
}
|
||||
|
||||
if(isset($null['type']) && $null['type'] == 'custom')
|
||||
if (isset($null['type']) && $null['type'] == 'custom')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -266,7 +266,7 @@ class portal_module
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
ORDER BY group_id ASC';
|
||||
$result = $this->db->sql_query($sql);
|
||||
while($row = $this->db->sql_fetchrow($result))
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$groups_ary[] = $row['group_id'];
|
||||
}
|
||||
@@ -283,7 +283,7 @@ class portal_module
|
||||
'module_status' => $this->request->variable('module_status', self::B3_MODULE_ENABLED),
|
||||
);
|
||||
|
||||
if(!(isset($this->c_class->hide_name) && $this->c_class->hide_name == true))
|
||||
if (!(isset($this->c_class->hide_name) && $this->c_class->hide_name == true))
|
||||
{
|
||||
$sql_ary['module_name'] = $this->request->variable('module_name', '', true);
|
||||
}
|
||||
@@ -299,7 +299,7 @@ class portal_module
|
||||
$this->cache->destroy('sql', PORTAL_MODULES_TABLE);
|
||||
$this->cache->destroy('sql', CONFIG_TABLE);
|
||||
|
||||
if(isset($module_name))
|
||||
if (isset($module_name))
|
||||
{
|
||||
if (isset($module_data) && $module_data['module_classname'] !== '\board3\portal\modules\custom')
|
||||
{
|
||||
@@ -314,7 +314,7 @@ class portal_module
|
||||
}
|
||||
|
||||
// show custom HTML files on the settings page of the modules instead of the standard board3 portal one, if chosen by module
|
||||
if(!isset($this->c_class->custom_acp_tpl) || empty($this->c_class->custom_acp_tpl))
|
||||
if (!isset($this->c_class->custom_acp_tpl) || empty($this->c_class->custom_acp_tpl))
|
||||
{
|
||||
$this->tpl_name = 'portal/acp_portal_config';
|
||||
}
|
||||
@@ -361,7 +361,7 @@ class portal_module
|
||||
$l_explain = (isset($this->user->lang[$vars['lang'] . '_EXP'])) ? $this->user->lang[$vars['lang'] . '_EXP'] : '';
|
||||
}
|
||||
|
||||
if($vars['type'] != 'custom')
|
||||
if ($vars['type'] != 'custom')
|
||||
{
|
||||
$content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars);
|
||||
}
|
||||
@@ -410,7 +410,7 @@ class portal_module
|
||||
$portal_modules = obtain_portal_modules();
|
||||
$installed_modules = $module_column = array();
|
||||
|
||||
foreach($portal_modules as $cur_module)
|
||||
foreach ($portal_modules as $cur_module)
|
||||
{
|
||||
$installed_modules[] = $cur_module['module_classname'];
|
||||
// Create an array with the columns the module is in
|
||||
@@ -427,11 +427,11 @@ class portal_module
|
||||
{
|
||||
$this->modules_manager->move_module_vertical($module_id, \board3\portal\portal\modules\database_handler::MOVE_DIRECTION_DOWN);
|
||||
}
|
||||
else if($action == 'move_right')
|
||||
else if ($action == 'move_right')
|
||||
{
|
||||
$this->modules_manager->move_module_horizontal($module_id, \board3\portal\portal\modules\database_handler::MOVE_DIRECTION_RIGHT);
|
||||
}
|
||||
else if($action == 'move_left')
|
||||
else if ($action == 'move_left')
|
||||
{
|
||||
$this->modules_manager->move_module_horizontal($module_id, \board3\portal\portal\modules\database_handler::MOVE_DIRECTION_LEFT);
|
||||
}
|
||||
@@ -502,7 +502,7 @@ class portal_module
|
||||
if (is_array($error))
|
||||
{
|
||||
$error_output = '';
|
||||
foreach($error as $cur_error)
|
||||
foreach ($error as $cur_error)
|
||||
{
|
||||
$error_output .= $cur_error . '<br />';
|
||||
}
|
||||
@@ -556,7 +556,7 @@ class portal_module
|
||||
}
|
||||
|
||||
// we sort the $fileinfo array by the name of the modules
|
||||
foreach($fileinfo as $key => $cur_file)
|
||||
foreach ($fileinfo as $key => $cur_file)
|
||||
{
|
||||
$name_ary[$key] = $cur_file['name'];
|
||||
}
|
||||
@@ -600,7 +600,7 @@ class portal_module
|
||||
{
|
||||
$portal_modules = obtain_portal_modules();
|
||||
|
||||
foreach($portal_modules as $row)
|
||||
foreach ($portal_modules as $row)
|
||||
{
|
||||
if (!($this->c_class = $this->portal_helper->get_module($row['module_classname'])))
|
||||
{
|
||||
@@ -613,7 +613,7 @@ class portal_module
|
||||
$template_column = $this->portal_columns->number_to_string($row['module_column']);
|
||||
|
||||
// find out of we can move modules to the left or right
|
||||
if(($this->c_class->get_allowed_columns() & $this->portal_columns->string_to_constant($this->portal_columns->number_to_string($row['module_column'] + 1))) || ($this->c_class->get_allowed_columns() & $this->portal_columns->string_to_constant($this->portal_columns->number_to_string($row['module_column'] + 2)) && $row['module_column'] != 2))
|
||||
if (($this->c_class->get_allowed_columns() & $this->portal_columns->string_to_constant($this->portal_columns->number_to_string($row['module_column'] + 1))) || ($this->c_class->get_allowed_columns() & $this->portal_columns->string_to_constant($this->portal_columns->number_to_string($row['module_column'] + 2)) && $row['module_column'] != 2))
|
||||
{
|
||||
/**
|
||||
* check if we can actually move
|
||||
@@ -643,7 +643,7 @@ class portal_module
|
||||
$move_right = false;
|
||||
}
|
||||
|
||||
if(($this->c_class->get_allowed_columns() & $this->portal_columns->string_to_constant($this->portal_columns->number_to_string($row['module_column'] - 1))) || ($this->c_class->get_allowed_columns() & $this->portal_columns->string_to_constant($this->portal_columns->number_to_string($row['module_column'] - 2)) && $row['module_column'] != 2))
|
||||
if (($this->c_class->get_allowed_columns() & $this->portal_columns->string_to_constant($this->portal_columns->number_to_string($row['module_column'] - 1))) || ($this->c_class->get_allowed_columns() & $this->portal_columns->string_to_constant($this->portal_columns->number_to_string($row['module_column'] - 2)) && $row['module_column'] != 2))
|
||||
{
|
||||
/**
|
||||
* check if we can actually move
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
"type": "phpbb-extension",
|
||||
"description": "Adds a portal with several blocks to your forum. You can change the settings, move the blocks, add new blocks and more in the ACP.",
|
||||
"homepage": "http://www.board3.de",
|
||||
"version": "2.1.0-rc3",
|
||||
"time": "2015-05-07 14:01:15",
|
||||
"version": "2.1.0",
|
||||
"time": "2015-05-07 14:47:44",
|
||||
"license": "GPL-2.0",
|
||||
"authors": [{
|
||||
"name": "Marc Alexander",
|
||||
|
||||
@@ -84,8 +84,10 @@ services:
|
||||
class: board3\portal\modules\donation
|
||||
arguments:
|
||||
- @config
|
||||
- @request
|
||||
- @template
|
||||
- @user
|
||||
- @board3.portal.modules_helper
|
||||
tags:
|
||||
- { name: board3.portal.module }
|
||||
|
||||
|
||||
@@ -340,7 +340,7 @@ function get_portal_tracking_info($fetch_news)
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// @todo: do not use $current_forum here as this is already used by the outside foreach
|
||||
foreach($forum_ids as $current_forum)
|
||||
foreach ($forum_ids as $current_forum)
|
||||
{
|
||||
$user_lastmark[$current_forum] = (isset($mark_time[$current_forum])) ? $mark_time[$current_forum] : $user->data['user_lastmark'];
|
||||
}
|
||||
@@ -471,7 +471,7 @@ function get_user_groups()
|
||||
WHERE user_id = ' . (int) $user->data['user_id'] . '
|
||||
ORDER BY group_id ASC';
|
||||
$result = $db->sql_query($sql);
|
||||
while($row = $db->sql_fetchrow($result))
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$groups_ary[] = $row['group_id'];
|
||||
}
|
||||
|
||||
@@ -85,7 +85,8 @@ class modules_helper
|
||||
public function generate_select_box($key, $select_ary, $selected_options)
|
||||
{
|
||||
// Build options
|
||||
$options = '<select id="' . $key . '" name="' . $key . '[]" multiple="multiple">';
|
||||
$options = '<select id="' . $key . '" name="' . $key;
|
||||
$options .= (sizeof($selected_options) > 1) ? '[]" multiple="multiple">' : '">';
|
||||
foreach ($select_ary as $id => $option)
|
||||
{
|
||||
$options .= '<option value="' . $option['value'] . '"' . ((in_array($option['value'], $selected_options)) ? ' selected="selected"' : '') . (!empty($option['disabled']) ? ' disabled="disabled" class="disabled-option"' : '') . '>' . $option['title'] . '</option>';
|
||||
@@ -109,10 +110,15 @@ class modules_helper
|
||||
$forum_list = make_forum_select(false, false, true, true, true, false, true);
|
||||
|
||||
$selected_options = $select_ary = array();
|
||||
if(isset($this->config[$key]) && strlen($this->config[$key]) > 0)
|
||||
if (isset($this->config[$key]) && strlen($this->config[$key]) > 0)
|
||||
{
|
||||
$selected_options = explode(',', $this->config[$key]);
|
||||
}
|
||||
// Add useless values to force multi drop down list
|
||||
$selected_options += array(
|
||||
'-1' => '',
|
||||
'-2' => '',
|
||||
);
|
||||
|
||||
// Build forum options
|
||||
foreach ($forum_list as $f_id => $f_row)
|
||||
|
||||
@@ -57,9 +57,11 @@ $lang = array_merge($lang, array(
|
||||
'ILS' => 'Neue Israelische Schekel (ILS)',
|
||||
|
||||
// ACP
|
||||
'ACP_PORTAL_PAYPAL_SETTINGS' => 'Paypal Einstellungen',
|
||||
'ACP_PORTAL_PAYPAL_SETTINGS' => 'Paypal Einstellungen',
|
||||
'ACP_PORTAL_PAYPAL_SETTINGS_EXP' => 'Hier kannst du die Paypal Einstellungen ändern.',
|
||||
'PORTAL_PAY_ACC' => 'Paypal Account',
|
||||
'PORTAL_PAY_ACC' => 'Paypal Account',
|
||||
'PORTAL_PAY_ACC_EXP' => 'Gib deine e-mail-Adresse an, die du bei Paypal benutzt, z.B. xxx@xxx.com',
|
||||
'PORTAL_PAY_CUSTOM' => 'Benutzername an die Paypal Zahlung anhängen',
|
||||
'PORTAL_PAY_CUSTOM' => 'Benutzername an die Paypal Zahlung anhängen',
|
||||
'PORTAL_PAY_DEFAULT' => 'Standard-Währung',
|
||||
'PORTAL_PAY_DEFAULT_EXP' => 'Währung die standardmäßig in der Drop-Down-Liste ausgewählt ist.'
|
||||
));
|
||||
|
||||
@@ -61,5 +61,7 @@ $lang = array_merge($lang, array(
|
||||
'ACP_PORTAL_PAYPAL_SETTINGS_EXP' => 'This is where you customize the Paypal block.',
|
||||
'PORTAL_PAY_ACC' => 'Paypal account to use',
|
||||
'PORTAL_PAY_ACC_EXP' => 'Enter your Paypal e-mail address eg. xxx@xxx.com',
|
||||
'PORTAL_PAY_CUSTOM' => 'Append username to Paypal donation',
|
||||
'PORTAL_PAY_CUSTOM' => 'Append username to Paypal donation',
|
||||
'PORTAL_PAY_DEFAULT' => 'Default currency',
|
||||
'PORTAL_PAY_DEFAULT_EXP' => 'Currency that will be selected by default in currency drop down list.'
|
||||
));
|
||||
|
||||
42
migrations/v210.php
Normal file
42
migrations/v210.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package Board3 Portal v2.1
|
||||
* @copyright (c) 2015 Board3 Group ( www.board3.de )
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
namespace board3\portal\migrations;
|
||||
|
||||
class v210 extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array('\board3\portal\migrations\v210_rc3');
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.update', array('board3_portal_version', '2.1.0')),
|
||||
array('custom', array(array($this, 'add_donation_setting'))),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds default currency setting to already installed donation modules
|
||||
*/
|
||||
public function add_donation_setting()
|
||||
{
|
||||
$sql = 'SELECT module_id
|
||||
FROM ' . $this->table_prefix . "portal_modules
|
||||
WHERE module_classname = '\\\board3\\\portal\\\modules\\\donation'";
|
||||
$result = $this->db->sql_query($sql);
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$this->config->set('board3_pay_default_' . $row['module_id'], 'EUR');
|
||||
}
|
||||
$this->db->sql_freeresult($result);
|
||||
}
|
||||
}
|
||||
@@ -201,7 +201,7 @@ class v210_beta1 extends \phpbb\db\migration\migration
|
||||
$sql = 'SELECT group_id, group_name FROM ' . $this->table_prefix . 'groups
|
||||
WHERE ' . $this->db->sql_in_set('group_name', $in_ary);
|
||||
$result = $this->db->sql_query($sql);
|
||||
while($row = $this->db->sql_fetchrow($result))
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$groups_ary[$row['group_name']] = $row['group_id'];
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ class announcements extends module_base
|
||||
);
|
||||
|
||||
$topic_icons = false;
|
||||
if(!empty($fetch_news['topic_icons']))
|
||||
if (!empty($fetch_news['topic_icons']))
|
||||
{
|
||||
$topic_icons = true;
|
||||
}
|
||||
@@ -182,7 +182,7 @@ class announcements extends module_base
|
||||
// Get disallowed forums
|
||||
$disallow_access = $this->modules_helper->get_disallowed_forums($permissions);
|
||||
|
||||
if($this->config['board3_announcements_forum_exclude_' . $module_id] == true)
|
||||
if ($this->config['board3_announcements_forum_exclude_' . $module_id] == true)
|
||||
{
|
||||
$disallow_access = array_merge($disallow_access, $forum_from);
|
||||
$forum_from = array();
|
||||
@@ -190,18 +190,18 @@ class announcements extends module_base
|
||||
|
||||
$global_f = 0;
|
||||
|
||||
if(sizeof($forum_from))
|
||||
if (sizeof($forum_from))
|
||||
{
|
||||
$disallow_access = array_diff($forum_from, $disallow_access);
|
||||
if(!sizeof($disallow_access))
|
||||
if (!sizeof($disallow_access))
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
foreach($disallow_access as $acc_id)
|
||||
foreach ($disallow_access as $acc_id)
|
||||
{
|
||||
$str_where .= 'forum_id = ' . (int) $acc_id . ' OR ';
|
||||
if($global_f < 1 && $acc_id > 0)
|
||||
if ($global_f < 1 && $acc_id > 0)
|
||||
{
|
||||
$global_f = $acc_id;
|
||||
}
|
||||
@@ -209,7 +209,7 @@ class announcements extends module_base
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($disallow_access as $acc_id)
|
||||
foreach ($disallow_access as $acc_id)
|
||||
{
|
||||
$str_where .= 'forum_id <> ' . (int) $acc_id . ' AND ';
|
||||
}
|
||||
@@ -247,12 +247,12 @@ class announcements extends module_base
|
||||
$this->template->assign_block_vars('announcements', $announcements_row);
|
||||
|
||||
// Show the announcements overview
|
||||
if($announcement < 0)
|
||||
if ($announcement < 0)
|
||||
{
|
||||
$count = $fetch_news['topic_count'];
|
||||
for ($i = 0; $i < $count; $i++)
|
||||
{
|
||||
if(isset($fetch_news[$i]['striped']) && $fetch_news[$i]['striped'] == true)
|
||||
if (isset($fetch_news[$i]['striped']) && $fetch_news[$i]['striped'] == true)
|
||||
{
|
||||
$open_bracket = '[ ';
|
||||
$close_bracket = ' ]';
|
||||
@@ -352,7 +352,7 @@ class announcements extends module_base
|
||||
|
||||
$this->pagination->generate_template_pagination($view_topic_url, 'announcements.center_row.pagination', 'start', $fetch_news[$i]['topic_replies'] + 1, $this->config['posts_per_page'], 1, true, true);
|
||||
|
||||
if(!empty($fetch_news[$i]['attachments']))
|
||||
if (!empty($fetch_news[$i]['attachments']))
|
||||
{
|
||||
foreach ($fetch_news[$i]['attachments'] as $attachment)
|
||||
{
|
||||
@@ -415,7 +415,7 @@ class announcements extends module_base
|
||||
|
||||
$this->pagination->generate_template_pagination($view_topic_url, 'announcements.center_row.pagination', 'start', $fetch_news[$i]['topic_replies'] + 1, $this->config['posts_per_page'], 1, true, true);
|
||||
|
||||
if(!empty($fetch_news[$i]['attachments']))
|
||||
if (!empty($fetch_news[$i]['attachments']))
|
||||
{
|
||||
foreach ($fetch_news[$i]['attachments'] as $attachment)
|
||||
{
|
||||
|
||||
@@ -230,12 +230,12 @@ class attachments extends module_base
|
||||
// Get filetypes and put them into an array
|
||||
$filetypes = $this->get_selected_filetypes($module_id);
|
||||
|
||||
if($this->config['board3_attachments_forum_ids_' . $module_id] !== '')
|
||||
if ($this->config['board3_attachments_forum_ids_' . $module_id] !== '')
|
||||
{
|
||||
$attach_forums_config = (strpos($this->config['board3_attachments_forum_ids_' . $module_id], ',') !== false) ? explode(',', $this->config['board3_attachments_forum_ids_' . $module_id]) : array($this->config['board3_attachments_forum_ids_' . $module_id]);
|
||||
$forum_list = array_unique(array_keys($this->auth->acl_getf('f_read', true)));
|
||||
|
||||
if($this->config['board3_attachments_forum_exclude_' . $module_id])
|
||||
if ($this->config['board3_attachments_forum_exclude_' . $module_id])
|
||||
{
|
||||
$forum_list = array_unique(array_diff($forum_list, $attach_forums_config));
|
||||
}
|
||||
@@ -249,15 +249,15 @@ class attachments extends module_base
|
||||
$forum_list = array_unique(array_keys($this->auth->acl_getf('f_read', true)));
|
||||
}
|
||||
|
||||
if(sizeof($forum_list))
|
||||
if (sizeof($forum_list))
|
||||
{
|
||||
$attach_forums = true;
|
||||
$where = 'AND ' . $this->db->sql_in_set('t.forum_id', $forum_list);
|
||||
}
|
||||
|
||||
if(sizeof($filetypes))
|
||||
if (sizeof($filetypes))
|
||||
{
|
||||
if($this->config['board3_attachments_exclude_' . $module_id])
|
||||
if ($this->config['board3_attachments_exclude_' . $module_id])
|
||||
{
|
||||
$where .= ' AND ' . $this->db->sql_in_set('a.extension', $filetypes, true);
|
||||
}
|
||||
@@ -267,7 +267,7 @@ class attachments extends module_base
|
||||
}
|
||||
}
|
||||
|
||||
if($attach_forums === true)
|
||||
if ($attach_forums === true)
|
||||
{
|
||||
// Just grab all attachment info from database
|
||||
$sql = 'SELECT
|
||||
@@ -328,7 +328,7 @@ class attachments extends module_base
|
||||
protected function get_selected_filetypes($module_id)
|
||||
{
|
||||
$selected = array();
|
||||
if(isset($this->config['board3_attachments_filetype_' . $module_id]) && strlen($this->config['board3_attachments_filetype_' . $module_id]) > 0)
|
||||
if (isset($this->config['board3_attachments_filetype_' . $module_id]) && strlen($this->config['board3_attachments_filetype_' . $module_id]) > 0)
|
||||
{
|
||||
$selected = explode(',', $this->config['board3_attachments_filetype_' . $module_id]);
|
||||
}
|
||||
|
||||
@@ -44,24 +44,56 @@ class donation extends module_base
|
||||
/** @var \phpbb\config\config */
|
||||
protected $config;
|
||||
|
||||
/** @var \phpbb\template */
|
||||
/** @var \phpbb\request\request_interface */
|
||||
protected $request;
|
||||
|
||||
/** @var \phpbb\template\template */
|
||||
protected $template;
|
||||
|
||||
/** @var \phpbb\user */
|
||||
protected $user;
|
||||
|
||||
/** @var \board3\portal\includes\modules_helper */
|
||||
protected $helper;
|
||||
|
||||
/** @var array List of currencies supported in donations */
|
||||
protected $currencies = array(
|
||||
'AUD',
|
||||
'CAD',
|
||||
'CZK',
|
||||
'DKK',
|
||||
'HKD',
|
||||
'HUF',
|
||||
'NZD',
|
||||
'NOK',
|
||||
'PLN',
|
||||
'GBP',
|
||||
'SGD',
|
||||
'SEK',
|
||||
'CHF',
|
||||
'JPY',
|
||||
'USD',
|
||||
'EUR',
|
||||
'MXN',
|
||||
'ILS',
|
||||
);
|
||||
|
||||
/**
|
||||
* Construct a stylechanger object
|
||||
* Construct a donation module object
|
||||
*
|
||||
* @param \phpbb\config\config $config phpBB config
|
||||
* @param \phpbb\template $template phpBB template
|
||||
* @param \phpbb\request\request_interface $request Request
|
||||
* @param \phpbb\template\template $template phpBB template
|
||||
* @param \phpbb\user $user phpBB user object
|
||||
* @param \board3\portal\includes\modules_helper $helper Board3 Portal modules helper
|
||||
*/
|
||||
public function __construct($config, $template, $user)
|
||||
public function __construct($config, $request, $template, $user, $helper)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->request = $request;
|
||||
$this->template = $template;
|
||||
$this->user = $user;
|
||||
$this->helper = $helper;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,6 +106,8 @@ class donation extends module_base
|
||||
'PAY_CUSTOM_CENTER' => (!empty($this->config['board3_pay_custom_' . $module_id])) ? $this->user->data['username_clean'] : false,
|
||||
));
|
||||
|
||||
$this->build_currency_select($module_id, 'b3p_donation_currency_center');
|
||||
|
||||
return 'donation_center.html';
|
||||
}
|
||||
|
||||
@@ -87,6 +121,8 @@ class donation extends module_base
|
||||
'PAY_CUSTOM_SIDE' => (!empty($this->config['board3_pay_custom_' . $module_id])) ? $this->user->data['username_clean'] : false,
|
||||
));
|
||||
|
||||
$this->build_currency_select($module_id, 'b3p_donation_currency_side', true);
|
||||
|
||||
return 'donation_side.html';
|
||||
}
|
||||
|
||||
@@ -101,10 +137,69 @@ class donation extends module_base
|
||||
'legend1' => 'ACP_PORTAL_PAYPAL_SETTINGS',
|
||||
'board3_pay_acc_' . $module_id => array('lang' => 'PORTAL_PAY_ACC', 'validate' => 'string', 'type' => 'text:25:100', 'explain' => true),
|
||||
'board3_pay_custom_' . $module_id => array('lang' => 'PORTAL_PAY_CUSTOM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
'board3_pay_default_' . $module_id => array('lang' => 'PORTAL_PAY_DEFAULT', 'validate' => 'string', 'type' => 'custom', 'method' => 'select_currency', 'submit' => 'save_currency', 'explain' => true),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build currency select for block name
|
||||
*
|
||||
* @param int $module_id Module ID
|
||||
* @param string $block_name Name of template block
|
||||
* @param bool $short Whether short ISO titles should be used
|
||||
*/
|
||||
protected function build_currency_select($module_id, $block_name, $short = false)
|
||||
{
|
||||
foreach ($this->currencies as $currency)
|
||||
{
|
||||
$this->template->assign_block_vars($block_name, array(
|
||||
'VALUE' => $currency,
|
||||
'TITLE' => ($short) ? $currency : $this->user->lang($currency),
|
||||
'SELECTED' => $currency === $this->config['board3_pay_default_' . $module_id],
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create select box for attachment filetype
|
||||
*
|
||||
* @param mixed $value Value of input
|
||||
* @param string $key Key name
|
||||
* @param int $module_id Module ID
|
||||
*
|
||||
* @return string Forum select box HTML
|
||||
*/
|
||||
public function select_currency($value, $key, $module_id)
|
||||
{
|
||||
$currencies = $selected = array();
|
||||
foreach ($this->currencies as $currency)
|
||||
{
|
||||
$currencies[] = array(
|
||||
'title' => $this->user->lang($currency),
|
||||
'value' => $currency,
|
||||
);
|
||||
|
||||
if ($currency === $this->config['board3_pay_default_' . $module_id])
|
||||
{
|
||||
$selected[] = $currency;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->helper->generate_select_box($key, $currencies, $selected);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save currency setting
|
||||
*
|
||||
* @param string $key
|
||||
* @param int $module_id
|
||||
*/
|
||||
public function save_currency($key, $module_id)
|
||||
{
|
||||
$this->config->set($key, $this->request->variable('board3_pay_default_' . $module_id, ''));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -112,6 +207,7 @@ class donation extends module_base
|
||||
{
|
||||
$this->config->set('board3_pay_acc_' . $module_id, 'your@paypal.com');
|
||||
$this->config->set('board3_pay_custom_' . $module_id, true);
|
||||
$this->config->set('board3_pay_default_' . $module_id, 'EUR');
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -123,6 +219,7 @@ class donation extends module_base
|
||||
$del_config = array(
|
||||
'board3_pay_acc_' . $module_id,
|
||||
'board3_pay_custom_' . $module_id,
|
||||
'board3_pay_default_' . $module_id,
|
||||
);
|
||||
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
||||
|
||||
@@ -81,7 +81,7 @@ class latest_members extends module_base
|
||||
ORDER BY user_regdate DESC';
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_max_last_member_' . $module_id], 0, 600);
|
||||
|
||||
while(($row = $this->db->sql_fetchrow($result)) && ($row['username']))
|
||||
while (($row = $this->db->sql_fetchrow($result)) && ($row['username']))
|
||||
{
|
||||
$this->template->assign_block_vars('latest_members', array(
|
||||
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
|
||||
|
||||
@@ -93,7 +93,7 @@ class leaders extends module_base
|
||||
$this->user->add_lang('groups');
|
||||
$order_legend = ($this->config['legend_sort_groupname']) ? 'group_name' : 'group_legend';
|
||||
|
||||
if($this->config['board3_leaders_ext_' . $module_id])
|
||||
if ($this->config['board3_leaders_ext_' . $module_id])
|
||||
{
|
||||
$legends = array();
|
||||
$groups = array();
|
||||
@@ -160,9 +160,9 @@ class leaders extends module_base
|
||||
|
||||
if (sizeof($groups))
|
||||
{
|
||||
foreach($groups as $group_id => $group)
|
||||
foreach ($groups as $group_id => $group)
|
||||
{
|
||||
if(sizeof($group['group_users']))
|
||||
if (sizeof($group['group_users']))
|
||||
{
|
||||
$group_name = ($group['group_type'] == GROUP_SPECIAL) ? $this->user->lang['G_' . $group['group_name']] : $group['group_name'];
|
||||
$u_group = append_sid("{$this->phpbb_root_path}memberlist.{$this->php_ext}", 'mode=group&g=' . $group_id);
|
||||
@@ -173,7 +173,7 @@ class leaders extends module_base
|
||||
'U_GROUP' => $u_group,
|
||||
));
|
||||
|
||||
foreach($group['group_users'] as $group_user)
|
||||
foreach ($group['group_users'] as $group_user)
|
||||
{
|
||||
$this->template->assign_block_vars('group.member', array(
|
||||
'USER_ID' => $group_user['user_id'],
|
||||
|
||||
@@ -366,7 +366,7 @@ class main_menu extends module_base
|
||||
{
|
||||
$message = $this->user->lang['LINK_ADDED'];
|
||||
|
||||
if($link_type != self::LINK_CAT && sizeof($links) < 1)
|
||||
if ($link_type != self::LINK_CAT && sizeof($links) < 1)
|
||||
{
|
||||
trigger_error($this->user->lang['ACP_PORTAL_MENU_CREATE_CAT'] . adm_back_link($u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ class news extends module_base
|
||||
);
|
||||
|
||||
$topic_icons = false;
|
||||
if(!empty($fetch_news['topic_icons']))
|
||||
if (!empty($fetch_news['topic_icons']))
|
||||
{
|
||||
$topic_icons = true;
|
||||
}
|
||||
@@ -179,21 +179,21 @@ class news extends module_base
|
||||
// Get disallowed forums
|
||||
$disallow_access = $this->modules_helper->get_disallowed_forums($permissions);
|
||||
|
||||
if($this->config['board3_news_exclude_' . $module_id] == true)
|
||||
if ($this->config['board3_news_exclude_' . $module_id] == true)
|
||||
{
|
||||
$disallow_access = array_merge($disallow_access, $forum_from);
|
||||
$forum_from = array();
|
||||
}
|
||||
|
||||
if(sizeof($forum_from))
|
||||
if (sizeof($forum_from))
|
||||
{
|
||||
$disallow_access = array_diff($forum_from, $disallow_access);
|
||||
if(!sizeof($disallow_access))
|
||||
if (!sizeof($disallow_access))
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
foreach($disallow_access as $acc_id)
|
||||
foreach ($disallow_access as $acc_id)
|
||||
{
|
||||
$acc_id = (int) $acc_id;
|
||||
$str_where .= "forum_id = $acc_id OR ";
|
||||
@@ -201,7 +201,7 @@ class news extends module_base
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($disallow_access as $acc_id)
|
||||
foreach ($disallow_access as $acc_id)
|
||||
{
|
||||
$acc_id = (int) $acc_id;
|
||||
$str_where .= "forum_id <> $acc_id AND ";
|
||||
@@ -244,12 +244,12 @@ class news extends module_base
|
||||
$this->template->assign_block_vars('news', $news_row);
|
||||
|
||||
// Show the news overview
|
||||
if($news < 0)
|
||||
if ($news < 0)
|
||||
{
|
||||
$count = $fetch_news['topic_count'];
|
||||
for ($i = 0; $i < $count; $i++)
|
||||
{
|
||||
if(isset($fetch_news[$i]['striped']) && $fetch_news[$i]['striped'] == true)
|
||||
if (isset($fetch_news[$i]['striped']) && $fetch_news[$i]['striped'] == true)
|
||||
{
|
||||
$open_bracket = '[ ';
|
||||
$close_bracket = ' ]';
|
||||
@@ -349,7 +349,7 @@ class news extends module_base
|
||||
// Assign pagination
|
||||
$this->pagination->generate_template_pagination($view_topic_url, 'news.news_row.pagination', 'start', $fetch_news[$i]['topic_replies'] + 1, $this->config['posts_per_page'], 1);
|
||||
|
||||
if(!empty($fetch_news[$i]['attachments']))
|
||||
if (!empty($fetch_news[$i]['attachments']))
|
||||
{
|
||||
foreach ($fetch_news[$i]['attachments'] as $attachment)
|
||||
{
|
||||
@@ -400,7 +400,7 @@ class news extends module_base
|
||||
|
||||
$this->pagination->generate_template_pagination($view_topic_url, 'news.news_row.pagination', 'start', $fetch_news[$i]['topic_replies'] + 1, $this->config['posts_per_page'], 1);
|
||||
|
||||
if(!empty($fetch_news[$i]['attachments']))
|
||||
if (!empty($fetch_news[$i]['attachments']))
|
||||
{
|
||||
foreach ($fetch_news[$i]['attachments'] as $attachment)
|
||||
{
|
||||
@@ -418,7 +418,7 @@ class news extends module_base
|
||||
'GOTO_PAGE_IMG' => $this->user->img('icon_post_target', 'GOTO_PAGE'),
|
||||
));
|
||||
|
||||
if($this->config['board3_news_style_' . $module_id])
|
||||
if ($this->config['board3_news_style_' . $module_id])
|
||||
{
|
||||
return 'news_compact_center.html';
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ class poll extends module_base
|
||||
$this->user->add_lang('viewtopic');
|
||||
|
||||
// check if we need to include the bbcode class
|
||||
if(!class_exists('bbcode'))
|
||||
if (!class_exists('bbcode'))
|
||||
{
|
||||
include($this->phpbb_root_path . 'includes/bbcode.' . $this->php_ext);
|
||||
}
|
||||
@@ -234,7 +234,7 @@ class poll extends module_base
|
||||
$topic_data['topic_status'] != ITEM_LOCKED &&
|
||||
$topic_data['forum_status'] != ITEM_LOCKED) ? true : false;
|
||||
|
||||
if($s_can_up_vote)
|
||||
if ($s_can_up_vote)
|
||||
{
|
||||
$redirect_url = $this->modules_helper->route('board3_portal_controller');
|
||||
|
||||
@@ -327,11 +327,11 @@ class poll extends module_base
|
||||
// Get readable forums
|
||||
$forum_list = array_unique(array_keys($this->auth->acl_getf('f_read', true)));
|
||||
|
||||
if($this->config['board3_poll_topic_id_' . $module_id] !== '')
|
||||
if ($this->config['board3_poll_topic_id_' . $module_id] !== '')
|
||||
{
|
||||
$poll_forums_config = explode(',' ,$this->config['board3_poll_topic_id_' . $module_id]);
|
||||
|
||||
if($this->config['board3_poll_exclude_id_' . $module_id])
|
||||
if ($this->config['board3_poll_exclude_id_' . $module_id])
|
||||
{
|
||||
$forum_list = array_unique(array_diff($forum_list, $poll_forums_config));
|
||||
}
|
||||
@@ -343,7 +343,7 @@ class poll extends module_base
|
||||
|
||||
$where = '';
|
||||
|
||||
if(sizeof($forum_list))
|
||||
if (sizeof($forum_list))
|
||||
{
|
||||
$poll_forums = true;
|
||||
$where = 'AND ' . $this->db->sql_in_set('t.forum_id', $forum_list);
|
||||
@@ -375,7 +375,7 @@ class poll extends module_base
|
||||
|
||||
if ($result)
|
||||
{
|
||||
while($data = $this->db->sql_fetchrow($result))
|
||||
while ($data = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$has_poll = true;
|
||||
$poll_has_options = false;
|
||||
@@ -384,7 +384,7 @@ class poll extends module_base
|
||||
$forum_id = (int) $data['forum_id'];
|
||||
|
||||
$cur_voted_id = array();
|
||||
if($this->config['board3_poll_allow_vote_' . $module_id])
|
||||
if ($this->config['board3_poll_allow_vote_' . $module_id])
|
||||
{
|
||||
if ($this->user->data['is_registered'])
|
||||
{
|
||||
@@ -436,7 +436,7 @@ class poll extends module_base
|
||||
|
||||
if ($poll_result)
|
||||
{
|
||||
while($polls_data = $this->db->sql_fetchrow($poll_result))
|
||||
while ($polls_data = $this->db->sql_fetchrow($poll_result))
|
||||
{
|
||||
$poll_has_options = true;
|
||||
$poll_data[] = $polls_data;
|
||||
@@ -447,7 +447,7 @@ class poll extends module_base
|
||||
|
||||
$make_poll_view = array();
|
||||
|
||||
if(in_array($topic_id, $poll_view_ar) === false)
|
||||
if (in_array($topic_id, $poll_view_ar) === false)
|
||||
{
|
||||
$make_poll_view[] = $topic_id;
|
||||
$make_poll_view = array_merge($poll_view_ar, $make_poll_view);
|
||||
@@ -497,7 +497,7 @@ class poll extends module_base
|
||||
'U_VIEW_TOPIC' => $viewtopic_url,
|
||||
));
|
||||
|
||||
foreach($poll_data as $pd)
|
||||
foreach ($poll_data as $pd)
|
||||
{
|
||||
$option_pct = ($poll_total_votes > 0) ? $pd['poll_option_total'] / $poll_total_votes : 0;
|
||||
$option_pct_txt = sprintf("%.1d%%", round($option_pct * 100));
|
||||
|
||||
@@ -138,7 +138,7 @@ class recent extends module_base
|
||||
ORDER BY topic_time DESC';
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_max_topics_' . $module_id], 0 , 600);
|
||||
|
||||
while(($row = $this->db->sql_fetchrow($result)) && ($row['topic_title']))
|
||||
while (($row = $this->db->sql_fetchrow($result)) && ($row['topic_title']))
|
||||
{
|
||||
// auto auth
|
||||
if (($this->auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
|
||||
@@ -164,7 +164,7 @@ class recent extends module_base
|
||||
ORDER BY topic_time DESC';
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_max_topics_' . $module_id], 0, 600);
|
||||
|
||||
while(($row = $this->db->sql_fetchrow($result)) && ($row['topic_title']))
|
||||
while (($row = $this->db->sql_fetchrow($result)) && ($row['topic_title']))
|
||||
{
|
||||
// auto auth
|
||||
if (($this->auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
|
||||
@@ -191,7 +191,7 @@ class recent extends module_base
|
||||
ORDER BY topic_time DESC';
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_max_topics_' . $module_id], 0, 600);
|
||||
|
||||
while(($row = $this->db->sql_fetchrow($result)) && ($row['topic_title']))
|
||||
while (($row = $this->db->sql_fetchrow($result)) && ($row['topic_title']))
|
||||
{
|
||||
// auto auth
|
||||
if (($this->auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
|
||||
|
||||
@@ -106,7 +106,7 @@ class stylechanger extends module_base
|
||||
$style_select .= '<option value="' . $url . '"' . ($row['style_id'] == $this->user->style['style_id'] ? ' selected="selected"' : '') . '>' . utf8_htmlspecialchars($row['style_name']) . '</option>';
|
||||
}
|
||||
$this->db->sql_freeresult($result);
|
||||
if(strlen($style_select))
|
||||
if (strlen($style_select))
|
||||
{
|
||||
$this->template->assign_var('STYLE_SELECT', $style_select);
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ class welcome extends module_base
|
||||
generate_text_for_storage($welcome_message, $uid, $bitfield, $flags, true, true, true);
|
||||
|
||||
// first check for obvious errors, we don't want to waste server resources
|
||||
if(empty($welcome_message))
|
||||
if (empty($welcome_message))
|
||||
{
|
||||
trigger_error($this->user->lang['ACP_PORTAL_WELCOME_MESSAGE_SHORT']. adm_back_link($u_action), E_USER_WARNING);
|
||||
}
|
||||
@@ -217,7 +217,7 @@ class welcome extends module_base
|
||||
// Edit or add menu item
|
||||
case 'reset':
|
||||
default:
|
||||
if(!isset($welcome_message))
|
||||
if (!isset($welcome_message))
|
||||
{
|
||||
$welcome_message = generate_text_for_edit($portal_config['board3_welcome_message_' . $module_id], $this->config['board3_welcome_message_uid_' . $module_id], '');
|
||||
}
|
||||
@@ -235,7 +235,7 @@ class welcome extends module_base
|
||||
'MAX_FONT_SIZE' => (int) $this->config['max_post_font_size'],
|
||||
));
|
||||
|
||||
if(!function_exists('display_forums'))
|
||||
if (!function_exists('display_forums'))
|
||||
{
|
||||
include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext);
|
||||
}
|
||||
|
||||
@@ -20,24 +20,9 @@
|
||||
<!-- ENDIF -->
|
||||
<input type="text" tabindex="11" name="amount" size="10" maxlength="6" value="" class="inputbox autowidth" title="{L_PAY_MSG}" />
|
||||
<select name="currency_code" class="autowidth">
|
||||
<option value="USD">{L_USD}</option>
|
||||
<option value="AUD">{L_AUD}</option>
|
||||
<option value="CAD">{L_CAD}</option>
|
||||
<option value="CZK">{L_CZK}</option>
|
||||
<option value="DKK">{L_DKK}</option>
|
||||
<option value="EUR" selected="selected">{L_EUR}</option>
|
||||
<option value="HKD">{L_HKD}</option>
|
||||
<option value="HUF">{L_HUF}</option>
|
||||
<option value="NZD">{L_NZD}</option>
|
||||
<option value="NOK">{L_NOK}</option>
|
||||
<option value="PLN">{L_PLN}</option>
|
||||
<option value="GBP">{L_GBP}</option>
|
||||
<option value="SGD">{L_SGD}</option>
|
||||
<option value="SEK">{L_SEK}</option>
|
||||
<option value="CHF">{L_CHF}</option>
|
||||
<option value="JPY">{L_JPY}</option>
|
||||
<option value="MXN">{L_MXN}</option>
|
||||
<option value="ILS">{L_ILS}</option>
|
||||
<!-- BEGIN b3p_donation_currency_center -->
|
||||
<option value="{b3p_donation_currency_center.VALUE"<!-- IF b3p_donation_currency_center.SELECTED --> selected="selected"<!-- ENDIF -->>{b3p_donation_currency_center.TITLE}</option>
|
||||
<!-- END b3p_donation_currency_center -->
|
||||
</select>
|
||||
<input type="submit" name="submit" value="{L_DONATION}" class="button1" />
|
||||
</div>
|
||||
|
||||
@@ -14,22 +14,9 @@
|
||||
<!-- ENDIF -->
|
||||
<input type="text" tabindex="10" name="amount" size="10" maxlength="6" value="" class="inputbox autowidth" title="{L_PAY_MSG}" />
|
||||
<select name="currency_code" class="autowidth">
|
||||
<option value="USD">USD</option>
|
||||
<option value="AUD">AUD</option>
|
||||
<option value="CAD">CAD</option>
|
||||
<option value="CZK">CZK</option>
|
||||
<option value="DKK">DKK</option>
|
||||
<option value="EUR" selected="selected">EUR</option>
|
||||
<option value="HKD">HKD</option>
|
||||
<option value="HUF">HUF</option>
|
||||
<option value="NZD">NZD</option>
|
||||
<option value="NOK">NOK</option>
|
||||
<option value="PLN">PLN</option>
|
||||
<option value="GBP">GBP</option>
|
||||
<option value="SGD">SGD</option>
|
||||
<option value="SEK">SEK</option>
|
||||
<option value="CHF">CHF</option>
|
||||
<option value="JPY">JPY</option>
|
||||
<!-- BEGIN b3p_donation_currency_side -->
|
||||
<option value="{b3p_donation_currency_side.VALUE"<!-- IF b3p_donation_currency_side.SELECTED --> selected="selected"<!-- ENDIF -->>{b3p_donation_currency_side.TITLE}</option>
|
||||
<!-- END b3p_donation_currency_side -->
|
||||
</select>
|
||||
<input type="submit" name="submit" value="{L_DONATION}" class="button1" />
|
||||
</div>
|
||||
|
||||
@@ -21,24 +21,9 @@
|
||||
<!-- ENDIF -->
|
||||
<input type="text" tabindex="11" name="amount" size="10" maxlength="6" value="" class="inputbox autowidth" title="{L_PAY_MSG}" />
|
||||
<select name="currency_code" class="autowidth">
|
||||
<option value="USD">{L_USD}</option>
|
||||
<option value="AUD">{L_AUD}</option>
|
||||
<option value="CAD">{L_CAD}</option>
|
||||
<option value="CZK">{L_CZK}</option>
|
||||
<option value="DKK">{L_DKK}</option>
|
||||
<option value="EUR" selected="selected">{L_EUR}</option>
|
||||
<option value="HKD">{L_HKD}</option>
|
||||
<option value="HUF">{L_HUF}</option>
|
||||
<option value="NZD">{L_NZD}</option>
|
||||
<option value="NOK">{L_NOK}</option>
|
||||
<option value="PLN">{L_PLN}</option>
|
||||
<option value="GBP">{L_GBP}</option>
|
||||
<option value="SGD">{L_SGD}</option>
|
||||
<option value="SEK">{L_SEK}</option>
|
||||
<option value="CHF">{L_CHF}</option>
|
||||
<option value="JPY">{L_JPY}</option>
|
||||
<option value="MXN">{L_MXN}</option>
|
||||
<option value="ILS">{L_ILS}</option>
|
||||
<!-- BEGIN b3p_donation_currency_center -->
|
||||
<option value="{b3p_donation_currency_center.VALUE"<!-- IF b3p_donation_currency_center.SELECTED --> selected="selected"<!-- ENDIF -->>{b3p_donation_currency_center.TITLE}</option>
|
||||
<!-- END b3p_donation_currency_center -->
|
||||
</select>
|
||||
<input type="submit" name="submit" value="{L_DONATION}" class="button1" />
|
||||
</form>
|
||||
|
||||
@@ -16,22 +16,9 @@
|
||||
<!-- ENDIF -->
|
||||
<input type="text" tabindex="10" name="amount" size="10" maxlength="6" value="" class="inputbox autowidth" title="{L_PAY_MSG}" />
|
||||
<select name="currency_code" class="autowidth">
|
||||
<option value="USD">USD</option>
|
||||
<option value="AUD">AUD</option>
|
||||
<option value="CAD">CAD</option>
|
||||
<option value="CZK">CZK</option>
|
||||
<option value="DKK">DKK</option>
|
||||
<option value="EUR" selected="selected">EUR</option>
|
||||
<option value="HKD">HKD</option>
|
||||
<option value="HUF">HUF</option>
|
||||
<option value="NZD">NZD</option>
|
||||
<option value="NOK">NOK</option>
|
||||
<option value="PLN">PLN</option>
|
||||
<option value="GBP">GBP</option>
|
||||
<option value="SGD">SGD</option>
|
||||
<option value="SEK">SEK</option>
|
||||
<option value="CHF">CHF</option>
|
||||
<option value="JPY">JPY</option>
|
||||
<!-- BEGIN b3p_donation_currency_side -->
|
||||
<option value="{b3p_donation_currency_side.VALUE"<!-- IF b3p_donation_currency_side.SELECTED --> selected="selected"<!-- ENDIF -->>{b3p_donation_currency_side.TITLE}</option>
|
||||
<!-- END b3p_donation_currency_side -->
|
||||
</select>
|
||||
<input type="submit" name="submit" value="{L_DONATION}" class="button1" />
|
||||
</form>
|
||||
|
||||
@@ -45,16 +45,22 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data
|
||||
->getMock());
|
||||
// Mock module service collection
|
||||
$config = new \phpbb\config\config(array());
|
||||
$auth = $this->getMock('\phpbb\auth\auth', array('acl_get'));
|
||||
$auth->expects($this->any())
|
||||
->method('acl_get')
|
||||
->with($this->anything())
|
||||
->will($this->returnValue(true));
|
||||
$controller_helper = new \board3\portal\tests\mock\controller_helper($phpbb_root_path, $phpEx);
|
||||
$controller_helper->add_route('board3_portal_controller', 'portal');
|
||||
$modules_helper = new \board3\portal\includes\modules_helper($auth, $config, $controller_helper, new \phpbb_mock_request);
|
||||
$phpbb_container->set('board3.portal.module_collection',
|
||||
array(
|
||||
new \board3\portal\modules\clock($config, $template),
|
||||
new \board3\portal\modules\birthday_list($config, $template, $this->db, $user),
|
||||
new \board3\portal\modules\welcome($config, new \phpbb_mock_request, $this->db, $user, $phpbb_root_path, $phpEx),
|
||||
new \board3\portal\modules\donation($config, $template, $user),
|
||||
new \board3\portal\modules\donation($config, new \phpbb_mock_request, $template, $user, $modules_helper),
|
||||
));
|
||||
$this->portal_helper = new \board3\portal\includes\helper($phpbb_container->get('board3.portal.module_collection'));
|
||||
$controller_helper = new \board3\portal\tests\mock\controller_helper($phpbb_root_path, $phpEx);
|
||||
$controller_helper->add_route('board3_portal_controller', 'portal');
|
||||
$phpbb_container->set('board3.portal.helper', $this->portal_helper);
|
||||
$phpbb_container->set('board3.portal.modules_helper', new \board3\portal\includes\modules_helper(new \phpbb\auth\auth(), $config, $controller_helper, $request));
|
||||
$phpbb_container->setParameter('board3.portal.modules.table', $table_prefix . 'portal_modules');
|
||||
@@ -124,11 +130,6 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data
|
||||
'\board3\portal\modules\clock' => new \board3\portal\modules\clock($config, $template),
|
||||
);
|
||||
$portal_helper = new \board3\portal\includes\helper($modules);
|
||||
$auth = $this->getMock('\phpbb\auth\auth', array('acl_get'));
|
||||
$auth->expects($this->any())
|
||||
->method('acl_get')
|
||||
->with($this->anything())
|
||||
->will($this->returnValue(true));
|
||||
|
||||
$controller_helper = new \board3\portal\controller\helper(
|
||||
$auth,
|
||||
@@ -153,7 +154,7 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data
|
||||
{
|
||||
$this->constraints_handler->module_column = array();
|
||||
$portal_modules = obtain_portal_modules();
|
||||
foreach($portal_modules as $cur_module)
|
||||
foreach ($portal_modules as $cur_module)
|
||||
{
|
||||
$this->constraints_handler->module_column[$cur_module['module_classname']][] = $this->portal_columns->number_to_string($cur_module['module_column']);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class board3_includes_modules_helper_test extends \board3\portal\tests\testframe
|
||||
public function data_generate_select_box()
|
||||
{
|
||||
return array(
|
||||
array('<select id="foobar" name="foobar[]" multiple="multiple"><option value="one">one</option><option value="two" selected="selected">two</option></select>',
|
||||
array('<select id="foobar" name="foobar"><option value="one">one</option><option value="two" selected="selected">two</option></select>',
|
||||
'foobar',
|
||||
array(
|
||||
'1' => array(
|
||||
@@ -68,7 +68,7 @@ class board3_includes_modules_helper_test extends \board3\portal\tests\testframe
|
||||
),
|
||||
),
|
||||
array('two')),
|
||||
array('<select id="foobar" name="foobar[]" multiple="multiple"><option value="one" selected="selected">two</option><option value="two">three</option></select>',
|
||||
array('<select id="foobar" name="foobar"><option value="one" selected="selected">two</option><option value="two">three</option></select>',
|
||||
'foobar',
|
||||
array(
|
||||
'1' => array(
|
||||
@@ -81,6 +81,19 @@ class board3_includes_modules_helper_test extends \board3\portal\tests\testframe
|
||||
),
|
||||
),
|
||||
array('one')),
|
||||
array('<select id="foobar" name="foobar[]" multiple="multiple"><option value="one" selected="selected">two</option><option value="two" selected="selected">three</option></select>',
|
||||
'foobar',
|
||||
array(
|
||||
'1' => array(
|
||||
'value' => 'one',
|
||||
'title' => 'two',
|
||||
),
|
||||
'2' => array(
|
||||
'value' => 'two',
|
||||
'title' => 'three',
|
||||
),
|
||||
),
|
||||
array('one', 'two')),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,14 +47,19 @@ class modules_manager_confirm_box_test extends \board3\portal\tests\testframewor
|
||||
$request =new \phpbb_mock_request();
|
||||
$this->request = $request;
|
||||
$this->user = $user;
|
||||
$auth = new \phpbb\auth\auth();
|
||||
|
||||
$config = new \phpbb\config\config(array());
|
||||
|
||||
$controller_helper = new \board3\portal\tests\mock\controller_helper($phpbb_root_path, $phpEx);
|
||||
$controller_helper->add_route('board3_portal_controller', 'portal');
|
||||
$modules_helper = new \board3\portal\includes\modules_helper($auth, $config, $controller_helper, $this->request);
|
||||
|
||||
$this->portal_helper = new \board3\portal\includes\helper(array(
|
||||
new \board3\portal\modules\clock($config, null),
|
||||
new \board3\portal\modules\birthday_list($config, null, $this->db, $user),
|
||||
new \board3\portal\modules\welcome($config, new \phpbb_mock_request, $this->db, $user, $this->phpbb_root_path, $this->phpEx),
|
||||
new \board3\portal\modules\donation($config, null, $user),
|
||||
new \board3\portal\modules\donation($config, $this->request, null, $user, $modules_helper),
|
||||
));
|
||||
|
||||
$this->portal_columns = new \board3\portal\portal\columns();
|
||||
|
||||
@@ -41,12 +41,17 @@ class board3_portal_modules_manager_test extends \board3\portal\tests\testframew
|
||||
$request =new \phpbb_mock_request();
|
||||
|
||||
$config = new \phpbb\config\config(array());
|
||||
$auth = new \phpbb\auth\auth();
|
||||
|
||||
$controller_helper = new \board3\portal\tests\mock\controller_helper($phpbb_root_path, $phpEx);
|
||||
$controller_helper->add_route('board3_portal_controller', 'portal');
|
||||
$modules_helper = new \board3\portal\includes\modules_helper($auth, $config, $controller_helper, $this->request);
|
||||
|
||||
$portal_helper = new \board3\portal\includes\helper(array(
|
||||
new \board3\portal\modules\clock($config, null),
|
||||
new \board3\portal\modules\birthday_list($config, null, $this->db, $user),
|
||||
new \board3\portal\modules\welcome($config, new \phpbb_mock_request, $this->db, $user, $this->phpbb_root_path, $this->phpEx),
|
||||
new \board3\portal\modules\donation($config, null, $user),
|
||||
new \board3\portal\modules\donation($config, $request, null, $user, $modules_helper),
|
||||
));
|
||||
|
||||
$this->portal_columns = new \board3\portal\portal\columns();
|
||||
@@ -108,7 +113,7 @@ class board3_portal_modules_manager_test extends \board3\portal\tests\testframew
|
||||
|
||||
$this->modules_manager = new \board3\portal\portal\modules\manager($cache, $db, $this->b3p_controller_helper, $this->portal_columns, $portal_helper, $this->constraints_handler, $this->database_handler, $request, $user);
|
||||
$portal_modules = obtain_portal_modules();
|
||||
foreach($portal_modules as $cur_module)
|
||||
foreach ($portal_modules as $cur_module)
|
||||
{
|
||||
$this->constraints_handler->module_column[$cur_module['module_classname']][] = $this->portal_columns->number_to_string($cur_module['module_column']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user