Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions classes/controllers/FrmAddonsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class FrmAddonsController {

/**
* @since 6.15
*
* @return void
*/
public static function load_admin_hooks() {
add_action( 'admin_menu', self::class . '::menu', 100 );
Expand Down Expand Up @@ -420,6 +422,8 @@ public static function get_pro_download_url() {

/**
* @since 4.08
*
* @return string
*/
public static function get_pro_license() {
$pro_cred_store = 'frmpro-credentials';
Expand Down Expand Up @@ -458,6 +462,8 @@ protected static function get_pro_from_addons( $addons ) {

/**
* @since 4.06
*
* @return string
*/
public static function license_type() {
if ( is_callable( 'FrmProAddonsController::license_type' ) ) {
Expand Down Expand Up @@ -1034,6 +1040,8 @@ public static function url_is_allowed( $download_url ) {
* so let's install the plugin.
*
* @since 3.04.02
*
* @return array|string
*/
protected static function install_addon() {
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
Expand Down
18 changes: 18 additions & 0 deletions classes/controllers/FrmAppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ private static function get_menu_position() {

/**
* @since 3.05
*
* @return string
*/
private static function menu_icon() {
$icon = FrmAppHelper::svg_logo(
Expand Down Expand Up @@ -136,6 +138,8 @@ private static function get_os() {

/**
* @since 3.0
*
* @return bool
*/
private static function is_white_page() {
$white_pages = array(
Expand Down Expand Up @@ -818,6 +822,8 @@ private static function enqueue_builder_assets( $plugin_url, $version ) {
* Enqueues global settings scripts.
*
* @param string $page The `page` param in URL.
*
* @return void
*/
private static function enqueue_global_settings_scripts( $page ) {
if ( 'formidable-settings' === $page ) {
Expand Down Expand Up @@ -1076,6 +1082,8 @@ public static function create_rest_routes() {
* We don't want to run manually by people calling the API.
*
* @since 4.06.02
*
* @return bool
*/
public static function can_update_db() {
return get_transient( 'frm_updating_api' );
Expand Down Expand Up @@ -1187,6 +1195,11 @@ public static function uninstall() {
wp_die();
}

/**
* @param array $tables
*
* @return array
*/
public static function drop_tables( $tables ) {
global $wpdb;
$tables[] = $wpdb->prefix . 'frm_fields';
Expand Down Expand Up @@ -1236,6 +1249,11 @@ private static function maybe_activate_payment_cron() {
FrmTransLiteAppController::maybe_schedule_cron();
}

/**
* @param string $text
*
* @return string
*/
public static function set_footer_text( $text ) {
if ( FrmAppHelper::is_formidable_admin() ) {
$text = '';
Expand Down
2 changes: 2 additions & 0 deletions classes/controllers/FrmCronController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ private static function get_events() {
* Schedules cron events.
*
* @since 6.7
*
* @return void
*/
public static function schedule_events() {
$events = self::get_events();
Expand Down
6 changes: 6 additions & 0 deletions classes/controllers/FrmDashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,12 @@ private static function inbox_prepare_messages( $data ) {
return $data;
}

/**
* Clean messages CTA.
*
* @param string $cta
* @return string
*/
private static function inbox_clean_messages_cta( $cta ) {

// remove dismiss button
Expand Down
2 changes: 2 additions & 0 deletions classes/controllers/FrmEmailStylesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ private static function get_content_type_header( $email_style ) {

/**
* Shows placeholder Pro settings.
*
* @return void
*/
public static function show_upsell_settings() {
include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/email/settings.php';
Expand Down
2 changes: 2 additions & 0 deletions classes/controllers/FrmEmailSummaryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class FrmEmailSummaryController {

/**
* Maybe send summary emails.
*
* @return void
*/
public static function maybe_send_emails() {
$emails = FrmEmailSummaryHelper::should_send_emails();
Expand Down
41 changes: 40 additions & 1 deletion classes/controllers/FrmEntriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

class FrmEntriesController {

/**
* @return void
*/
public static function menu() {
FrmAppHelper::force_capability( 'frm_view_entries' );

Expand Down Expand Up @@ -90,6 +93,8 @@ private static function add_url_params_to_views_redirect_query_args( $query_args

/**
* @since 2.05.07
*
* @return void
*/
private static function load_manage_entries_hooks() {
if ( ! in_array( FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' ), array( 'edit', 'show', 'new', 'duplicate' ), true ) ) {
Expand All @@ -106,6 +111,8 @@ private static function load_manage_entries_hooks() {

/**
* Display in Back End.
*
* @return mixed
*/
public static function route() {
$action = FrmAppHelper::get_param( 'frm_action', '', 'get', 'sanitize_title' );
Expand All @@ -122,7 +129,8 @@ public static function route() {
return;
}

return self::display_list();
self::display_list();
return;
}
}

Expand All @@ -148,6 +156,11 @@ public static function remove_screen_options( $show_screen, $screen ) {
return $show_screen;
}

/**
* @param array $columns
*
* @return array
*/
public static function manage_columns( $columns ) {
global $frm_vars;
$form_id = FrmForm::get_current_form_id();
Expand Down Expand Up @@ -185,6 +198,12 @@ public static function manage_columns( $columns ) {
return $columns;
}

/**
* @param int|string $form_id
* @param array $columns
*
* @return void
*/
private static function get_columns_for_form( $form_id, &$columns ) {
$form_cols = FrmField::get_all_for_form( $form_id, '', 'include' );

Expand Down Expand Up @@ -424,6 +443,9 @@ public static function save_per_page( $save, $option, $value ) {
return $save;
}

/**
* @return array
*/
public static function sortable_columns() {
$form_id = FrmForm::get_current_form_id();
$fields = FrmField::get_all_for_form( $form_id );
Expand Down Expand Up @@ -556,6 +578,12 @@ private static function remove_excess_cols( $atts, &$result ) {
}
}

/**
* @param string $message
* @param array $errors
*
* @return void
*/
public static function display_list( $message = '', $errors = array() ) {
global $wpdb, $frm_vars;

Expand Down Expand Up @@ -683,6 +711,12 @@ public static function destroy() {
self::display_list( $message );
}

/**
* @param array|string $errors
* @param bool $ajax
*
* @return void
*/
public static function process_entry( $errors = '', $ajax = false ) {
$form_id = FrmAppHelper::get_post_param( 'form_id', '', 'absint' );
if ( FrmAppHelper::is_admin() || empty( $_POST ) || empty( $form_id ) || ! isset( $_POST['item_key'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
Expand Down Expand Up @@ -876,6 +910,11 @@ public static function show_entry_shortcode( $atts ) {
return $formatted_entry;
}

/**
* @param false|object $entry
*
* @return void
*/
public static function entry_sidebar( $entry = false ) {
$data = array();
$id = 0;
Expand Down
26 changes: 26 additions & 0 deletions classes/controllers/FrmFieldsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ public static function get_field_array_from_id( $field_id ) {
* @param array|int|object $field_object
* @param array $values
* @param int $form_id
*
* @return void
*/
public static function load_single_field( $field_object, $values, $form_id = 0 ) {
global $frm_vars;
Expand Down Expand Up @@ -506,6 +508,12 @@ public static function show_format_option( $field, $is_hidden = false ) {
include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/value-format.php';
}

/**
* @param array $field
* @param bool $echo
*
* @return string
*/
public static function input_html( $field, $echo = true ) {
$class = array();
self::add_input_classes( $field, $class );
Expand Down Expand Up @@ -767,6 +775,12 @@ private static function add_frmval_to_input( $field, &$add_html ) {
}
}

/**
* @param array $field
* @param array $add_html
*
* @return void
*/
private static function add_validation_messages( $field, array &$add_html ) {
$field_validation_messages_status = self::get_validation_data_attribute_visibility_info( $field );

Expand Down Expand Up @@ -999,6 +1013,13 @@ private static function add_pattern_attribute( $field, array &$add_html ) {
}
}

/**
* @param mixed $opt
* @param mixed $opt_key
* @param array|object $field
*
* @return mixed
*/
public static function check_value( $opt, $opt_key, $field ) {
if ( is_array( $opt ) ) {
if ( FrmField::is_option_true( $field, 'separate_value' ) ) {
Expand All @@ -1011,6 +1032,11 @@ public static function check_value( $opt, $opt_key, $field ) {
return $opt;
}

/**
* @param mixed $opt
*
* @return mixed
*/
public static function check_label( $opt ) {
if ( is_array( $opt ) ) {
$opt = $opt['label'] ?? reset( $opt );
Expand Down
36 changes: 36 additions & 0 deletions classes/controllers/FrmFormActionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,15 @@ private static function maybe_show_limit_warning( $form_id, $form_actions ) {
echo '</div>';
}

/**
* @param WP_Post $form_action
* @param object $form
* @param int $action_key Action ID.
* @param FrmFormAction $action_control
* @param array $values
*
* @return void
*/
public static function action_control( $form_action, $form, $action_key, $action_control, $values ) {
$action_control->_set( $action_key );

Expand Down Expand Up @@ -563,6 +572,11 @@ public static function update_settings( $form_id ) {
FrmOnSubmitHelper::save_on_submit_settings( $form_id );
}

/**
* @param array $old_actions
*
* @return void
*/
public static function delete_missing_actions( $old_actions ) {
if ( ! empty( $old_actions ) ) {
foreach ( $old_actions as $old_id ) {
Expand Down Expand Up @@ -706,6 +720,13 @@ public static function trigger_actions( $event, $form, $entry, $type = 'all', $a
}//end if
}

/**
* @param int|string $form_id
* @param array $values
* @param array $args
*
* @return void
*/
public static function duplicate_form_actions( $form_id, $values, $args = array() ) {
if ( empty( $args['old_id'] ) ) {
// Continue if we know which actions to copy.
Expand All @@ -723,6 +744,11 @@ public static function duplicate_form_actions( $form_id, $values, $args = array(
}
}

/**
* @param string $where
*
* @return string
*/
public static function limit_by_type( $where ) {
global $frm_vars, $wpdb;

Expand Down Expand Up @@ -759,10 +785,20 @@ public function __construct() {
add_action( 'frm_form_actions_init', array( $this, '_register_actions' ), 100 );
}

/**
* @param string $action_class
*
* @return void
*/
public function register( $action_class ) {
$this->actions[ $action_class ] = new $action_class();
}

/**
* @param string $action_class
*
* @return void
*/
public function unregister( $action_class ) {
if ( isset( $this->actions[ $action_class ] ) ) {
unset( $this->actions[ $action_class ] );
Expand Down
2 changes: 2 additions & 0 deletions classes/controllers/FrmFormTemplatesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ class FrmFormTemplatesController {
* Initialize hooks for template page only.
*
* @since 6.7
*
* @return void
*/
public static function load_admin_hooks() {
self::init_template_resources();
Expand Down
Loading
Loading