diff --git a/classes/LBRY_Network.php b/classes/LBRY_Network.php index e571557..6caf40a 100644 --- a/classes/LBRY_Network.php +++ b/classes/LBRY_Network.php @@ -7,10 +7,66 @@ class LBRY_Network { + + /** + * The Publishing Object + * @var LBRY_Network_Publisher + */ + public $publisher = null; + + /** + * The Parsing Object + * @var LBRY_Network_Parser + */ + public $parser = null; + /** * [__construct description] */ public function __construct() { + $this->publisher = new LBRY_Network_Publisher(); + $this->parser = new LBRY_Network_Parser(); + + $this->post_meta_setup(); + } + + /** + * Sets up everything for the post meta boxes + */ + private function post_meta_setup() + { + // Add the meta boxes + add_action('add_meta_boxes', array($this, 'add_meta_boxes')); + + // Save the post meta on 'save_post' hook + add_action('save_post', array($this, 'save_post_meta')); + } + + /** + * Adds the meta boxes to the post editing backend + */ + public function add_meta_boxes() + { + add_meta_box( + 'lbry-network-publishing', // Unique ID + 'LBRY Network', // Title + array($this, 'meta_box_html'), // Callback function + 'post', // Screen Options (or post type) + 'side', // Context + 'high' // Priority + ); + } + + /** + * Handles saving the post meta that is relative to publishing to the LBRY Network + */ + public function save_post_meta() + { + } + + public function meta_box_html() + { + require_once(LBRY_ABSPATH . 'templates/meta_box.php'); } } diff --git a/classes/lbrypress.php b/classes/lbrypress.php index b087fae..9043ef1 100644 --- a/classes/lbrypress.php +++ b/classes/lbrypress.php @@ -38,6 +38,11 @@ class LBRYPress */ public $notice = null; + /** + * The Library Network Object + */ + public $network = null; + /** * Main LBRYPress Instance. * @@ -123,7 +128,6 @@ class LBRYPress { $this->daemon = new LBRY_Daemon(); $this->speech = new LBRY_Speech(); - $this->notice = new LBRY_Admin_Notice(); } /** @@ -137,6 +141,8 @@ class LBRYPress // Admin request if (is_admin()) { $this->admin = new LBRY_Admin(); + $this->notice = new LBRY_Admin_Notice(); + $this->network = new LBRY_Network(); } else { $this->speech->maybe_rewrite_urls(); } diff --git a/templates/meta_box.php b/templates/meta_box.php new file mode 100644 index 0000000..0971faa --- /dev/null +++ b/templates/meta_box.php @@ -0,0 +1,23 @@ + 'Unattributed', + 'permanent_url' => 'unattributed' +); +$channels = LBRY()->daemon->channel_list(); +array_unshift($channels, $unnatributed); +?> +

Choose which channels you would like to publish this post to:

+