Beispiel #1
0
 public function load_config_on_setup($event)
 {
     if ($event['mode'] == 'features') {
         $display_vars = $event['display_vars'];
         $add_config_var['email_on_birthday'] = array('lang' => 'E_MAIL_ON_BIRTHDAY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true);
         $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $add_config_var, array('after' => 'allow_quick_reply'));
         $event['display_vars'] = array('title' => $display_vars['title'], 'vars' => $display_vars['vars']);
     }
 }
Beispiel #2
0
 /**
  * Add Lightbox settings to the ACP
  *
  * @param object $event The event object
  * @return null
  * @access public
  */
 public function add_lightbox_acp_config($event)
 {
     if ($event['mode'] == 'post' && isset($event['display_vars']['vars']['legend3'])) {
         $this->user->add_lang_ext('vse/lightbox', 'lightbox');
         $display_vars = $event['display_vars'];
         $my_config_vars = array('legend_lightbox' => 'LIGHTBOX_SETTINGS', 'lightbox_max_width' => array('lang' => 'LIGHTBOX_MAX_WIDTH', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true, 'append' => ' ' . $this->user->lang('PIXEL')), 'lightbox_gallery' => array('lang' => 'LIGHTBOX_GALLERY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'lightbox_signatures' => array('lang' => 'LIGHTBOX_SIGNATURES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true));
         $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $my_config_vars, array('before' => 'legend3'));
         $event['display_vars'] = $display_vars;
     }
 }
Beispiel #3
0
 public function add_config($event)
 {
     if ($event['mode'] == 'server') {
         $this->user->add_lang_ext('boardtools/upload', 'upload');
         $display_vars = $event['display_vars'];
         $new_vars = array('upload_ext_dir' => array('lang' => 'ACP_UPLOAD_EXT_DIR', 'validate' => 'path', 'type' => 'text:20:255', 'explain' => true));
         $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $new_vars, array('after' => 'ranks_path'));
         $event['display_vars'] = $display_vars;
     }
 }
