Permalink
Browse files

updated repo

  • Loading branch information...
1 parent eb0e8ac commit 0b4f0dffe1884882a4d9ee2853443db39ddf86d9 @risico committed Dec 13, 2011
Showing with 86 additions and 6 deletions.
  1. +24 −6 etherpad.php
  2. +1 −0 includes/admin_page.php
  3. +58 −0 includes/core.php
  4. +3 −0 includes/install.php
View
30 etherpad.php
@@ -13,36 +13,54 @@
// instantiante the etherpad client
// TODO: will need to make this available for change inside the settings panel
$instance = new EtherpadLiteClient('EtherpadFTW,http://beta.etherpad.org/api');
+$etherpad = new Etherpad;
+
+
+######################################
+################## ACTIONS HOOKS
+######################################
/**
* Applied to the HTML DIV created to house the rich text editor, prior to printing it on the screen. Filter function argument/return value is a string.
*/
-/* add_action('the_editor', 'etherpad_editor'); */
+add_action('the_editor', 'etherpad_editor');
/**
* Applied to post content before putting it into a rich editor window.
*/
add_action('the_editor_content', 'etherpad_editor_content');
+add_action('admin_menu', 'etherpad_register_admin_page');
+
/**
* Runs just before the "advanced" section of the post editing form in the admin menus.
*/
#add_action('edit_form_advanced', 'etherpad_edit_form_advanced');
function etherpad_editor($editor){
- #echo "<iframe src='http://beta.etherpad.org/p/123123312?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=100% height=400>";
- echo $editor;
+ echo "<iframe src='http://beta.etherpad.org/p/123123312?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=100% height=400>";
}
function etherpad_editor_content($content){
-
-
- #echo $content . "content be here";
}
function etherpad_edit_form_advanced($content){
echo $content;
}
+
+/**
+ * Adds the etherpad under the Settings in WPAdmin
+ */
+
+
+function etherpad_register_admin_page() {
+ add_submenu_page( 'options-general.php', 'Etherpad', 'Etherpad Settings', 'manage_options', 'my-custom-submenu-page', 'etherpad_admin_page' );
+}
+
+function etherpad_admin_page() {
+ include 'includes/admin_page.php';
+}
+
?>
View
1 includes/admin_page.php
@@ -0,0 +1 @@
+hello there
View
58 includes/core.php
@@ -9,5 +9,63 @@
*/
require 'etherpad-lite-client.php';
+class Etherpad{
+
+ public $action; # edit, new
+ public $post; # if editing new post, will hold the id here
+
+ function __construct(){
+ $this->set_action();
+ $this->set_post();
+ }
+
+
+ /**
+ * Will return the link in the form of { http://podservice.tld/p/{:pod_iod}?query }
+ *
+ * @return (string)
+ */
+ public function construct_link(){}
+ public function link(){}
+
+ /**
+ * get_action
+ *
+ * @return (string)
+ */
+ public function get_action(){
+ return $this->action;
+ }
+
+ /**
+ * get_post
+ *
+ * Will return the post id if the current action is edit
+ * @return (post_id)
+ */
+ public function get_post(){}
+
+ /**
+ * set_action
+ *
+ * @param (string) (url) - in the form of (/path/to/wordpress)?action=edit&post=3
+ * @return nothing
+ */
+ private function set_action(){
+ $this->action = isset($_GET['action']) ? $_GET['action'] : false;
+ }
+
+ /**
+ * set_post
+ *
+ * Will set the current post id if action == edit
+ *
+ * @param (int) (post_id) - the current font id
+ */
+ private function set_post(){
+ $this->post = (isset($_GET['post']) ? $_GET['post'] : false );
+ }
+
+}
?>
View
3 includes/install.php
@@ -0,0 +1,3 @@
+<?php
+
+?>

0 comments on commit 0b4f0df

Please sign in to comment.