Skip to content

Commit

Permalink
[ #800 ] dashboard part II
Browse files Browse the repository at this point in the history
  • Loading branch information
TeoAlex committed Aug 3, 2023
1 parent 63b1bbd commit b64765f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion assets/css/admin/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ input#wpchill_dashboard_search:focus {
box-shadow: none;
}

.wpchill_dashboard_header_tabs {
.wpchill_dashboard_header_tabs:not(.nosearch) {
width: 70%;
}

Expand Down
Binary file added assets/images/dashboard/blog-default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 18 additions & 6 deletions includes/admin/class-modula-dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public function generate_tab_url( $slug ){
}
}


public function render_header(){

$active = 'general';
Expand All @@ -134,22 +135,27 @@ public function render_header(){

?>
<div id="wpchill_dashboard_header">
<div class="wpchill_dashboard_header_tabs">
<div class="wpchill_dashboard_header_tabs nosearch">

<?php foreach( $this->tabs as $slug => $tab ): ?>
<a href="<?php echo esc_url( $this->generate_tab_url( $slug ) ); ?>" class="wpchill_dashboard_header_tab wpchill_dashboard_header_tab_<?= $slug?> <?php echo ( ( $active === $slug )? 'tab_active' : '' ); ?>"> <?= $tab['name']; ?> </a>
<?php endforeach; ?>

</div>
<div class="wpchill_dashboard_header_search">
<input type="text" name="search" class="wpchill_dashboard_search" id="wpchill_dashboard_search" placeholder="<?php esc_html_e( 'Search...', 'modula-best-grid-gallery' ); ?>" /><button class="wpchill_dashboard_search_btn"><span class="dashicons dashicons-search"></span></button>
</div>

<?php //$this->_render_search_bar(); ?>
</div>
<?php

}

public function _render_search_bar(){
?>
<div class="wpchill_dashboard_header_search">
<input type="text" name="search" class="wpchill_dashboard_search" id="wpchill_dashboard_search" placeholder="<?php esc_html_e( 'Search...', 'modula-best-grid-gallery' ); ?>" /><button class="wpchill_dashboard_search_btn"><span class="dashicons dashicons-search"></span></button>
</div>
<?php
}

public function render_content(){

Expand Down Expand Up @@ -324,7 +330,7 @@ public function _render_rss_feed(){
include_once( ABSPATH . WPINC . '/feed.php' );

// Get a SimplePie feed object from the specified feed source.
$rss = fetch_feed( 'https://dev.tamewp.com/feed/' );
$rss = fetch_feed( 'https://wp-modula.com/feed/' );

if ( ! is_wp_error( $rss ) ) {
$maxitems = $rss->get_item_quantity( 2 );
Expand All @@ -340,6 +346,10 @@ public function _render_rss_feed(){
$end = strpos( $img, '||feed_img_end||' ) ;
$img = substr( $img, $start, $end - $start );

if( false == strpos( $img , '||feed_img_start||') || false == strpos( $img, '||feed_img_end||' ) ){
$img = MODULA_URL .'assets/images/dashboard/blog-default.png';
}

?>
<div class="wpchill_dashboard_latest_item">
<img src="<?php echo esc_url( $img ); ?>" class="wpchill_dashboard_latest_item_img" />
Expand Down Expand Up @@ -392,6 +402,8 @@ public function render_partners() {
// Store the data for a week.
set_transient( 'modula_all_partners', $data, 7 * DAY_IN_SECONDS );
}

$addons = $data;
}

}else{
Expand Down Expand Up @@ -515,7 +527,7 @@ public function enqueue_scripts(){
public function get_dashboard_data(){

// Make the request
$request = wp_remote_get( 'https://dev.tamewp.com/common-use-cases.json' );
$request = wp_remote_get( 'https://wp-modula.com/common-use-cases.json' );

// If the remote request fails, wp_remote_get() will return a WP_Error, so let’s check if the $request variable is an error:
if( is_wp_error( $request ) ) {
Expand Down

0 comments on commit b64765f

Please sign in to comment.