Beispiel #4
0
 public function load_config_on_setup($event)
 {
     if ($event['mode'] == 'features') {
         $display_vars = $event['display_vars'];
         $add_config_var['error_pages_explain'] = array('lang' => 'ERRORPAGES_EXPLAIN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true);
         $add_config_var['error_pages_log'] = array('lang' => 'ERRORPAGES_LOG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true);
         $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $add_config_var, array('after' => 'allow_quick_reply'));
         $event['display_vars'] = array('title' => $display_vars['title'], 'vars' => $display_vars['vars']);
     }
 }
Beispiel #5
0
 /**
  * Add Fancybox settings to the ACP
  *
  * @param object $event The event object
  * @return null
  * @access public
  */
 public function lotusjeff_fancybox_add_acp_config($event)
 {
     if ($event['mode'] == 'post' && isset($event['display_vars']['vars']['legend3'])) {
         $this->user->add_lang_ext('lotusjeff/fancybox', 'fancybox');
         $display_vars = $event['display_vars'];
         $my_config_vars = array('legend_lotusjeff_fancybox' => 'LOTUSJEFF_FANCYBOX_SETTINGS', 'lotusjeff_fancybox_button' => array('lang' => 'LOTUSJEFF_FANCYBOX_BUTTON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'lotusjeff_fancybox_gallery' => array('lang' => 'LOTUSJEFF_FANCYBOX_GALLERY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'lotusjeff_fancybox_small' => array('lang' => 'LOTUSJEFF_FANCYBOX_SMALL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true));
         $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $my_config_vars, array('before' => 'legend3'));
         $event['display_vars'] = $display_vars;
     }
 }
Beispiel #6
0
 public function acp_avatar_add_config($event)
 {
     $mode = $event['mode'];
     if ($mode == 'avatar') {
         $new_config = array('avatar_upload_max_width' => array('lang' => 'MAX_AVATAR_UPLOAD', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false), 'avatar_upload_max_height' => array('lang' => 'MAX_AVATAR_UPLOAD', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false), 'avatar_upload_max' => array('lang' => 'MAX_AVATAR_UPLOAD', 'validate' => 'int:0', 'type' => 'dimension:0', 'explain' => true, 'append' => ' ' . $this->user->lang['PIXEL']));
         $search_slice = 'allow_avatar_upload';
         $display_vars = $event['display_vars'];
         $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $new_config, array('after' => $search_slice));
         $event['display_vars'] = array('title' => $display_vars['title'], 'vars' => $display_vars['vars']);
     }
 }
 public function add_options($event)
 {
     if (($event['mode'] == 'features' || $event['mode'] == 'load') && isset($event['display_vars']['vars']['load_jumpbox'])) {
         // Store display_vars event in a local variable
         $display_vars = $event['display_vars'];
         // Define config vars
         $config_vars = array('allow_visits_counter' => array('lang' => 'ALLOW_VISITS_COUNTER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true));
         $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $config_vars, array('after' => 'load_jumpbox'));
         // Update the display_vars	event with the new array
         $event['display_vars'] = array('title' => $display_vars['title'], 'vars' => $display_vars['vars']);
     }
 }
 public function add_options($event)
 {
     if ($event['mode'] == 'registration' && isset($event['display_vars']['vars']['legend2'])) {
         // Store display_vars event in a local variable
         $display_vars = $event['display_vars'];
         // Define config vars
         $config_vars = array('legend_sfs' => 'SFS_CONTROL', 'allow_sfs' => array('lang' => 'SFS_ENABLED', 'validate' => 'bool', 'type' => 'custom', 'function' => array($this, 'allow_sfs'), 'explain' => true), 'sfs_threshold' => array('lang' => 'SFS_THRESHOLD_SCORE', 'validate' => 'int:1:99', 'type' => 'number:1:99', 'explain' => true), 'sfs_ban_ip' => array('lang' => 'SFS_BAN_IP', 'valdate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'sfs_down' => array('lang' => 'SFS_DOWN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'sfs_log_message' => array('lang' => 'SFS_LOG_MESSAGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true));
         $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $config_vars, array('before' => 'legend2'));
         // Update the display_vars  event with the new array
         $event['display_vars'] = array('title' => $display_vars['title'], 'vars' => $display_vars['vars']);
     }
 }
 public function add_options($event)
 {
     global $user;
     if (($event['mode'] == 'features' || $event['mode'] == 'load') && isset($event['display_vars']['vars']['load_birthdays'])) {
         // Store display_vars event in a local variable
         $display_vars = $event['display_vars'];
         // Define config vars
         $config_vars = array('allow_birthdays_ahead' => array('lang' => 'ALLOW_BIRTHDAYS_AHEAD', 'validate' => 'int:1', 'type' => 'custom:1:365', 'function' => array($this, 'ubl_length'), 'explain' => true));
         $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $config_vars, array('after' => 'load_birthdays'));
         // Update the display_vars  event with the new array
         $event['display_vars'] = array('title' => $display_vars['title'], 'vars' => $display_vars['vars']);
     }
 }
Beispiel #10
0
 public function add_options($event)
 {
     global $user;
     if (($event['mode'] == 'features' || $event['mode'] == 'load') && isset($event['display_vars']['vars']['load_jumpbox'])) {
         // Store display_vars event in a local variable
         $display_vars = $event['display_vars'];
         // Define config vars
         $config_vars = array('legend4' => 'DOWNLOADLOG_SETTINGS', 'downloadlog_value' => array('lang' => 'DOWNLOADLOG_PAGINATION_SETTING', 'validate' => 'int:1', 'type' => 'custom:1:255', 'function' => array($this, 'downloadlog_length'), 'explain' => true));
         $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $config_vars, array('after' => 'load_cpf_viewtopic'));
         // Update the display_vars	event with the new array
         $event['display_vars'] = array('title' => $display_vars['title'], 'vars' => $display_vars['vars']);
     }
 }
 public function add_options($event)
 {
     //$this->var_display($event['display_vars']);
     if ($event['mode'] == 'settings') {
         // Store display_vars event in a local variable
         $display_vars = $event['display_vars'];
         // Define my new config vars
         $my_config_vars = array('autoban_active' => array('lang' => 'AUTOBAN_ACTIVE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'autoban_count' => array('lang' => 'AUTOBAN_COUNT', 'validate' => 'int:0:99', 'type' => 'number:0:99', 'explain' => true), 'autoban_duration' => array('lang' => 'AUTOBAN_DURATION', 'validate' => 'int:0:99', 'type' => 'number:0:99', 'explain' => true, 'append' => $this->user->lang['DAYS']), 'autoban_reason' => array('lang' => 'AUTOBAN_REASON', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true));
         $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $my_config_vars, array('before' => 'warnings_expire_days'));
         // Update the display_vars  event with the new array
         $event['display_vars'] = array('title' => $display_vars['title'], 'vars' => $display_vars['vars']);
     }
 }
Beispiel #12
0
 public function load_config_on_setup($event)
 {
     if ($event['mode'] == 'registration') {
         if ($event['submit']) {
             $this->request->enable_super_globals();
             $_POST['config']['allow_email_login'] = 0;
             $this->request->disable_super_globals();
         }
         $display_vars = $event['display_vars'];
         $add_config_var = array('allow_email_login' => array('lang' => 'LIWE_ALLOWED', 'validate' => 'bool', 'type' => 'custom', 'function' => __NAMESPACE__ . '\\listener::allow_email_login', 'explain' => true));
         $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $add_config_var, array('after' => 'allow_emailreuse'));
         $event['display_vars'] = array('title' => $display_vars['title'], 'vars' => $display_vars['vars']);
     }
 }
Beispiel #13
0
 public function acp_board_config($event)
 {
     $mode = $event['mode'];
     if ($mode == 'post') {
         $new_config = array('legend_newtopic' => 'ACP_NEWTOPIC', 'newtopic_forum' => array('lang' => 'ACP_NEWTOPIC_FORUM', 'validate' => 'string', 'type' => 'custom', 'function' => array($this, 'select_forums'), 'explain' => true), 'newtopic_button' => array('lang' => 'ACP_NEWTOPIC_BUTTON', 'validate' => 'string', 'type' => 'text:25:40', 'explain' => false));
         $search_slice = 'max_post_img_height';
         $display_vars = $event['display_vars'];
         $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $new_config, array('after' => $search_slice));
         $event['display_vars'] = array('title' => $display_vars['title'], 'vars' => $display_vars['vars']);
         if ($event['submit']) {
             $values = $this->request->variable('newtopic_forum', array(0 => ''));
             $this->config->set('newtopic_forum', implode(',', $values));
         }
     }
 }
Beispiel #14
0
 public function acp_board_config($event)
 {
     if ($event['mode'] == 'post') {
         $this->user->add_lang_ext('bb3mobi/vkRepost', 'info_acp_repost_vk');
         $display_vars = $event['display_vars'];
         $new_config = array('legend4' => 'VK_REPOST', 'vk_api_id' => array('lang' => 'VK_API_ID', 'validate' => 'string', 'type' => 'text:30:200', 'explain' => true), 'vk_token' => array('lang' => 'VK_TOKEN', 'validate' => 'string', 'type' => 'custom', 'function' => array($this, 'token_link'), 'explain' => true), 'vk_repost_group' => array('lang' => 'VK_REPOST_GROUP', 'validate' => 'string', 'type' => 'text:15:100', 'explain' => true), 'vk_repost_forum' => array('lang' => 'VK_REPOST_FORUMS', 'validate' => 'string', 'type' => 'custom', 'function' => array($this, 'select_forums'), 'explain' => true), 'vk_repost_admin' => array('lang' => 'VK_REPOST_ADMIN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'vk_repost_text' => array('lang' => 'VK_REPOST_TEXT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'vk_repost_lenght' => array('lang' => 'VK_REPOST_LENGHT', 'validate' => 'int:0', 'type' => 'text:4:6', 'explain' => false), 'vk_repost_url' => array('lang' => 'VK_REPOST_URL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true));
         $display_vars = $event['display_vars'];
         $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $new_config, array('after' => 'max_post_img_height'));
         $event['display_vars'] = array('title' => $display_vars['title'], 'vars' => $display_vars['vars']);
         if ($event['submit']) {
             $values = $this->request->variable('vk_repost_forum', array(0 => ''));
             $this->config->set('vk_repost_forum', implode(',', $values));
         }
     }
 }
Beispiel #15
0
 /**
  * Add config vars to ACP Board Settings
  *
  * @param object $event The event object
  * @return null
  * @access public
  */
 public function add_googleanalytics_configs($event)
 {
     // Load language file
     $this->user->add_lang_ext('phpbb/googleanalytics', 'googleanalytics_acp');
     // Add a config to the settings mode, after board_timezone
     if ($event['mode'] == 'settings' && isset($event['display_vars']['vars']['board_timezone'])) {
         // Store display_vars event in a local variable
         $display_vars = $event['display_vars'];
         // Define the new config vars
         $ga_config_vars = array('googleanalytics_id' => array('lang' => 'ACP_GOOGLEANALYTICS_ID', 'validate' => 'googleanalytics_id', 'type' => 'text:40:20', 'explain' => true));
         // Add the new config vars after board_timezone in the display_vars config array
         $insert_after = array('after' => 'board_timezone');
         $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $ga_config_vars, $insert_after);
         // Update the display_vars event with the new array
         $event['display_vars'] = $display_vars;
     }
 }
Beispiel #16
0
 public function add_options($event)
 {
     //$this->var_display($event['display_vars']);
     if ($event['mode'] == 'settings') {
         // We should check if allow_birthdays is on!
         if ($this->config['allow_birthdays']) {
             // Store display_vars event in a local variable
             $display_vars = $event['display_vars'];
             // Define my new config vars
             $my_config_vars = array('legend10' => 'BIRTHDAY_CONTROL', 'allow_birthdays' => array('lang' => 'ALLOW_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'birthday_require' => array('lang' => 'BIRTHDAY_REQUIRE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'birthday_min_age' => array('lang' => 'BIRTHDAY_MIN_AGE', 'validate' => 'int:0:99', 'type' => 'number:0:99', 'explain' => true), 'birthday_show_post' => array('lang' => 'BIRTHDAY_SHOW_POST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true));
             $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $my_config_vars, array('after' => 'warnings_expire_days'));
             // Update the display_vars  event with the new array
             $event['display_vars'] = array('title' => $display_vars['title'], 'vars' => $display_vars['vars']);
             //$this->var_display($display_vars['vars']);
         } else {
             if ($this->config['birthday_require']) {
                 $this->config->set('birthday_require', 0);
             }
             if ($this->config['birthday_show_post']) {
                 $this->config->set('birthday_show_post', 0);
             }
         }
     }
 }
Beispiel #17
0
 public function add_config($event)
 {
     if ($event['mode'] == 'settings') {
         $this->user->add_lang_ext('boardtools/cronstatus', 'cronstatus');
         $display_vars = $event['display_vars'];
         /* We add a new legend, but we need to search for the last legend instead of hard-coding */
         $submit_key = array_search('ACP_SUBMIT_CHANGES', $display_vars['vars']);
         $submit_legend_number = substr($submit_key, 6);
         $display_vars['vars']['legend' . $submit_legend_number] = 'ACP_CRON_STATUS_TITLE';
         $new_vars = array('cronstatus_dateformat' => array('lang' => 'CRON_STATUS_DATE_FORMAT', 'validate' => 'string', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true), 'cronstatus_main_notice' => array('lang' => 'CRON_STATUS_MAIN_NOTICE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'legend' . ($submit_legend_number + 1) => 'ACP_SUBMIT_CHANGES');
         $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $new_vars, array('after' => $submit_key));
         $event['display_vars'] = $display_vars;
     }
 }
 /**
  * @dataProvider insert_config_array_data
  */
 public function test_insert_config_array($new_config, $position, $expected)
 {
     $config_array = $this->config_display_vars();
     $new_config_array = phpbb_insert_config_array($config_array, $new_config, $position);
     $this->assertSame($expected, $new_config_array);
 }
Beispiel #19
0
 /**
  * Add Dynamic settings to the ACP
  *
  * @return null
  * @access public
  */
 public function lotusjeff_dynamic_add_acp_config($event)
 {
     if ($event['mode'] == 'features' && isset($event['display_vars']['vars']['legend3'])) {
         $this->user->add_lang_ext('lotusjeff/dynamic', 'dynamic');
         $display_vars = $event['display_vars'];
         $my_config_vars = array('legend_lotusjeff_dynamic' => 'LOTUSJEFF_DYNAMIC_SETTINGS', 'lotusjeff_dynamic_facebook' => array('lang' => 'LOTUSJEFF_DYNAMIC_FACEBOOK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'lotusjeff_dynamic_twitter' => array('lang' => 'LOTUSJEFF_DYNAMIC_TWITTER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'lotusjeff_dynamic_first_image' => array('lang' => 'LOTUSJEFF_DYNAMIC_FIRST_IMAGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'lotusjeff_dynamic_random_image' => array('lang' => 'LOTUSJEFF_DYNAMIC_RANDOM_IMAGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'lotusjeff_dynamic_twitter_site' => array('lang' => 'LOTUSJEFF_DYNAMIC_TWITTER_SITE', 'validate' => 'string', 'type' => 'text:10:16', 'method' => '$this->lotusjeff_dynamic_twitter_site', 'explain' => true));
         $display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $my_config_vars, array('before' => 'legend3'));
         $event['display_vars'] = $display_vars;
     }
 }