diff --git a/functions.php b/functions.php
index 718443e..f9558cc 100644
--- a/functions.php
+++ b/functions.php
@@ -6,6 +6,10 @@
$sanders_includes = array(
'lib/init.php',
'lib/assets.php',
+ 'lib/admin/messages/init.php',
+ 'lib/admin/messages/service.php',
+ 'lib/admin/messages/table.php',
+ 'lib/admin/messages/model.php',
'lib/services/news/remote_news_feed.php',
'lib/services/news/news_feed.php',
'lib/services/events/remote_events.php',
diff --git a/lib/admin/messages/init.php b/lib/admin/messages/init.php
new file mode 100644
index 0000000..f143a65
--- /dev/null
+++ b/lib/admin/messages/init.php
@@ -0,0 +1,15 @@
+$val) {
+ $this->$key = $val;
+ }
+ }
+
+ public function getDate() {
+ return date('F d, Y h:ia', $this->date);
+ }
+
+ public function getBody() {
+ return apply_filters('the_content', $this->body);
+ }
+}
diff --git a/lib/admin/messages/service.php b/lib/admin/messages/service.php
new file mode 100644
index 0000000..2fa1c23
--- /dev/null
+++ b/lib/admin/messages/service.php
@@ -0,0 +1,27 @@
+mocks[0] = new MessageModel(array('id' => 1, 'title' => 'A new message', 'body' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum posuere iaculis consequat. Donec eget metus in urna egestas tempor. Maecenas suscipit ullamcorper ipsum sit amet egestas. Suspendisse malesuada magna sit amet lorem imperdiet accumsan. Pellentesque ornare iaculis interdum. Nam varius malesuada ipsum vitae convallis. Quisque luctus ligula dui, nec fermentum eros tincidunt ac. Fusce non imperdiet nisi, a venenatis turpis. Aenean a convallis lacus. Nam at turpis eget mi sodales imperdiet. Proin eleifend justo vel lectus fermentum volutpat. Maecenas ullamcorper posuere risus vel bibendum. Vestibulum sagittis hendrerit tincidunt.', 'read' => false, 'date' => time(), 'from' => array('name' => 'Atticus White', 'email' => 'contact@atticuswhite.com')));
+ $this->mocks[1] = new MessageModel(array('id' => 2, 'title' => 'Another meessage', 'body' => 'This is just another one', 'read' => true, 'date' => time(), 'from' => array('name' => 'Atticus White', 'email' => 'contact@atticuswhite.com')));
+ }
+
+ public function getMessages() {
+ return $this->mocks;
+ }
+
+ public function getMessage($id) {
+ foreach ($this->mocks as $mock) {
+ if ($mock->id == $id) {
+ return $mock;
+ }
+ }
+ return null;
+ }
+}
diff --git a/lib/admin/messages/table.php b/lib/admin/messages/table.php
new file mode 100644
index 0000000..a448d99
--- /dev/null
+++ b/lib/admin/messages/table.php
@@ -0,0 +1,85 @@
+ 'Message',
+ 'plural' => 'Messages',
+ 'ajax' => false
+ ));
+ $this->service = new MessageService();
+ }
+
+ public function get_columns() {
+ return array(
+ 'cb' => '',
+ 'message_title' => 'Title',
+ 'message_from' => 'From',
+ 'message_date' => 'Date'
+ );
+ }
+
+ public function get_views() {
+ return array(
+ 'all' => 'All',
+ 'trash' => 'Trash'
+ );
+ }
+
+ public function column_cb($item) {
+ return "id}\" />";
+ }
+
+ public function column_message_title($item) {
+ if (!$item->read) {
+ $title = "{$item->title}";
+ } else {
+ $title = $item->title;
+ }
+
+ $actions = array(
+ 'view' => "id}\">View"
+ );
+ return $title . $this->row_actions($actions, false);
+ }
+
+ public function column_message_from($item) {
+ $name = $item->from['name'];
+ $email = "from['email']}\">{$item->from['email']}";
+ return $name . "
" . $email;
+ }
+
+ public function column_message_date($item) {
+ return $item->getDate();
+ }
+
+ public function get_sortable_columns() {
+ return array(
+ 'message_title' => array('message_title', false)
+ );
+ }
+
+ public function get_bulk_actions() {
+ return array(
+ 'delete' => 'Delete'
+ );
+ }
+
+ public function prepare_items() {
+ $this->_column_headers = array($this->get_columns(), array(), array());
+ $this->items = $this->service->getMessages();
+ $this->set_pagination_args(array(
+ 'total_items' => count($this->items),
+ 'per_page' => 10
+ ));
+ }
+}
diff --git a/lib/admin/messages/views/message.php b/lib/admin/messages/views/message.php
new file mode 100644
index 0000000..744e7b5
--- /dev/null
+++ b/lib/admin/messages/views/message.php
@@ -0,0 +1,59 @@
+getMessage($_REQUEST['post']);
+?>
+
+