mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
ENHANCEMENT: Allow, via extension configuration, the addition of Twitter handle for comments
This commit is contained in:
parent
2a20037e49
commit
a88fc21cde
8
extensions/CommentTwitterUsernameExtension.php
Normal file
8
extensions/CommentTwitterUsernameExtension.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
class CommentTwitterUsernameExtension extends DataExtension {
|
||||
// maximum length of a twitter usnername is 15 chars
|
||||
private static $db = array('TwitterUsername'=>'Varchar(16)');
|
||||
|
||||
|
||||
}
|
11
extensions/CommentingControllerTwitterUsernameExtension.php
Normal file
11
extensions/CommentingControllerTwitterUsernameExtension.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
class CommentingControllerTwitterUsernameExtension extends DataExtension {
|
||||
|
||||
public function alterCommentForm(&$form) {
|
||||
$fields = $form->Fields();
|
||||
|
||||
// FIXME order
|
||||
$fields->insertBefore($tf = new TextField('TwitterUsername','Twitter Username'), 'Comment');
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user