settings_factory = $settings_factory; $this->unlock_button_ui = $unlock_button_ui; $this->query_factory = $query_factory; $this->custom_field_options = array( WPML_IGNORE_CUSTOM_FIELD => __( "Don't translate", 'wpml-translation-management' ), WPML_COPY_CUSTOM_FIELD => __( 'Copy from original to translation', 'wpml-translation-management' ), WPML_COPY_ONCE_CUSTOM_FIELD => __( 'Copy once', 'wpml-translation-management' ), WPML_TRANSLATE_CUSTOM_FIELD => __( 'Translate', 'wpml-translation-management' ), ); } /** * This will fetch the data from DB * depending on the user inputs (pagination/search) * * @param array $args */ public function init_data( array $args = array() ) { if ( null === $this->custom_fields_keys ) { $args = array_merge( array( 'hide_system_fields' => ! $this->settings_factory->show_system_fields, 'items_per_page' => self::ITEMS_PER_PAGE, 'page' => 1, ), $args ); $this->custom_fields_keys = $this->get_query()->get( $args ); $this->total_keys = $this->get_query()->get_total_rows(); if ( $this->custom_fields_keys ) { natcasesort( $this->custom_fields_keys ); } } } /** * @return string */ public function render() { ob_start(); ?>

get_title() ); ?>

htmlspecialchars( add_query_arg( array( 'show_system_fields' => ! $this->settings_factory->show_system_fields, ), admin_url( 'admin.php?page=' . WPML_TM_FOLDER . WPML_Translation_Management::PAGE_SLUG_SETTINGS ) . '#ml-content-setup-sec-' . $this->kind_shorthand() ) ), 'text' => $this->settings_factory->show_system_fields ? __( 'Hide system fields', 'wpml-translation-management' ) : __( 'Show system fields', 'wpml-translation-management' ), ); ?>

kind_shorthand() . '_translation_nonce', '_icl_nonce' ); ?> custom_fields_keys ) ) { ?>

get_no_data_message() ); ?>

render_heading(); ?>
render_body(); ?>
render_pagination( self::ITEMS_PER_PAGE, 1 ); ?>

checked />
render_search(); ?>
get_column_header( 'name' ) ); ?>
create( $search_string )->render(); } /** * Render body of Custom Field Settings. */ public function render_body() { foreach ( $this->custom_fields_keys as $cf_key ) { $setting = $this->get_setting( $cf_key ); $status = $setting->status(); $html_disabled = $setting->is_read_only() && ! $setting->is_unlocked() ? 'disabled="disabled"' : ''; ?>
unlock_button_ui->render( $setting->is_read_only(), $setting->is_unlocked(), $this->get_radio_name( $cf_key ), $this->get_unlock_name( $cf_key ) ); echo esc_html( $cf_key ); ?>
custom_field_options as $ref_status => $title ) { ?>
render_radio( $cf_key, $html_disabled, $status, $ref_status ); ?>
create( $this->total_keys, $current_page )->render(); } abstract public function get_no_data_message(); abstract public function get_column_header( $id ); /** * @return WPML_Custom_Field_Setting_Query */ private function get_query() { if ( null === $this->query ) { $this->query = $this->query_factory->create( $this->get_meta_type() ); } return $this->query; } }