Check to see if use_ajax_commenting is set before including the ajax javascript

This commit is contained in:
Shea Dawson 2013-02-19 18:01:25 +11:00 committed by Will Rossiter
parent 6a0323415b
commit 967c6ed78d

View File

@ -97,9 +97,11 @@ class CommentsExtension extends DataExtension {
* @see docs/en/Extending * @see docs/en/Extending
*/ */
public function CommentsForm() { public function CommentsForm() {
Requirements::javascript(THIRDPARTY_DIR . '/jquery-validate/lib/jquery.form.js'); if (Commenting::has_commenting($this->owner->ClassName) && Commenting::get_config_value($this->owner->ClassName, 'use_ajax_commenting')) {
Requirements::javascript(THIRDPARTY_DIR . '/jquery-validate/jquery.validate.pack.js'); Requirements::javascript(THIRDPARTY_DIR . '/jquery-validate/lib/jquery.form.js');
Requirements::javascript('comments/javascript/CommentsInterface.js'); Requirements::javascript(THIRDPARTY_DIR . '/jquery-validate/jquery.validate.pack.js');
Requirements::javascript('comments/javascript/CommentsInterface.js');
}
$interface = new SSViewer('CommentsInterface'); $interface = new SSViewer('CommentsInterface');