diff --git a/_config.php b/_config.php index 4252eed..68f00bc 100644 --- a/_config.php +++ b/_config.php @@ -3,14 +3,24 @@ /** * Comments Default Configuration * - * To enable comments on your own {@link DataObject}'s then - * add the extension 'CommentsExtension' to your object + * To enable comments on your own {@link DataObject}'s you need to + * call Commenting::add_comments($object_name, $settings); + * + * Where $object_name is the name of the subclass of DataObject you want + * to add the comments to and $settings is a map of configuration options + * and values * * Example: mysite/_config.php * * - * Object::add_extension('Page', 'CommentsExtension'); + * // uses the default values + * Commenting::add('SiteTree'); + * + * // set configuration + * Commenting::add('SiteTree', array( + * 'require_login' => true + * )); * */ -Object::add_extension('Page', 'CommentsExtension'); \ No newline at end of file +Commenting::add('Page'); \ No newline at end of file diff --git a/code/Commenting.php b/code/Commenting.php new file mode 100644 index 0000000..7d8a981 --- /dev/null +++ b/code/Commenting.php @@ -0,0 +1,61 @@ + false, // boolean, whether a user needs to login + 'required_permission' => '', // required permission to comment (or array of permissions) + 'use_ajax_commenting' => true, // use ajax to post comments. + 'show_comments_when_disabled' => false, // when comments are disabled should we show older comments (if available) + 'order_comments_by' => "\"Created\" DESC" + ); + + + public function add($class, $settings) { + + } + + public function remove($class) { + + } + + public function set_config($class, $configuration) { + + } + + public function set_config_value($class, $key, $value = false) { + + } + + public function get_config($class) { + + } + + public function get_config_value($class, $key) { + + } + + public function config_value_equals($class, $key, $value) { + + } +} \ No newline at end of file