@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | * |
| 139 | 139 | * @param bool $enable |
| 140 | 140 | * |
| 141 | - * @return bool |
|
| 141 | + * @return currency |
|
| 142 | 142 | * @access public |
| 143 | 143 | */ |
| 144 | 144 | public function set_currency_enable($enable) |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | * |
| 166 | 166 | * @param bool $on_left |
| 167 | 167 | * |
| 168 | - * @return bool |
|
| 168 | + * @return currency |
|
| 169 | 169 | * @access public |
| 170 | 170 | */ |
| 171 | 171 | public function set_currency_position($on_left) |
@@ -74,9 +74,9 @@ discard block |
||
| 74 | 74 | public function build_sql_data_exists() |
| 75 | 75 | { |
| 76 | 76 | return 'SELECT currency_id |
| 77 | - FROM ' . $this->currency_table . " |
|
| 78 | - WHERE currency_iso_code = '" . $this->db->sql_escape($this->data['currency_iso_code']) . "' |
|
| 79 | - AND currency_symbol = '" . $this->db->sql_escape($this->data['currency_symbol']) . "'"; |
|
| 77 | + FROM ' . $this->currency_table." |
|
| 78 | + WHERE currency_iso_code = '" . $this->db->sql_escape($this->data['currency_iso_code'])."' |
|
| 79 | + AND currency_symbol = '" . $this->db->sql_escape($this->data['currency_symbol'])."'"; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | if ($this->get_currency_enable()) |
| 251 | 251 | { |
| 252 | 252 | // Return an error if the currency is enabled |
| 253 | - trigger_error($this->user->lang['PPDE_DISABLE_BEFORE_DELETION'] . adm_back_link($this->u_action), E_USER_WARNING); |
|
| 253 | + trigger_error($this->user->lang['PPDE_DISABLE_BEFORE_DELETION'].adm_back_link($this->u_action), E_USER_WARNING); |
|
| 254 | 254 | } |
| 255 | 255 | } |
| 256 | 256 | |
@@ -115,8 +115,8 @@ |
||
| 115 | 115 | public function transaction_exists() |
| 116 | 116 | { |
| 117 | 117 | $sql = 'SELECT txn_id |
| 118 | - FROM ' . $this->transactions_log_table . " |
|
| 119 | - WHERE txn_id = '" . $this->db->sql_escape($this->data['txn_id']) . "'"; |
|
| 118 | + FROM ' . $this->transactions_log_table." |
|
| 119 | + WHERE txn_id = '" . $this->db->sql_escape($this->data['txn_id'])."'"; |
|
| 120 | 120 | $this->db->sql_query($sql); |
| 121 | 121 | |
| 122 | 122 | return $this->db->sql_fetchfield('txn_id'); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | //Add language entries for displaying the vars |
| 123 | 123 | for ($i = 0, $size = sizeof($this->dp_vars); $i < $size; $i++) |
| 124 | 124 | { |
| 125 | - $this->dp_vars[$i]['name'] = $this->user->lang[$this->lang_key_prefix . '_' . substr(substr($this->dp_vars[$i]['var'], 0, -1), 1)]; |
|
| 125 | + $this->dp_vars[$i]['name'] = $this->user->lang[$this->lang_key_prefix.'_'.substr(substr($this->dp_vars[$i]['var'], 0, -1), 1)]; |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
@@ -395,8 +395,8 @@ discard block |
||
| 395 | 395 | public function build_sql_data_exists() |
| 396 | 396 | { |
| 397 | 397 | return 'SELECT page_id |
| 398 | - FROM ' . $this->donation_pages_table . " |
|
| 399 | - WHERE page_title = '" . $this->db->sql_escape($this->data['page_title']) . "' |
|
| 398 | + FROM ' . $this->donation_pages_table." |
|
| 399 | + WHERE page_title = '" . $this->db->sql_escape($this->data['page_title'])."' |
|
| 400 | 400 | AND page_lang_id = " . (int) $this->data['page_lang_id']; |
| 401 | 401 | } |
| 402 | 402 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | if (!empty($this->data[$this->table_schema['item_id']['name']])) |
| 63 | 63 | { |
| 64 | 64 | // The page already exists |
| 65 | - $this->display_error_message($this->lang_key_prefix . '_EXIST'); |
|
| 65 | + $this->display_error_message($this->lang_key_prefix.'_EXIST'); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // Run some stuff before insert data in database |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | unset($this->data[$this->table_schema['item_id']['name']]); |
| 73 | 73 | |
| 74 | 74 | // Insert the page data to the database |
| 75 | - $sql = 'INSERT INTO ' . $this->table_name . ' ' . $this->db->sql_build_array('INSERT', $this->data); |
|
| 75 | + $sql = 'INSERT INTO '.$this->table_name.' '.$this->db->sql_build_array('INSERT', $this->data); |
|
| 76 | 76 | $this->db->sql_query($sql); |
| 77 | 77 | |
| 78 | 78 | // Set the page_id using the id created by the SQL insert |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | protected function display_error_message($lang_key, $args = '') |
| 94 | 94 | { |
| 95 | - $message = call_user_func_array(array($this->user, 'lang'), array_merge(array(strtoupper($lang_key), $args))) . adm_back_link($this->u_action); |
|
| 95 | + $message = call_user_func_array(array($this->user, 'lang'), array_merge(array(strtoupper($lang_key), $args))).adm_back_link($this->u_action); |
|
| 96 | 96 | trigger_error($message, E_USER_WARNING); |
| 97 | 97 | } |
| 98 | 98 | |
@@ -131,12 +131,12 @@ discard block |
||
| 131 | 131 | if ($required_fields) |
| 132 | 132 | { |
| 133 | 133 | // The page already exists |
| 134 | - $this->display_error_message($this->lang_key_prefix . '_NO_' . $this->lang_key_suffix); |
|
| 134 | + $this->display_error_message($this->lang_key_prefix.'_NO_'.$this->lang_key_suffix); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - $sql = 'UPDATE ' . $this->table_name . ' |
|
| 138 | - SET ' . $this->db->sql_build_array('UPDATE', $this->data) . ' |
|
| 139 | - WHERE ' . $this->table_schema['item_id']['name'] . ' = ' . $this->get_id(); |
|
| 137 | + $sql = 'UPDATE '.$this->table_name.' |
|
| 138 | + SET ' . $this->db->sql_build_array('UPDATE', $this->data).' |
|
| 139 | + WHERE ' . $this->table_schema['item_id']['name'].' = '.$this->get_id(); |
|
| 140 | 140 | $this->db->sql_query($sql); |
| 141 | 141 | |
| 142 | 142 | return $this; |
@@ -192,9 +192,9 @@ discard block |
||
| 192 | 192 | */ |
| 193 | 193 | public function build_sql_data_exists() |
| 194 | 194 | { |
| 195 | - return 'SELECT ' . $this->table_schema['item_id']['name'] . ' |
|
| 196 | - FROM ' . $this->table_name . ' |
|
| 197 | - WHERE ' . $this->table_schema['item_id']['name'] . ' = ' . $this->data[$this->table_name['item_id']['name']]; |
|
| 195 | + return 'SELECT '.$this->table_schema['item_id']['name'].' |
|
| 196 | + FROM ' . $this->table_name.' |
|
| 197 | + WHERE ' . $this->table_schema['item_id']['name'].' = '.$this->data[$this->table_name['item_id']['name']]; |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | /** |
@@ -208,8 +208,8 @@ discard block |
||
| 208 | 208 | public function load($id) |
| 209 | 209 | { |
| 210 | 210 | $sql = 'SELECT * |
| 211 | - FROM ' . $this->table_name . ' |
|
| 212 | - WHERE ' . $this->table_schema['item_id']['name'] . ' = ' . (int) $id; |
|
| 211 | + FROM ' . $this->table_name.' |
|
| 212 | + WHERE ' . $this->table_schema['item_id']['name'].' = '.(int) $id; |
|
| 213 | 213 | $result = $this->db->sql_query($sql); |
| 214 | 214 | $this->data = $this->db->sql_fetchrow($result); |
| 215 | 215 | $this->db->sql_freeresult($result); |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | if ($this->data === false) |
| 218 | 218 | { |
| 219 | 219 | // A item does not exist |
| 220 | - $this->display_error_message($this->lang_key_prefix . '_NO_' . $this->lang_key_suffix); |
|
| 220 | + $this->display_error_message($this->lang_key_prefix.'_NO_'.$this->lang_key_suffix); |
|
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | return $this; |
@@ -301,14 +301,14 @@ discard block |
||
| 301 | 301 | if ($this->disallow_deletion($id) && empty($sql_where)) |
| 302 | 302 | { |
| 303 | 303 | // The item selected does not exists |
| 304 | - $this->display_error_message($this->lang_key_prefix . '_NO_' . $this->lang_key_suffix); |
|
| 304 | + $this->display_error_message($this->lang_key_prefix.'_NO_'.$this->lang_key_suffix); |
|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | $this->run_function_before_action($action_before_delete); |
| 308 | 308 | |
| 309 | - $where_clause = !empty($sql_where) ? $sql_where : ' WHERE ' . $this->table_schema['item_id']['name'] . ' = ' . (int) $id; |
|
| 309 | + $where_clause = !empty($sql_where) ? $sql_where : ' WHERE '.$this->table_schema['item_id']['name'].' = '.(int) $id; |
|
| 310 | 310 | // Delete data from the database |
| 311 | - $sql = 'DELETE FROM ' . $this->table_name . $where_clause; |
|
| 311 | + $sql = 'DELETE FROM '.$this->table_name.$where_clause; |
|
| 312 | 312 | $this->db->sql_query($sql); |
| 313 | 313 | |
| 314 | 314 | return (bool) $this->db->sql_affectedrows(); |
@@ -141,10 +141,10 @@ |
||
| 141 | 141 | foreach ($message_portions as &$message) |
| 142 | 142 | { |
| 143 | 143 | // Attempt to translate each portion |
| 144 | - $translated_message = $user->lang('EXCEPTION_' . $message); |
|
| 144 | + $translated_message = $user->lang('EXCEPTION_'.$message); |
|
| 145 | 145 | |
| 146 | 146 | // Check if translating did anything |
| 147 | - if ($translated_message !== 'EXCEPTION_' . $message) |
|
| 147 | + if ($translated_message !== 'EXCEPTION_'.$message) |
|
| 148 | 148 | { |
| 149 | 149 | // It did, so replace message with the translated version |
| 150 | 150 | $message = $translated_message; |
@@ -127,11 +127,11 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | // Add option settings change action to the admin log |
| 129 | 129 | $phpbb_log = $this->container->get('log'); |
| 130 | - $phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_' . $this->lang_key_prefix . '_UPDATED'); |
|
| 130 | + $phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_'.$this->lang_key_prefix.'_UPDATED'); |
|
| 131 | 131 | |
| 132 | 132 | // Option settings have been updated and logged |
| 133 | 133 | // Confirm this to the user and provide link back to previous page |
| 134 | - trigger_error($this->user->lang($this->lang_key_prefix . '_SAVED') . adm_back_link($this->u_action)); |
|
| 134 | + trigger_error($this->user->lang($this->lang_key_prefix.'_SAVED').adm_back_link($this->u_action)); |
|
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | { |
| 240 | 240 | if (empty($settings) && $depend_on == true) |
| 241 | 241 | { |
| 242 | - trigger_error($this->user->lang($this->lang_key_prefix . '_MISSING') . adm_back_link($this->u_action), E_USER_WARNING); |
|
| 242 | + trigger_error($this->user->lang($this->lang_key_prefix.'_MISSING').adm_back_link($this->u_action), E_USER_WARNING); |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | return $settings; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $this->template = $template; |
| 65 | 65 | $this->user = $user; |
| 66 | 66 | $this->adm_relative_path = $adm_relative_path; |
| 67 | - $this->phpbb_admin_path = $phpbb_root_path . $adm_relative_path; |
|
| 67 | + $this->phpbb_admin_path = $phpbb_root_path.$adm_relative_path; |
|
| 68 | 68 | $this->phpbb_root_path = $phpbb_root_path; |
| 69 | 69 | $this->php_ext = $php_ext; |
| 70 | 70 | parent::__construct( |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | if ($where_sql || $deleteall) |
| 116 | 116 | { |
| 117 | 117 | $entity->delete(0, '', $where_sql); |
| 118 | - $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_' . $this->lang_key_prefix . '_PURGED', time()); |
|
| 118 | + $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_'.$this->lang_key_prefix.'_PURGED', time()); |
|
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | else |
@@ -152,10 +152,10 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | // Define where and sort sql for use in displaying transactions |
| 154 | 154 | $sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0; |
| 155 | - $sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); |
|
| 155 | + $sql_sort = $sort_by_sql[$sort_key].' '.(($sort_dir == 'd') ? 'DESC' : 'ASC'); |
|
| 156 | 156 | |
| 157 | 157 | $keywords = utf8_normalize_nfc($this->request->variable('keywords', '', true)); |
| 158 | - $keywords_param = !empty($keywords) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : ''; |
|
| 158 | + $keywords_param = !empty($keywords) ? '&keywords='.urlencode(htmlspecialchars_decode($keywords)) : ''; |
|
| 159 | 159 | |
| 160 | 160 | // Grab log data |
| 161 | 161 | $log_data = array(); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | $this->view_txn_log($log_data, $log_count, $this->config['topics_per_page'], $start, $sql_where, $sql_sort, $keywords); |
| 165 | 165 | |
| 166 | - $base_url = $this->u_action . '&' . $u_sort_param . $keywords_param; |
|
| 166 | + $base_url = $this->u_action.'&'.$u_sort_param.$keywords_param; |
|
| 167 | 167 | $pagination->generate_template_pagination($base_url, 'pagination', 'start', $log_count, $this->config['topics_per_page'], $start); |
| 168 | 168 | |
| 169 | 169 | $this->template->assign_vars(array( |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | 'S_SORT_DIR' => $s_sort_dir, |
| 175 | 175 | 'S_TXN' => $mode, |
| 176 | 176 | |
| 177 | - 'U_ACTION' => $this->u_action . '&' . $u_sort_param . $keywords_param . '&start=' . $start, |
|
| 177 | + 'U_ACTION' => $this->u_action.'&'.$u_sort_param.$keywords_param.'&start='.$start, |
|
| 178 | 178 | )); |
| 179 | 179 | |
| 180 | 180 | foreach ($log_data as $row) |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | 'TXN_ID' => $data['txn_id'], |
| 237 | 237 | |
| 238 | 238 | 'BOARD_USERNAME' => $data['username'], |
| 239 | - 'NAME' => $data['first_name'] . ' ' . $data['last_name'], |
|
| 239 | + 'NAME' => $data['first_name'].' '.$data['last_name'], |
|
| 240 | 240 | 'PAYER_EMAIL' => $data['payer_email'], |
| 241 | 241 | 'PAYER_ID' => $data['payer_id'], |
| 242 | 242 | 'PAYER_STATUS' => ($data['payer_status']) ? $this->user->lang['PPDE_DT_VERIFIED'] : $this->user->lang['PPDE_DT_UNVERIFIED'], |
@@ -244,13 +244,13 @@ discard block |
||
| 244 | 244 | 'RECEIVER_EMAIL' => $data['receiver_email'], |
| 245 | 245 | 'RECEIVER_ID' => $data['receiver_id'], |
| 246 | 246 | |
| 247 | - 'MC_GROSS' => $data['mc_gross'] . ' ' . $data['mc_currency'], |
|
| 248 | - 'MC_FEE' => '-' . $data['mc_fee'] . ' ' . $data['mc_currency'], |
|
| 249 | - 'MC_NET' => $data['net_amount'] . ' ' . $data['mc_currency'], |
|
| 247 | + 'MC_GROSS' => $data['mc_gross'].' '.$data['mc_currency'], |
|
| 248 | + 'MC_FEE' => '-'.$data['mc_fee'].' '.$data['mc_currency'], |
|
| 249 | + 'MC_NET' => $data['net_amount'].' '.$data['mc_currency'], |
|
| 250 | 250 | |
| 251 | - 'CONVERT_FROM' => '-' . $data['net_amount'] . ' ' . $data['mc_currency'], |
|
| 252 | - 'SETTLE_AMOUNT' => $data['settle_amount'] . ' ' . $data['settle_currency'], |
|
| 253 | - 'EXCHANGE_RATE' => '1 ' . $data['mc_currency'] . ' = ' . $data['exchange_rate'] . ' ' . $data['settle_currency'], |
|
| 251 | + 'CONVERT_FROM' => '-'.$data['net_amount'].' '.$data['mc_currency'], |
|
| 252 | + 'SETTLE_AMOUNT' => $data['settle_amount'].' '.$data['settle_currency'], |
|
| 253 | + 'EXCHANGE_RATE' => '1 '.$data['mc_currency'].' = '.$data['exchange_rate'].' '.$data['settle_currency'], |
|
| 254 | 254 | |
| 255 | 255 | 'ITEM_NAME' => $data['item_name'], |
| 256 | 256 | 'ITEM_NUMBER' => $data['item_number'], |
@@ -313,13 +313,13 @@ discard block |
||
| 313 | 313 | |
| 314 | 314 | if ($this->get_container_entity()->is_in_admin() && $this->phpbb_admin_path) |
| 315 | 315 | { |
| 316 | - $url_ary['profile_url'] = append_sid($this->phpbb_admin_path . 'index.' . $this->php_ext, 'i=users&mode=overview'); |
|
| 317 | - $url_ary['txn_url'] = append_sid($this->phpbb_admin_path . 'index.' . $this->php_ext, 'i=-skouat-ppde-acp-ppde_module&mode=transactions'); |
|
| 316 | + $url_ary['profile_url'] = append_sid($this->phpbb_admin_path.'index.'.$this->php_ext, 'i=users&mode=overview'); |
|
| 317 | + $url_ary['txn_url'] = append_sid($this->phpbb_admin_path.'index.'.$this->php_ext, 'i=-skouat-ppde-acp-ppde_module&mode=transactions'); |
|
| 318 | 318 | |
| 319 | 319 | } |
| 320 | 320 | else |
| 321 | 321 | { |
| 322 | - $url_ary['profile_url'] = append_sid($this->phpbb_root_path . 'memberlist.' . $this->php_ext, 'mode=viewprofile'); |
|
| 322 | + $url_ary['profile_url'] = append_sid($this->phpbb_root_path.'memberlist.'.$this->php_ext, 'mode=viewprofile'); |
|
| 323 | 323 | $url_ary['txn_url'] = ''; |
| 324 | 324 | } |
| 325 | 325 | |
@@ -97,8 +97,8 @@ discard block |
||
| 97 | 97 | 'DONATION_PAGE_TITLE' => $this->user->lang[strtoupper($data['page_title'])], |
| 98 | 98 | 'DONATION_PAGE_LANG' => (string) $lang, |
| 99 | 99 | |
| 100 | - 'U_DELETE' => $this->u_action . '&action=delete&' . $this->id_prefix_name . '_id=' . $data['page_id'], |
|
| 101 | - 'U_EDIT' => $this->u_action . '&action=edit&' . $this->id_prefix_name . '_id=' . $data['page_id'], |
|
| 100 | + 'U_DELETE' => $this->u_action.'&action=delete&'.$this->id_prefix_name.'_id='.$data['page_id'], |
|
| 101 | + 'U_EDIT' => $this->u_action.'&action=edit&'.$this->id_prefix_name.'_id='.$data['page_id'], |
|
| 102 | 102 | )); |
| 103 | 103 | } |
| 104 | 104 | unset($data_ary, $data); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | public function add_donation_page() |
| 137 | 137 | { |
| 138 | 138 | // Add form key |
| 139 | - add_form_key('add_edit_' . $this->module_name); |
|
| 139 | + add_form_key('add_edit_'.$this->module_name); |
|
| 140 | 140 | |
| 141 | 141 | // Initiate a page donation entity |
| 142 | 142 | /** @type \skouat\ppde\entity\donation_pages $entity */ |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $this->template->assign_vars(array( |
| 163 | 163 | 'S_ADD_DONATION_PAGE' => true, |
| 164 | 164 | |
| 165 | - 'U_ADD_ACTION' => $this->u_action . '&action=add', |
|
| 165 | + 'U_ADD_ACTION' => $this->u_action.'&action=add', |
|
| 166 | 166 | 'U_BACK' => $this->u_action, |
| 167 | 167 | )); |
| 168 | 168 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | { |
| 220 | 220 | try |
| 221 | 221 | { |
| 222 | - call_user_func(array($entity, ($enabled ? 'message_enable_' : 'message_disable_') . $function)); |
|
| 222 | + call_user_func(array($entity, ($enabled ? 'message_enable_' : 'message_disable_').$function)); |
|
| 223 | 223 | } |
| 224 | 224 | catch (\skouat\ppde\exception\base $e) |
| 225 | 225 | { |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | |
| 241 | 241 | // Check some settings before loading and submitting form |
| 242 | 242 | $errors = array_merge($errors, |
| 243 | - $this->is_invalid_form('add_edit_' . $this->module_name, $this->submit_or_preview($this->submit)), |
|
| 243 | + $this->is_invalid_form('add_edit_'.$this->module_name, $this->submit_or_preview($this->submit)), |
|
| 244 | 244 | $this->is_empty_data($entity, 'name', '', $this->submit_or_preview($this->submit)), |
| 245 | 245 | $this->is_empty_data($entity, 'lang_id', 0, $this->submit_or_preview($this->submit)) |
| 246 | 246 | ); |
@@ -261,14 +261,14 @@ discard block |
||
| 261 | 261 | 'ERROR_MSG' => (sizeof($errors)) ? implode('<br />', $errors) : '', |
| 262 | 262 | |
| 263 | 263 | 'L_DONATION_PAGES_TITLE' => $this->user->lang[strtoupper($entity->get_name())], |
| 264 | - 'L_DONATION_PAGES_TITLE_EXPLAIN' => $this->user->lang[strtoupper($entity->get_name()) . '_EXPLAIN'], |
|
| 264 | + 'L_DONATION_PAGES_TITLE_EXPLAIN' => $this->user->lang[strtoupper($entity->get_name()).'_EXPLAIN'], |
|
| 265 | 265 | 'DONATION_BODY' => $entity->get_message_for_edit(), |
| 266 | 266 | |
| 267 | 267 | 'S_BBCODE_DISABLE_CHECKED' => !$entity->message_bbcode_enabled(), |
| 268 | 268 | 'S_SMILIES_DISABLE_CHECKED' => !$entity->message_smilies_enabled(), |
| 269 | 269 | 'S_MAGIC_URL_DISABLE_CHECKED' => !$entity->message_magic_url_enabled(), |
| 270 | 270 | |
| 271 | - 'BBCODE_STATUS' => $this->user->lang('BBCODE_IS_ON', '<a href="' . append_sid("{$this->phpbb_root_path}faq.{$this->php_ext}", 'mode=bbcode') . '">', '</a>'), |
|
| 271 | + 'BBCODE_STATUS' => $this->user->lang('BBCODE_IS_ON', '<a href="'.append_sid("{$this->phpbb_root_path}faq.{$this->php_ext}", 'mode=bbcode').'">', '</a>'), |
|
| 272 | 272 | 'SMILIES_STATUS' => $this->user->lang['SMILIES_ARE_ON'], |
| 273 | 273 | 'IMG_STATUS' => $this->user->lang['IMAGES_ARE_ON'], |
| 274 | 274 | 'FLASH_STATUS' => $this->user->lang['FLASH_IS_ON'], |
@@ -279,11 +279,11 @@ discard block |
||
| 279 | 279 | 'S_BBCODE_IMG' => true, |
| 280 | 280 | 'S_BBCODE_FLASH' => true, |
| 281 | 281 | 'S_LINKS_ALLOWED' => true, |
| 282 | - 'S_HIDDEN_FIELDS' => '<input type="hidden" name="page_title" value="' . $entity->get_name() . '" />', |
|
| 282 | + 'S_HIDDEN_FIELDS' => '<input type="hidden" name="page_title" value="'.$entity->get_name().'" />', |
|
| 283 | 283 | )); |
| 284 | 284 | |
| 285 | 285 | // Assigning custom bbcodes |
| 286 | - include_once($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext); |
|
| 286 | + include_once($this->phpbb_root_path.'includes/functions_display.'.$this->php_ext); |
|
| 287 | 287 | |
| 288 | 288 | display_custom_bbcodes(); |
| 289 | 289 | } |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | */ |
| 301 | 301 | private function get_message_parse_options($entity, $data, $type) |
| 302 | 302 | { |
| 303 | - return array($type => $this->submit_or_preview($this->submit, $this->preview) ? $data[$type] : (bool) call_user_func(array($entity, 'message_' . $type . '_enabled'))); |
|
| 303 | + return array($type => $this->submit_or_preview($this->submit, $this->preview) ? $data[$type] : (bool) call_user_func(array($entity, 'message_'.$type.'_enabled'))); |
|
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | /** |
@@ -364,8 +364,8 @@ discard block |
||
| 364 | 364 | |
| 365 | 365 | $log_action = $this->add_edit_data($entity); |
| 366 | 366 | // Log and show user confirmation of the saved item and provide link back to the previous page |
| 367 | - $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_' . $this->lang_key_prefix . '_' . strtoupper($log_action), time(), array($this->user->lang(strtoupper($entity->get_name())), $this->lang_local_name)); |
|
| 368 | - trigger_error($this->user->lang($this->lang_key_prefix . '_' . strtoupper($log_action), $this->lang_local_name) . adm_back_link($this->u_action)); |
|
| 367 | + $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_'.$this->lang_key_prefix.'_'.strtoupper($log_action), time(), array($this->user->lang(strtoupper($entity->get_name())), $this->lang_local_name)); |
|
| 368 | + trigger_error($this->user->lang($this->lang_key_prefix.'_'.strtoupper($log_action), $this->lang_local_name).adm_back_link($this->u_action)); |
|
| 369 | 369 | } |
| 370 | 370 | } |
| 371 | 371 | |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | public function edit_donation_page($page_id) |
| 397 | 397 | { |
| 398 | 398 | // Add form key |
| 399 | - add_form_key('add_edit_' . $this->module_name); |
|
| 399 | + add_form_key('add_edit_'.$this->module_name); |
|
| 400 | 400 | |
| 401 | 401 | // Initiate a page donation entity |
| 402 | 402 | /** @type \skouat\ppde\entity\donation_pages $entity */ |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | $this->template->assign_vars(array( |
| 425 | 425 | 'S_EDIT_DONATION_PAGE' => true, |
| 426 | 426 | |
| 427 | - 'U_EDIT_ACTION' => $this->u_action . '&action=edit&' . $this->id_prefix_name . '_id=' . $page_id, |
|
| 427 | + 'U_EDIT_ACTION' => $this->u_action.'&action=edit&'.$this->id_prefix_name.'_id='.$page_id, |
|
| 428 | 428 | 'U_BACK' => $this->u_action, |
| 429 | 429 | )); |
| 430 | 430 | } |
@@ -450,10 +450,10 @@ discard block |
||
| 450 | 450 | $entity->delete($page_id); |
| 451 | 451 | |
| 452 | 452 | // Log the action |
| 453 | - $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG' . $this->lang_key_prefix . '_DELETED', time(), array($this->user->lang(strtoupper($entity->get_name())), $this->lang_local_name)); |
|
| 453 | + $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG'.$this->lang_key_prefix.'_DELETED', time(), array($this->user->lang(strtoupper($entity->get_name())), $this->lang_local_name)); |
|
| 454 | 454 | |
| 455 | 455 | // If AJAX was used, show user a result message |
| 456 | - $message = $this->user->lang($this->lang_key_prefix . '_DELETED', $this->lang_local_name); |
|
| 456 | + $message = $this->user->lang($this->lang_key_prefix.'_DELETED', $this->lang_local_name); |
|
| 457 | 457 | $this->ajax_delete_result_message($message); |
| 458 | 458 | } |
| 459 | 459 | } |
@@ -248,14 +248,14 @@ discard block |
||
| 248 | 248 | foreach ($args as $key => $value) |
| 249 | 249 | { |
| 250 | 250 | $value = urlencode($value); |
| 251 | - $message .= $key . ' = ' . $value . ";\n"; |
|
| 251 | + $message .= $key.' = '.$value.";\n"; |
|
| 252 | 252 | } |
| 253 | 253 | unset($value); |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | if ($log_in_file) |
| 257 | 257 | { |
| 258 | - error_log(sprintf('[%s] %s %s', $error_timestamp, $message, $backtrace), 3, $this->root_path . 'store/ppde_transactions.log'); |
|
| 258 | + error_log(sprintf('[%s] %s %s', $error_timestamp, $message, $backtrace), 3, $this->root_path.'store/ppde_transactions.log'); |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | if ($exit) |
@@ -474,13 +474,13 @@ discard block |
||
| 474 | 474 | foreach ($this->get_post_data() as $key => $value) |
| 475 | 475 | { |
| 476 | 476 | $encoded = urlencode(stripslashes($value)); |
| 477 | - $values[] = $key . '=' . $encoded; |
|
| 477 | + $values[] = $key.'='.$encoded; |
|
| 478 | 478 | |
| 479 | 479 | $this->transaction_data[$key] = $value; |
| 480 | 480 | } |
| 481 | 481 | |
| 482 | 482 | // implode the array into a string URI |
| 483 | - $this->args_return_uri .= '&' . implode('&', $values); |
|
| 483 | + $this->args_return_uri .= '&'.implode('&', $values); |
|
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | /** |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | if (curl_errno($ch) != 0) |
| 542 | 542 | { |
| 543 | 543 | // cURL error |
| 544 | - $this->log_error($this->user->lang['CURL_ERROR'] . curl_errno($ch) . ' (' . curl_error($ch) . ')', $this->use_log_error); |
|
| 544 | + $this->log_error($this->user->lang['CURL_ERROR'].curl_errno($ch).' ('.curl_error($ch).')', $this->use_log_error); |
|
| 545 | 545 | curl_close($ch); |
| 546 | 546 | } |
| 547 | 547 | else |
@@ -578,20 +578,20 @@ discard block |
||
| 578 | 578 | // post back to PayPal system to validate |
| 579 | 579 | $header = "POST /cgi-bin/webscr HTTP/1.1\r\n"; |
| 580 | 580 | $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; |
| 581 | - $header .= 'Host: ' . $parse_url['host'] . "\r\n"; |
|
| 582 | - $header .= 'Content-Length: ' . strlen($encoded_data) . "\r\n"; |
|
| 581 | + $header .= 'Host: '.$parse_url['host']."\r\n"; |
|
| 582 | + $header .= 'Content-Length: '.strlen($encoded_data)."\r\n"; |
|
| 583 | 583 | $header .= "Connection: Close\r\n\r\n"; |
| 584 | 584 | |
| 585 | - $fp = fsockopen('ssl://' . $parse_url['host'], 443, $errno, $errstr, $this->timeout); |
|
| 585 | + $fp = fsockopen('ssl://'.$parse_url['host'], 443, $errno, $errstr, $this->timeout); |
|
| 586 | 586 | |
| 587 | 587 | if (!$fp) |
| 588 | 588 | { |
| 589 | - $this->log_error($this->user->lang['FSOCK_ERROR'] . $errno . ' (' . $errstr . ')', $this->use_log_error); |
|
| 589 | + $this->log_error($this->user->lang['FSOCK_ERROR'].$errno.' ('.$errstr.')', $this->use_log_error); |
|
| 590 | 590 | } |
| 591 | 591 | else |
| 592 | 592 | { |
| 593 | 593 | // Send the data to PayPal |
| 594 | - fputs($fp, $header . $encoded_data); |
|
| 594 | + fputs($fp, $header.$encoded_data); |
|
| 595 | 595 | |
| 596 | 596 | // Loop through the response |
| 597 | 597 | while (!feof($fp)) |
@@ -626,17 +626,17 @@ discard block |
||
| 626 | 626 | if ($this->txn_is_verified()) |
| 627 | 627 | { |
| 628 | 628 | $this->verified = $this->transaction_data['confirmed'] = true; |
| 629 | - $this->log_error("DEBUG VERIFIED:\n" . $this->get_text_report(), $this->use_log_error); |
|
| 629 | + $this->log_error("DEBUG VERIFIED:\n".$this->get_text_report(), $this->use_log_error); |
|
| 630 | 630 | } |
| 631 | 631 | else if ($this->txn_is_invalid()) |
| 632 | 632 | { |
| 633 | 633 | $this->verified = $this->transaction_data['confirmed'] = false; |
| 634 | - $this->log_error("DEBUG INVALID:\n" . $this->get_text_report(), $this->use_log_error); |
|
| 634 | + $this->log_error("DEBUG INVALID:\n".$this->get_text_report(), $this->use_log_error); |
|
| 635 | 635 | } |
| 636 | 636 | else |
| 637 | 637 | { |
| 638 | 638 | $this->verified = $this->transaction_data['confirmed'] = false; |
| 639 | - $this->log_error("DEBUG OTHER:\n" . $this->get_text_report(), $this->use_log_error); |
|
| 639 | + $this->log_error("DEBUG OTHER:\n".$this->get_text_report(), $this->use_log_error); |
|
| 640 | 640 | $this->log_error($this->user->lang['UNEXPECTED_RESPONSE'], $this->use_log_error, true); |
| 641 | 641 | } |
| 642 | 642 | |
@@ -696,12 +696,12 @@ discard block |
||
| 696 | 696 | |
| 697 | 697 | // Date and POST url |
| 698 | 698 | $this->text_report_insert_line($r); |
| 699 | - $r .= "\n[" . date('m/d/Y g:i A') . '] - ' . $this->u_paypal . ' ( ' . $this->get_curl_fsock() . " )\n"; |
|
| 699 | + $r .= "\n[".date('m/d/Y g:i A').'] - '.$this->u_paypal.' ( '.$this->get_curl_fsock()." )\n"; |
|
| 700 | 700 | |
| 701 | 701 | // HTTP Response |
| 702 | 702 | $this->text_report_insert_line($r); |
| 703 | - $r .= "\n" . $this->get_report_response() . "\n"; |
|
| 704 | - $r .= "\n" . $this->get_response_status() . "\n"; |
|
| 703 | + $r .= "\n".$this->get_report_response()."\n"; |
|
| 704 | + $r .= "\n".$this->get_response_status()."\n"; |
|
| 705 | 705 | $this->text_report_insert_line($r); |
| 706 | 706 | |
| 707 | 707 | // POST vars |
@@ -767,7 +767,7 @@ discard block |
||
| 767 | 767 | { |
| 768 | 768 | foreach ($this->transaction_data as $key => $value) |
| 769 | 769 | { |
| 770 | - $r .= str_pad($key, 25) . $value . "\n"; |
|
| 770 | + $r .= str_pad($key, 25).$value."\n"; |
|
| 771 | 771 | } |
| 772 | 772 | } |
| 773 | 773 | |
@@ -897,7 +897,7 @@ discard block |
||
| 897 | 897 | { |
| 898 | 898 | if (!function_exists('group_user_add')) |
| 899 | 899 | { |
| 900 | - include($this->root_path . 'includes/functions_user.' . $this->php_ext); |
|
| 900 | + include($this->root_path.'includes/functions_user.'.$this->php_ext); |
|
| 901 | 901 | } |
| 902 | 902 | |
| 903 | 903 | // add the user to the donors group and set as default. |