-
Notifications
You must be signed in to change notification settings - Fork 36
/
comment_add.ctp
79 lines (75 loc) · 2.3 KB
/
comment_add.ctp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
/**
* Comment Template.
*
* @todo -c Implement .this needs to be sorted out.
*
* Copyright (c) 2009 Carl Sutton ( dogmatic69 )
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright (c) 2009 Carl Sutton ( dogmatic69 )
* @link http://infinitas-cms.org
* @package sort
* @subpackage sort.comments
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @since 0.5a
*/
?>
<div id="comment-box">
<?php
/**
* fields allowed in the comments
*/
$commentFields = explode(',',Configure::read('Comment.fields'));
$action = ( isset( $action ) ) ? $action : 'comment';
$modelName = ( isset( $modelName ) ) ? $modelName : Inflector::singularize( $this->name );
if ( isset( $urlParams ) )
{
echo $this->Form->create(
$modelName,
array(
'url' => array(
'plugin' => $this->params['plugin'],
'controller' => $this->params['controller'],
'action' => $action,
$urlParams
)
)
);
}
else
{
echo $this->Form->create(
$modelName,
array(
'url' => array(
'plugin' => $this->params['plugin'],
'controller' => $this->params['controller'],
'action' => $action
)
)
);
}
?>
<fieldset>
<legend><?php __( "Post a {$commentModel}" );?></legend>
<?php
echo $this->Form->input( "$modelName.id", array( 'value' => $fk ) );
foreach( $commentFields as $field )
{
if ( $field != 'comment' )
{
echo $this->Form->input( 'Comment.'.$field );
}
else
{
echo $this->Blog->wysiwyg( 'Comment.comment', array('toolbar' => 'Basic') );
}
}
?>
</fieldset>
<?php echo $this->Form->end('Submit'); ?>
</div>