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(); ?>
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' ), ); ?>