mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@72801 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
9b3b147475
commit
550931c02a
@ -424,7 +424,7 @@ JS;
|
||||
*/
|
||||
public function SiteTreeAsUL() {
|
||||
$obj = singleton('Folder');
|
||||
$obj->setMarkingFilter('ClassName', 'Folder');
|
||||
$obj->setMarkingFilter('ClassName', ClassInfo::subclassesFor('Folder'));
|
||||
$obj->markPartialTree();
|
||||
|
||||
if($p = $this->currentPage()) $obj->markToExpose($p);
|
||||
@ -454,7 +454,7 @@ JS;
|
||||
*/
|
||||
public function getsubtree() {
|
||||
$obj = DataObject::get_by_id('Folder', $_REQUEST['ID']);
|
||||
$obj->setMarkingFilter('ClassName', 'Folder');
|
||||
$obj->setMarkingFilter('ClassName', ClassInfo::subclassesFor('Folder'));
|
||||
$obj->markPartialTree();
|
||||
|
||||
$results = $obj->getChildrenAsUL(
|
||||
|
@ -181,7 +181,7 @@ class LeftAndMain extends Controller {
|
||||
Requirements::javascript(THIRDPARTY_DIR . '/loader.js');
|
||||
Requirements::javascript(THIRDPARTY_DIR . '/hover.js');
|
||||
Requirements::javascript(THIRDPARTY_DIR . '/layout_helpers.js');
|
||||
Requirements::javascript(SAPPHIRE_DIR . "/javascript/i18n.js");
|
||||
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
|
||||
|
||||
Requirements::javascript(THIRDPARTY_DIR . '/scriptaculous/effects.js');
|
||||
Requirements::javascript(THIRDPARTY_DIR . '/scriptaculous/dragdrop.js');
|
||||
@ -983,7 +983,7 @@ JS;
|
||||
* @param String $name The application name
|
||||
* @param String $logoText The logo text
|
||||
*/
|
||||
static $application_link = "http://www.silverstripe.com/";
|
||||
static $application_link = "http://www.silverstripe.org/";
|
||||
static function setApplicationName($name, $logoText = null, $link = null) {
|
||||
self::$application_name = $name;
|
||||
self::$application_logo_text = $logoText ? $logoText : $name;
|
||||
@ -1116,4 +1116,4 @@ JS;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@ -283,7 +283,12 @@ class MemberTableField extends ComplexTableField {
|
||||
function AddRecordForm() {
|
||||
$fields = new FieldSet();
|
||||
foreach($this->FieldList() as $fieldName => $fieldTitle) {
|
||||
$fields->push(new TextField($fieldName));
|
||||
// If we're adding the set password field, we want to hide the text from any peeping eyes
|
||||
if($fieldName == 'SetPassword') {
|
||||
$fields->push(new PasswordField($fieldName));
|
||||
} else {
|
||||
$fields->push(new TextField($fieldName));
|
||||
}
|
||||
}
|
||||
$fields->push(new HiddenField('ctf[ID]', null, $this->group->ID));
|
||||
|
||||
|
@ -34,6 +34,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
||||
Requirements::javascript(THIRDPARTY_DIR . "/scriptaculous/controls.js");
|
||||
|
||||
// needed for MemberTableField (Requirements not determined before Ajax-Call)
|
||||
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
|
||||
Requirements::javascript(SAPPHIRE_DIR . "/javascript/TableListField.js");
|
||||
Requirements::javascript(SAPPHIRE_DIR . "/javascript/TableField.js");
|
||||
Requirements::javascript(SAPPHIRE_DIR . "/javascript/ComplexTableField.js");
|
||||
|
@ -17,19 +17,32 @@ class PageCommentInterface extends RequestHandler {
|
||||
protected $controller, $methodName, $page;
|
||||
|
||||
/**
|
||||
* @var boolean If this is true, you must be logged in to post a comment
|
||||
* If this is true, you must be logged in to post a comment
|
||||
* (and therefore, you don't need to specify a 'Your name' field unless
|
||||
* your name is blank)
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
static $comments_require_login = false;
|
||||
|
||||
/**
|
||||
* @var string If this is a valid permission code, you must be logged in
|
||||
* If this is a valid permission code, you must be logged in
|
||||
* and have the appropriate permission code on your account before you can
|
||||
* post a comment.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $comments_require_permission = "";
|
||||
|
||||
/**
|
||||
* If this is true it will include the javascript for AJAX
|
||||
* commenting. If it is set to false then it will not load
|
||||
* the files required and it will fall back
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
static $use_ajax_commenting = true;
|
||||
|
||||
/**
|
||||
* Create a new page comment interface
|
||||
* @param controller The controller that the interface is used on
|
||||
@ -62,6 +75,14 @@ class PageCommentInterface extends RequestHandler {
|
||||
self::$comments_require_permission = $permission;
|
||||
}
|
||||
|
||||
/**
|
||||
* See {@link PageCommentInterface::$use_ajax_commenting}
|
||||
* @param bool
|
||||
*/
|
||||
static function set_use_ajax_commenting($state) {
|
||||
self::$use_ajax_commenting = $state;
|
||||
}
|
||||
|
||||
function forTemplate() {
|
||||
return $this->renderWith('PageCommentInterface');
|
||||
}
|
||||
@ -87,9 +108,11 @@ class PageCommentInterface extends RequestHandler {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return boolean true if this page comment form requires users to have a
|
||||
* if this page comment form requires users to have a
|
||||
* valid permission code in order to post (used to customize the error
|
||||
* message).
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function PostingRequiresPermission() {
|
||||
return self::$comments_require_permission;
|
||||
@ -100,12 +123,6 @@ class PageCommentInterface extends RequestHandler {
|
||||
}
|
||||
|
||||
function PostCommentForm() {
|
||||
Requirements::javascript(THIRDPARTY_DIR . '/behaviour.js');
|
||||
Requirements::javascript(THIRDPARTY_DIR . '/prototype.js');
|
||||
Requirements::javascript(THIRDPARTY_DIR . '/scriptaculous/effects.js');
|
||||
Requirements::javascript(CMS_DIR . '/javascript/PageCommentInterface.js');
|
||||
|
||||
|
||||
$fields = new FieldSet(
|
||||
new HiddenField("ParentID", "ParentID", $this->page->ID)
|
||||
);
|
||||
@ -135,6 +152,28 @@ class PageCommentInterface extends RequestHandler {
|
||||
new FormAction("postcomment", _t('PageCommentInterface.POST', 'Post'))
|
||||
));
|
||||
|
||||
// Optional Spam Protection.
|
||||
if(class_exists('SpamProtecterManager')) {
|
||||
// Update the form to add the protecter field to it
|
||||
$protecter = SpamProtecterManager::update_form($form);
|
||||
if($protecter) {
|
||||
$protecter->setFieldMapping('Name', 'Comment');
|
||||
|
||||
// Because most of the Spam Protection will need to query another service
|
||||
// disable ajax commenting
|
||||
self::set_use_ajax_commenting(false);
|
||||
}
|
||||
}
|
||||
|
||||
// Shall We use AJAX?
|
||||
if(self::$use_ajax_commenting) {
|
||||
Requirements::javascript(THIRDPARTY_DIR . '/behaviour.js');
|
||||
Requirements::javascript(THIRDPARTY_DIR . '/prototype.js');
|
||||
Requirements::javascript(THIRDPARTY_DIR . '/scriptaculous/effects.js');
|
||||
Requirements::javascript(CMS_DIR . '/javascript/PageCommentInterface.js');
|
||||
}
|
||||
|
||||
// Load the data from Session
|
||||
$form->loadDataFrom(array(
|
||||
"Name" => Cookie::get("PageCommentInterface_Name"),
|
||||
"Comment" => Cookie::get("PageCommentInterface_Comment"),
|
||||
|
@ -534,9 +534,10 @@ iframe {
|
||||
}
|
||||
#contentPanel .thumbnailstrip {
|
||||
border: none;
|
||||
width: 180px;
|
||||
width: 190px;
|
||||
height: 120px;
|
||||
overflow-y: auto;
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
|
||||
#Caption {
|
||||
|
Loading…
Reference in New Issue
Block a user