diff --git a/includes/admin/assets/css/um-admin-settings.css b/includes/admin/assets/css/um-admin-settings.css index 0f8d78df..1e159673 100644 --- a/includes/admin/assets/css/um-admin-settings.css +++ b/includes/admin/assets/css/um-admin-settings.css @@ -46,6 +46,20 @@ text-align: center; } +.column-core_version { + width: 100px; + text-align: center; +} + +.column-theme_version { + width: 100px; + text-align: center; +} + +.column-status { + width: 260px; +} + th.column-email.column-primary { padding-left: 48px; } @@ -243,4 +257,4 @@ th.column-email.column-primary { .um_setting_ajax_button_response.complete { color:darkgreen; font-style: italic; -} \ No newline at end of file +} diff --git a/includes/admin/core/class-admin-settings.php b/includes/admin/core/class-admin-settings.php index c448377c..441bdbcd 100644 --- a/includes/admin/core/class-admin-settings.php +++ b/includes/admin/core/class-admin-settings.php @@ -3020,14 +3020,23 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { public function settings_override_templates_tab( $html, $section_fields ) { + ?> +
+ + + +
+ scan_template_files( um_path . '/templates/' ); foreach ( $scan_files as $key => $file ) { if ( ! str_contains( $file, 'email/' ) ) { - $located = apply_filters( 'um_located_template', $file, get_stylesheet_directory() . '/ultimate-member/' ); - if ( file_exists( $located ) ) { - $theme_file = $located; - } elseif ( file_exists( get_stylesheet_directory() . '/ultimate-member/templates/' . $file ) ) { + if ( file_exists( get_stylesheet_directory() . '/ultimate-member/templates/' . $file ) ) { $theme_file = get_stylesheet_directory() . '/ultimate-member/templates/' . $file; } else { $theme_file = false; @@ -3060,17 +3069,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { } } - ob_start(); - ?> -- - - -
- __( 'item', 'ultimate-member' ), + 'plural' => __( 'items', 'ultimate-member' ), + 'ajax' => false, + ) + ); + + $this->no_items_message = $args['plural'] . ' ' . __( 'not found.', 'ultimate-member' ); + + parent::__construct( $args ); + } + + + /** + * @param callable $name + * @param array $arguments + * + * @return mixed + */ + public function __call( $name, $arguments ) { + return call_user_func_array( array( $this, $name ), $arguments ); + } + + + /** + * + */ + public function prepare_items() { + $columns = $this->get_columns(); + $hidden = array(); + $sortable = $this->get_sortable_columns(); + $this->_column_headers = array( $columns, $hidden, $sortable ); + } + + + /** + * @param object $item + * @param string $column_name + * + * @return string + */ + public function column_default( $item, $column_name ) { + if ( isset( $item[ $column_name ] ) ) { + return $item[ $column_name ]; + } else { + return ''; + } + } + + + /** + * + */ + public function no_items() { + echo $this->no_items_message; + } + + + /** + * @param array $args + * + * @return $this + */ + public function set_sortable_columns( $args = array() ) { + $return_args = array(); + foreach ( $args as $k=>$val ) { + if ( is_numeric( $k ) ) { + $return_args[ $val ] = array( $val, $val == $this->default_sorting_field ); + } elseif( is_string( $k ) ) { + $return_args[ $k ] = array( $val, $k == $this->default_sorting_field ); + } else { + continue; + } + } + $this->sortable_columns = $return_args; + return $this; + } + + + /** + * @return array + */ + public function get_sortable_columns() { + return $this->sortable_columns; + } + + + /** + * @param array $args + * + * @return $this + */ + public function set_columns( $args = array() ) { + if ( count( $this->bulk_actions ) ) { + $args = array_merge( array( 'cb' => '' ), $args ); + } + $this->columns = $args; + + return $this; + } + + + /** + * @return array + */ + public function get_columns() { + return $this->columns; + } + + + /** + * @param array $args + * + * @return $this + */ + public function set_actions( $args = array() ) { + $this->actions = $args; + return $this; + } + + + /** + * @return array + */ + public function get_actions() { + return $this->actions; + } + + + /** + * @param array $args + * + * @return $this + */ + public function set_bulk_actions( $args = array() ) { + $this->bulk_actions = $args; + return $this; + } + + + /** + * @return array + */ + public function get_bulk_actions() { + return $this->bulk_actions; + } + + + /** + * @param $item + * + * @return string + */ + public function column_template( $item ) { + $output = esc_html__( 'Core path - ', 'ultimate-member' ); + $output .= $item['core_file'] . '