-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdashboard.php
More file actions
49 lines (48 loc) · 1.26 KB
/
dashboard.php
File metadata and controls
49 lines (48 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
// Just a placeholder for now
require_once __DIR__ . '/vendor/autoload.php';
$doc_tabs = array();
foreach ( POS::$modules as $module ) {
$readme = $module->get_readme();
if ( $readme ) {
$doc_tabs[] = array(
'id' => $module->id,
'name' => $module->name,
'readme' => $readme,
);
}
}
$module_id = isset( $_GET['module'] ) ? sanitize_text_field( $_GET['module'] ) : 'notes';
$show_readme = '';
?>
<style>
#pos-app ul {
list-style: disc;
padding: 1rem;
}
#pos-app img {
margin: 1rem auto;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
max-width: 90%;
height: auto;
border-radius: 8px;
}
</style>
<div id="pos-app"><h1>PersonalOS</h1>
<p>PersonalOS is a personal operating system for managing your life, all based on WordPress.</p>
<p>PersonalOS provides the following modules:</p>
<h2 class="nav-tab-wrapper">
<?php
foreach ( $doc_tabs as $tab ) {
$active = $tab['id'] === $module_id;
echo '<a class="nav-tab ' . ( $active ? 'nav-tab-active' : '' ) . '" href="?page=personalos-settings&module=' . esc_attr( $tab['id'] ) . '">' . esc_html( $tab['name'] ) . '</a>';
if ( $active ) {
$show_readme = Parsedown::instance()->text( $tab['readme'] );
}
}
?>
</h2>
<div class="tabs-content">
<?php echo wp_kses_post( $show_readme ); ?>
</div>
</div>