Skip to content

Commit

Permalink
Framework for meta boxes on Welcome page.
Browse files Browse the repository at this point in the history
See #1181.
  • Loading branch information
boonebgorges committed Mar 4, 2024
1 parent 15a3c02 commit ca324f1
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 1 deletion.
56 changes: 55 additions & 1 deletion Core/Admin/Menu.php
Expand Up @@ -61,6 +61,10 @@ public function action_hooks() {
'hook' => 'admin_init',
'method' => 'pf_options_admin_page_save',
),
[
'hook' => 'admin_init',
'method' => 'register_welcome_meta_boxes',
],
);
}

Expand Down Expand Up @@ -155,9 +159,59 @@ public function state_pf_admin_pages( $thepages ) {
* @return void
*/
public function display_welcome_page() {
echo 'Test content';
pressforward( 'admin.templates' )->the_view_for( 'welcome' );
}

/**
* Registers meta boxes for the welcome page.
*
* @since 5.7.0
*
* @return void
*/
public function register_welcome_meta_boxes() {
add_meta_box(
'pf-welcome-getting-started',
__( 'Getting Started', 'pressforward' ),
[ $this, 'display_getting_started_meta_box' ],
'toplevel_page_pf-menu',
'normal',
'high'
);

add_meta_box(
'pf-welcome-curation',
__( 'Content Awaiting Review', 'pressforward' ),
[ $this, 'display_curation_meta_box' ],
'toplevel_page_pf-menu',
'normal',
'high'
);
}

/**
* Display function for the Getting Started meta box.
*
* @since 5.7.0
*
* @return void
*/
public function display_getting_started_meta_box() {
echo 'Getting started';
}

/**
* Display function for the Curation meta box.
*
* @since 5.7.0
*
* @return void
*/
public function display_curation_meta_box() {
echo 'Curation';
}


/**
* Save routine for the PF options page.
*/
Expand Down
11 changes: 11 additions & 0 deletions assets/css/pf-settings.css
Expand Up @@ -65,3 +65,14 @@
font-weight: 700;
}

.pf-welcome h1.title {
background-image: url(../images/icon.png);
background-position: top 10px left 0;
background-repeat: no-repeat;
background-size: 64px 64px;
font-size: 36px;
height: 64px;
line-height: 64px;
padding-left: 80px;
}

Binary file added assets/images/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions parts/welcome.tpl.php
@@ -0,0 +1,52 @@
<?php
/**
* 'All Content' admin panel.
*
* @package PressForward
*
* @since 5.7.0
*/

/*
phpcs:disable
Content notes:
- Welcome/orientation message
- Link to documentation
- "New to Pressforward?" link to documentation
- Quick links:
- Curation: All Content, Nominated
- Admin: Add new feeds, view feeds, settings
- User: User-specific settings
- At-a-glance
- Total new? How to keep track? Maybe "past day" or "past week".
phpcs:enable
*/

?>

<div class="wrap pf-welcome">
<h1 class="title"><?php esc_html_e( 'Welcome to PressForward', 'pressforward' ); ?></h1>

<p class="pf-version">
<?php
printf(
/* translators: %s: PressForward version number */
esc_html__( 'Version %s', 'pressforward' ),
esc_html( PF_VERSION )

)
?>
</p>

<p><?php esc_html_e( 'PressForward is a free plugin that provides an editorial workflow for content aggregation and curation within the WordPress dashboard. It is designed for bloggers and editorial teams who wish to collect, discuss, and share content from a variety of sources on the open web.', 'pressforward' ); ?></p>

<div id="pf-welcome-dashboard-widgets" class="metabox-holder">
<?php do_meta_boxes( 'toplevel_page_pf-menu', 'normal', null ); ?>
</div>

<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
<?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
</div>

0 comments on commit ca324f1

Please sign in to comment.