mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@71264 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
5687e0a7f4
commit
3680bbea46
@ -108,34 +108,6 @@ class AssetTableField extends ComplexTableField {
|
|||||||
new LiteralField("ImageFull",
|
new LiteralField("ImageFull",
|
||||||
"<img id='thumbnailImage' src='{$thumbnail}?r=" . rand(1,100000) . "' alt='{$childData->Name}' />" )
|
"<img id='thumbnailImage' src='{$thumbnail}?r=" . rand(1,100000) . "' alt='{$childData->Name}' />" )
|
||||||
);
|
);
|
||||||
|
|
||||||
if(class_exists('GalleryFile')) {
|
|
||||||
$tab = $detailFormFields->findOrMakeTab("BottomRoot.GalleryOptions", _t('AssetTableField.GALLERYOPTIONS', 'Gallery Options'));
|
|
||||||
$tab->push(
|
|
||||||
new TextField( "Content", _t('AssetTableField.CAPTION', 'Caption') )
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (class_exists('GalleryFile')) {
|
|
||||||
$tab = $detailFormFields->findOrMakeTab("BottomRoot.GalleryOptions", _t('AssetTableField.GALLERYOPTIONS', 'Gallery Options'));
|
|
||||||
if( $childData->Extension == 'swf' ) {
|
|
||||||
$tab->push(
|
|
||||||
new TextField( "Content", _t('AssetTableField.CAPTION', 'Caption') ),
|
|
||||||
new TextField( 'PopupWidth', _t('AssetTableField.POPUPWIDTH', 'Popup Width') ),
|
|
||||||
new TextField( 'PopupHeight', _t('AssetTableField.POPUPHEIGHT', 'Popup Height') ),
|
|
||||||
new HeaderField( 'SWFFileOptionsHeader', _t('AssetTableField.SWFFILEOPTIONS', 'SWF File Options') ),
|
|
||||||
new CheckboxField( 'Embed', _t('AssetTableField.ISFLASH', 'Is A Flash Document') ),
|
|
||||||
new CheckboxField( 'LimitDimensions', _t('AssetTableField.DIMLIMT', 'Limit The Dimensions In The Popup Window') )
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$tab = $detailFormFields->findOrMakeTab("BottomRoot.GalleryOptions", _t('AssetTableField.GALLERYOPTIONS', 'Gallery Options'));
|
|
||||||
$tab->push(
|
|
||||||
new TextField( "Content", _t('AssetTableField.CAPTION', 'Caption') ),
|
|
||||||
new TextField( 'PopupWidth', _t('AssetTableField.POPUPWIDTH', 'Popup Width') ),
|
|
||||||
new TextField( 'PopupHeight', _t('AssetTableField.POPUPHEIGHT', 'Popup Height') )
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($childData && $childData->hasMethod('BackLinkTracking')) {
|
if($childData && $childData->hasMethod('BackLinkTracking')) {
|
||||||
|
@ -324,30 +324,9 @@ JS;
|
|||||||
* @return DataObjectSet
|
* @return DataObjectSet
|
||||||
*/
|
*/
|
||||||
public function PageTypes() {
|
public function PageTypes() {
|
||||||
$classes = ClassInfo::getValidSubClasses();
|
$classes = SiteTree::page_type_classes();
|
||||||
array_shift($classes);
|
|
||||||
$result = new DataObjectSet();
|
$result = new DataObjectSet();
|
||||||
$kill_ancestors = array();
|
|
||||||
|
|
||||||
// figure out if there are any classes we don't want to appear
|
|
||||||
foreach($classes as $class) {
|
|
||||||
$instance = singleton($class);
|
|
||||||
|
|
||||||
// do any of the progeny want to hide an ancestor?
|
|
||||||
if($ancestor_to_hide = $instance->stat('hide_ancestor')) {
|
|
||||||
// note for killing later
|
|
||||||
$kill_ancestors[] = $ancestor_to_hide;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If any of the descendents don't want any of the elders to show up, cruelly render the elders surplus to requirements.
|
|
||||||
if($kill_ancestors) {
|
|
||||||
foreach ($kill_ancestors as $mark) {
|
|
||||||
// unset from $classes
|
|
||||||
$idx = array_search($mark, $classes);
|
|
||||||
unset($classes[$idx]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($classes as $class) {
|
foreach($classes as $class) {
|
||||||
$instance = singleton($class);
|
$instance = singleton($class);
|
||||||
@ -642,7 +621,7 @@ JS;
|
|||||||
if(Director::is_ajax()) {
|
if(Director::is_ajax()) {
|
||||||
// need a valid ID value even if the record doesn't have one in the database
|
// need a valid ID value even if the record doesn't have one in the database
|
||||||
// (its still present in the live tables)
|
// (its still present in the live tables)
|
||||||
$liveRecord = Versioned::get_one_by_stage('SiteTree', 'Live', "\"SiteTree_Live\".\"ID\" = $recordID");
|
$liveRecord = Versioned::get_one_by_stage('SiteTree', 'Live', "SiteTree_Live.ID = $recordID");
|
||||||
// if the page has never been published to live, we need to act the same way as in deletefromlive()
|
// if the page has never been published to live, we need to act the same way as in deletefromlive()
|
||||||
if($liveRecord) {
|
if($liveRecord) {
|
||||||
// the form is readonly now, so we need to refresh the representation
|
// the form is readonly now, so we need to refresh the representation
|
||||||
@ -1177,8 +1156,7 @@ JS;
|
|||||||
|
|
||||||
return new Form($this, "AddPageOptionsForm", new FieldSet(
|
return new Form($this, "AddPageOptionsForm", new FieldSet(
|
||||||
new HiddenField("ParentID"),
|
new HiddenField("ParentID"),
|
||||||
new DropdownField("PageType", "", $pageTypes)
|
new DropdownField("PageType", "", $pageTypes, 'Page')
|
||||||
// "Page to copy" => new TreeDropdownField("DuplicateSection", "", "SiteTree"),
|
|
||||||
),
|
),
|
||||||
new FieldSet(
|
new FieldSet(
|
||||||
new FormAction("addpage", _t('CMSMain.GO',"Go"))
|
new FormAction("addpage", _t('CMSMain.GO',"Go"))
|
||||||
|
@ -33,9 +33,9 @@ class MemberTableField extends ComplexTableField {
|
|||||||
static $data_class = "Member";
|
static $data_class = "Member";
|
||||||
|
|
||||||
protected $permissions = array(
|
protected $permissions = array(
|
||||||
"add",
|
'add',
|
||||||
"edit",
|
'edit',
|
||||||
"delete"
|
'delete'
|
||||||
);
|
);
|
||||||
|
|
||||||
private static $addedPermissions = array();
|
private static $addedPermissions = array();
|
||||||
@ -44,32 +44,31 @@ class MemberTableField extends ComplexTableField {
|
|||||||
|
|
||||||
private static $addedCsvFields = array();
|
private static $addedCsvFields = array();
|
||||||
|
|
||||||
public static function addPermissions( $addingPermissionList ) {
|
public static function addPermissions($addingPermissionList) {
|
||||||
self::$addedPermissions = $addingPermissionList;
|
self::$addedPermissions = $addingPermissionList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function addMembershipFields( $addingFieldList, $addingCsvFieldList = null ) {
|
public static function addMembershipFields($addingFieldList, $addingCsvFieldList = null) {
|
||||||
self::$addedFields = $addingFieldList;
|
self::$addedFields = $addingFieldList;
|
||||||
$addingCsvFieldList == null ? self::$addedCsvFields = $addingFieldList : self::$addedCsvFields = $addingCsvFieldList;
|
$addingCsvFieldList == null ? self::$addedCsvFields = $addingFieldList : self::$addedCsvFields = $addingCsvFieldList;
|
||||||
}
|
}
|
||||||
|
|
||||||
function __construct($controller, $name, $group, $members = null, $hidePassword = true, $pageLimit = 10) {
|
function __construct($controller, $name, $group, $members = null, $hidePassword = true, $pageLimit = 10) {
|
||||||
|
|
||||||
if($group) {
|
if($group) {
|
||||||
if(is_object($group)) {
|
if(is_object($group)) {
|
||||||
$this->group = $group;
|
$this->group = $group;
|
||||||
} else if(is_numeric($group)){
|
} elseif(is_numeric($group)) {
|
||||||
$this->group = DataObject::get_by_id('Group',$group);
|
$this->group = DataObject::get_by_id('Group', $group);
|
||||||
}
|
}
|
||||||
} else if(is_numeric($_REQUEST['ctf'][$this->Name()]["ID"])) {
|
} else if(is_numeric($_REQUEST['ctf'][$this->Name()]["ID"])) {
|
||||||
$this->group = DataObject::get_by_id('Group',$_REQUEST['ctf'][$this->Name()]["ID"]);
|
$this->group = DataObject::get_by_id('Group', $_REQUEST['ctf'][$this->Name()]["ID"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sourceClass = $this->stat('data_class');
|
||||||
|
|
||||||
$sourceClass = $this->stat("data_class");
|
foreach(self::$addedPermissions as $permission) {
|
||||||
|
|
||||||
foreach( self::$addedPermissions as $permission )
|
|
||||||
array_push( $this->permissions, $permission );
|
array_push( $this->permissions, $permission );
|
||||||
|
}
|
||||||
|
|
||||||
$fieldList = array(
|
$fieldList = array(
|
||||||
"FirstName" => _t('MemberTableField.FIRSTNAME', 'Firstname'),
|
"FirstName" => _t('MemberTableField.FIRSTNAME', 'Firstname'),
|
||||||
@ -78,11 +77,11 @@ class MemberTableField extends ComplexTableField {
|
|||||||
);
|
);
|
||||||
|
|
||||||
$csvFieldList = $fieldList;
|
$csvFieldList = $fieldList;
|
||||||
foreach( self::$addedCsvFields as $key => $value ) {
|
foreach(self::$addedCsvFields as $key => $value) {
|
||||||
$csvFieldList[$key] = $value;
|
$csvFieldList[$key] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach( self::$addedFields as $key => $value ) {
|
foreach(self::$addedFields as $key => $value) {
|
||||||
$fieldList[$key] = $value;
|
$fieldList[$key] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,12 +101,7 @@ class MemberTableField extends ComplexTableField {
|
|||||||
Requirements::javascript(CMS_DIR . '/javascript/MemberTableField.js');
|
Requirements::javascript(CMS_DIR . '/javascript/MemberTableField.js');
|
||||||
Requirements::javascript(CMS_DIR . "/javascript/MemberTableField_popup.js");
|
Requirements::javascript(CMS_DIR . "/javascript/MemberTableField_popup.js");
|
||||||
|
|
||||||
// construct the filter and sort
|
$SNG_member = singleton($this->stat('data_class'));
|
||||||
if(isset($_REQUEST['MemberOrderByField'])) {
|
|
||||||
$this->sourceSort = '"' . Convert::raw2sql($_REQUEST['MemberOrderByField']) . '"' . Convert::raw2sql( $_REQUEST['MemberOrderByOrder'] );
|
|
||||||
}
|
|
||||||
|
|
||||||
$SNG_member = singleton('Member');
|
|
||||||
|
|
||||||
// search
|
// search
|
||||||
$SQL_search = isset($_REQUEST['MemberSearch']) ? Convert::raw2sql($_REQUEST['MemberSearch']) : null;
|
$SQL_search = isset($_REQUEST['MemberSearch']) ? Convert::raw2sql($_REQUEST['MemberSearch']) : null;
|
||||||
@ -129,11 +123,6 @@ class MemberTableField extends ComplexTableField {
|
|||||||
$this->setFieldListCsv( $csvFieldList );
|
$this->setFieldListCsv( $csvFieldList );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Overridden functions
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
function sourceID() {
|
function sourceID() {
|
||||||
return $this->group->ID;
|
return $this->group->ID;
|
||||||
}
|
}
|
||||||
@ -145,46 +134,21 @@ class MemberTableField extends ComplexTableField {
|
|||||||
function SearchForm() {
|
function SearchForm() {
|
||||||
$searchFields = new FieldGroup(
|
$searchFields = new FieldGroup(
|
||||||
new TextField('MemberSearch', _t('MemberTableField.SEARCH', 'Search')),
|
new TextField('MemberSearch', _t('MemberTableField.SEARCH', 'Search')),
|
||||||
new HiddenField("ctf[ID]",'',$this->group->ID),
|
new HiddenField("ctf[ID]", '', $this->group->ID),
|
||||||
new HiddenField('MemberFieldName','',$this->name),
|
new HiddenField('MemberFieldName', '', $this->name),
|
||||||
new HiddenField('MemberDontShowPassword','',$this->hidePassword)
|
new HiddenField('MemberDontShowPassword', '', $this->hidePassword)
|
||||||
);
|
);
|
||||||
|
|
||||||
$orderByFields = new FieldGroup(
|
|
||||||
new LabelField('OrderByLabel',_t('MemberTableField.ORDERBY', 'Order by')),
|
|
||||||
new FieldSet(
|
|
||||||
new DropdownField('MemberOrderByField','', array(
|
|
||||||
'FirstName' => _t('MemberTableField.FIRSTNAME', 'FirstName'),
|
|
||||||
'Surname' => _t('MemberTableField.SURNAME', 'Surname'),
|
|
||||||
'Email' => _t('MemberTableField.EMAIL', 'Email')
|
|
||||||
)),
|
|
||||||
new DropdownField('MemberOrderByOrder','',array(
|
|
||||||
'ASC' => _t('MemberTableField.ASC', 'Ascending'),
|
|
||||||
'DESC' => _t('MemberTableField.DESC', 'Descending')
|
|
||||||
))
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$groups = DataObject::get('Group');
|
|
||||||
$groupArray = array('' => _t('MemberTableField.ANYGROUP', 'Any group'));
|
|
||||||
foreach( $groups as $group ) {
|
|
||||||
$groupArray[$group->ID] = $group->Title;
|
|
||||||
}
|
|
||||||
$groupFields = new DropdownField('MemberGroup', _t('MemberTableField.FILTERBYGROUP', 'Filter by group'),$groupArray );
|
|
||||||
|
|
||||||
$actionFields = new LiteralField('MemberFilterButton','<input type="submit" class="action" name="MemberFilterButton" value="'._t('MemberTableField.FILTER', 'Filter').'" id="MemberFilterButton"/>');
|
$actionFields = new LiteralField('MemberFilterButton','<input type="submit" class="action" name="MemberFilterButton" value="'._t('MemberTableField.FILTER', 'Filter').'" id="MemberFilterButton"/>');
|
||||||
|
|
||||||
$fieldContainer = new FieldGroup(
|
$fieldContainer = new FieldGroup(
|
||||||
$searchFields,
|
$searchFields,
|
||||||
// $orderByFields,
|
$actionFields
|
||||||
// $groupFields,
|
|
||||||
$actionFields
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return $fieldContainer->FieldHolder();
|
return $fieldContainer->FieldHolder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add existing member to group rather than creating a new member
|
* Add existing member to group rather than creating a new member
|
||||||
*/
|
*/
|
||||||
@ -239,8 +203,6 @@ class MemberTableField extends ComplexTableField {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* #################################
|
* #################################
|
||||||
* Utility Functions
|
* Utility Functions
|
||||||
@ -254,7 +216,6 @@ class MemberTableField extends ComplexTableField {
|
|||||||
return 'GroupID';
|
return 'GroupID';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* #################################
|
* #################################
|
||||||
* Custom Functions
|
* Custom Functions
|
||||||
@ -271,6 +232,7 @@ class MemberTableField extends ComplexTableField {
|
|||||||
function setGroup($group) {
|
function setGroup($group) {
|
||||||
$this->group = $group;
|
$this->group = $group;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setController($controller) {
|
function setController($controller) {
|
||||||
$this->controller = $controller;
|
$this->controller = $controller;
|
||||||
}
|
}
|
||||||
@ -284,17 +246,25 @@ class MemberTableField extends ComplexTableField {
|
|||||||
*/
|
*/
|
||||||
function AddRecordForm() {
|
function AddRecordForm() {
|
||||||
$fields = new FieldSet();
|
$fields = new FieldSet();
|
||||||
foreach($this->FieldList() as $fieldName=>$fieldTitle) {
|
foreach($this->FieldList() as $fieldName => $fieldTitle) {
|
||||||
$fields->push(new TextField($fieldName));
|
$fields->push(new TextField($fieldName));
|
||||||
}
|
}
|
||||||
$fields->push(new HiddenField('ctf[ID]', null, $this->group->ID));
|
$fields->push(new HiddenField('ctf[ID]', null, $this->group->ID));
|
||||||
|
|
||||||
return new TabularStyle(new NestedForm(new Form($this, 'AddRecordForm',
|
$actions = new FieldSet(
|
||||||
$fields,
|
new FormAction('addtogroup', _t('MemberTableField.ADD','Add'))
|
||||||
new FieldSet(
|
);
|
||||||
new FormAction('addtogroup', _t('MemberTableField.ADD','Add'))
|
|
||||||
|
return new TabularStyle(
|
||||||
|
new NestedForm(
|
||||||
|
new Form(
|
||||||
|
$this,
|
||||||
|
'AddRecordForm',
|
||||||
|
$fields,
|
||||||
|
$actions
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -331,7 +301,7 @@ class MemberTableField extends ComplexTableField {
|
|||||||
*
|
*
|
||||||
* This includes getting inherited groups, such as groups under groups.
|
* This includes getting inherited groups, such as groups under groups.
|
||||||
*/
|
*/
|
||||||
function sourceItems(){
|
function sourceItems() {
|
||||||
// Caching.
|
// Caching.
|
||||||
if($this->sourceItems) {
|
if($this->sourceItems) {
|
||||||
return $this->sourceItems;
|
return $this->sourceItems;
|
||||||
@ -343,20 +313,21 @@ class MemberTableField extends ComplexTableField {
|
|||||||
$limitClause = ($_REQUEST['ctf'][$this->Name()]['start']) . ", {$this->pageSize}";
|
$limitClause = ($_REQUEST['ctf'][$this->Name()]['start']) . ", {$this->pageSize}";
|
||||||
} else {
|
} else {
|
||||||
$limitClause = "0, {$this->pageSize}";
|
$limitClause = "0, {$this->pageSize}";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// We use the group to get the members, as they already have the bulk of the look up functions
|
// We use the group to get the members, as they already have the bulk of the look up functions
|
||||||
$start = isset($_REQUEST['ctf'][$this->Name()]['start']) ? $_REQUEST['ctf'][$this->Name()]['start'] : 0;
|
$start = isset($_REQUEST['ctf'][$this->Name()]['start']) ? $_REQUEST['ctf'][$this->Name()]['start'] : 0;
|
||||||
|
|
||||||
$this->sourceItems = $this->group->Members(
|
$this->sourceItems = $this->group->Members(
|
||||||
$this->pageSize, // limit
|
$this->pageSize, // limit
|
||||||
$start, // offset
|
$start, // offset
|
||||||
$this->sourceFilter,
|
$this->sourceFilter,
|
||||||
$this->sourceSort
|
$this->sourceSort
|
||||||
);
|
);
|
||||||
$this->unpagedSourceItems = $this->group->Members( '', '', $this->sourceFilter, $this->sourceSort );
|
|
||||||
|
$this->unpagedSourceItems = $this->group->Members('', '', $this->sourceFilter, $this->sourceSort);
|
||||||
$this->totalCount = ($this->sourceItems) ? $this->sourceItems->TotalItems() : 0;
|
$this->totalCount = ($this->sourceItems) ? $this->sourceItems->TotalItems() : 0;
|
||||||
|
|
||||||
return $this->sourceItems;
|
return $this->sourceItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ abstract class ModelAdmin extends LeftAndMain {
|
|||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
protected function getManagedModels() {
|
function getManagedModels() {
|
||||||
$models = $this->stat('managed_models');
|
$models = $this->stat('managed_models');
|
||||||
if(is_string($models)) $models = array($models);
|
if(is_string($models)) $models = array($models);
|
||||||
if(!count($models)) user_error('ModelAdmin::getManagedModels():
|
if(!count($models)) user_error('ModelAdmin::getManagedModels():
|
||||||
@ -674,21 +674,23 @@ class ModelAdmin_CollectionController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function AddForm() {
|
public function AddForm() {
|
||||||
$newRecord = new $this->modelClass();
|
$newRecord = new $this->modelClass();
|
||||||
if($newRecord->hasMethod('getCMSAddFormFields')) {
|
if($newRecord->canCreate()){
|
||||||
$fields = $newRecord->getCMSAddFormFields();
|
if($newRecord->hasMethod('getCMSAddFormFields')) {
|
||||||
} else {
|
$fields = $newRecord->getCMSAddFormFields();
|
||||||
$fields = $newRecord->getCMSFields();
|
} else {
|
||||||
}
|
$fields = $newRecord->getCMSFields();
|
||||||
|
}
|
||||||
|
|
||||||
$validator = ($newRecord->hasMethod('getCMSValidator')) ? $newRecord->getCMSValidator() : null;
|
$validator = ($newRecord->hasMethod('getCMSValidator')) ? $newRecord->getCMSValidator() : null;
|
||||||
|
|
||||||
$actions = new FieldSet(
|
$actions = new FieldSet(
|
||||||
new FormAction("doCreate", _t('ModelAdmin.ADDBUTTON', "Add"))
|
new FormAction("doCreate", _t('ModelAdmin.ADDBUTTON', "Add"))
|
||||||
);
|
);
|
||||||
|
|
||||||
$form = new Form($this, "AddForm", $fields, $actions, $validator);
|
$form = new Form($this, "AddForm", $fields, $actions, $validator);
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function doCreate($data, $form, $request) {
|
function doCreate($data, $form, $request) {
|
||||||
@ -771,7 +773,11 @@ class ModelAdmin_RecordController extends Controller {
|
|||||||
$validator = ($this->currentRecord->hasMethod('getCMSValidator')) ? $this->currentRecord->getCMSValidator() : null;
|
$validator = ($this->currentRecord->hasMethod('getCMSValidator')) ? $this->currentRecord->getCMSValidator() : null;
|
||||||
|
|
||||||
$actions = $this->currentRecord->getCMSActions();
|
$actions = $this->currentRecord->getCMSActions();
|
||||||
$actions->push(new FormAction("doSave", _t('ModelAdmin.SAVE', "Save")));
|
if($this->currentRecord->canEdit(Member::currentUser())){
|
||||||
|
$actions->push(new FormAction("doSave", _t('ModelAdmin.SAVE', "Save")));
|
||||||
|
}else{
|
||||||
|
$fields = $fields->makeReadonly();
|
||||||
|
}
|
||||||
|
|
||||||
if($this->currentRecord->canDelete(Member::currentUser())) {
|
if($this->currentRecord->canDelete(Member::currentUser())) {
|
||||||
$actions->insertFirst($deleteAction = new FormAction('doDelete', _t('ModelAdmin.DELETE', 'Delete')));
|
$actions->insertFirst($deleteAction = new FormAction('doDelete', _t('ModelAdmin.DELETE', 'Delete')));
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
#left form.actionparams {
|
#left form.actionparams {
|
||||||
background: #eee;
|
background: #eee;
|
||||||
padding: 3px 5px;
|
padding: 0 0 5px 0;
|
||||||
|
float: left;
|
||||||
}
|
}
|
||||||
|
#left form#search_options {
|
||||||
|
padding-bottom: 8px;
|
||||||
|
}
|
||||||
#left form.actionparams input,
|
#left form.actionparams input,
|
||||||
#left form.actionparams select {
|
#left form.actionparams select {
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
@ -14,7 +18,7 @@
|
|||||||
#PageType,
|
#PageType,
|
||||||
#ReportSelector_holder select {
|
#ReportSelector_holder select {
|
||||||
float: left;
|
float: left;
|
||||||
margin-right: 3px;
|
margin-right: 4px;
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
}
|
}
|
||||||
#left form.actionparms input.action {
|
#left form.actionparms input.action {
|
||||||
@ -306,11 +310,17 @@ ul.tree span.a.last.Root span.c,
|
|||||||
ul.tree span.a.children.Root span.c {
|
ul.tree span.a.children.Root span.c {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ul.tree span.a.Root span.c {
|
||||||
|
background: url(../../jsparty/tree/images/i-bottom.gif) no-repeat scroll 0 50%;
|
||||||
|
}
|
||||||
|
|
||||||
ul#sitetree.tree ul {
|
ul#sitetree.tree ul {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
ul#sitetree.tree ul ul {
|
ul#sitetree.tree ul ul {
|
||||||
margin-left: 16px;
|
padding-left: 16px;
|
||||||
|
background: url(../../jsparty/tree/images/i-repeater.gif) repeat-y scroll 0 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -360,7 +370,9 @@ ul.tree span.untranslated a:visited {
|
|||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
#left form.actionparams #InputSiteTreeFilterDate .calendar {
|
#left form.actionparams #InputSiteTreeFilterDate .calendar {
|
||||||
margin-left: -100px;
|
margin-left: -96px;
|
||||||
|
width: 190px;
|
||||||
|
height: 141px;
|
||||||
}
|
}
|
||||||
/* IE7 fix: */
|
/* IE7 fix: */
|
||||||
#left form.actionparams #InputSiteTreeFilterDate table {
|
#left form.actionparams #InputSiteTreeFilterDate table {
|
||||||
@ -383,6 +395,31 @@ ul.tree span.untranslated a:visited {
|
|||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#SortItems {
|
||||||
|
border-top: 1px solid #cccccc;
|
||||||
|
padding: 5px 0 0 0;
|
||||||
|
overflow: hidden;
|
||||||
|
clear: left;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
#SortItems input, #ShowChanged input {
|
||||||
|
float: left;
|
||||||
|
margin: 0 3px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#versions_actions .versionChoice {
|
||||||
|
float: left;
|
||||||
|
display: block;
|
||||||
|
margin: 0 0 5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#versions_actions input, #Remember input {
|
||||||
|
float: left;
|
||||||
|
display: block;
|
||||||
|
padding-top: 2px;
|
||||||
|
margin: 0 3px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* i18n
|
* i18n
|
||||||
@ -394,13 +431,3 @@ ul.tree span.untranslated a:visited {
|
|||||||
border-top: 1px solid #CCCCCC;
|
border-top: 1px solid #CCCCCC;
|
||||||
padding: 3px 0 3px 7px;
|
padding: 3px 0 3px 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#SortItems {
|
|
||||||
border-bottom: 1px solid #cccccc;
|
|
||||||
background: #eee none repeat scroll 0%;
|
|
||||||
padding: 3px 0 3px 7px;
|
|
||||||
}
|
|
||||||
#SortItems #sortitems {
|
|
||||||
float: left;
|
|
||||||
margin-right: 3px;
|
|
||||||
}
|
|
@ -17,6 +17,11 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* legend tag shows up annoying spacing in IE6/7 */
|
||||||
|
.right form legend {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.right form .field {
|
.right form .field {
|
||||||
/*margin: 3px !important;*/
|
/*margin: 3px !important;*/
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@ -20,14 +20,14 @@ body {
|
|||||||
.ajaxActions {
|
.ajaxActions {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 5px;
|
bottom: 5px;
|
||||||
right: 15px;
|
right: 8px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
#TreeActions {
|
#TreeActions {
|
||||||
background: #eee;
|
|
||||||
float: left;
|
float: left;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
padding-bottom: 5px;
|
||||||
}
|
}
|
||||||
#TreeActions li {
|
#TreeActions li {
|
||||||
float: left;
|
float: left;
|
||||||
@ -51,8 +51,8 @@ li.action button {
|
|||||||
width: auto;
|
width: auto;
|
||||||
border-color: #CCCCCC rgb(153, 153, 153) rgb(153, 153, 153) rgb(204, 204, 204);
|
border-color: #CCCCCC rgb(153, 153, 153) rgb(153, 153, 153) rgb(204, 204, 204);
|
||||||
border-style: double;
|
border-style: double;
|
||||||
margin: 1px;
|
margin-right: 2px;
|
||||||
padding: 2px;
|
padding: 2px 1px;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
}
|
}
|
||||||
.ajaxActions input,
|
.ajaxActions input,
|
||||||
@ -329,15 +329,70 @@ body.stillLoading select {
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
#sitetree {
|
|
||||||
margin-top: 2px;
|
#sitetree_holder #TreeTools {
|
||||||
width: 500px; /* IE's chocking right now */
|
float: left;
|
||||||
}
|
width: inherit;
|
||||||
html>body #sitetree {
|
|
||||||
width: auto;
|
|
||||||
}
|
}
|
||||||
|
#SearchBox {
|
||||||
|
float: left;
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
#SearchBox #SiteTreeSearchTerm {
|
||||||
|
padding: 1px 0 2px 0;
|
||||||
|
}
|
||||||
|
#sitetree_ul {
|
||||||
|
padding: 3px 0 0 3px;
|
||||||
|
clear: left;
|
||||||
|
}
|
||||||
|
#sitetree {
|
||||||
|
width: 500px; /* IE's chocking right now */
|
||||||
|
}
|
||||||
|
html>body #sitetree {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
#left #TreeActions,
|
||||||
|
#left #SortItems {
|
||||||
|
background: #EEE;
|
||||||
|
padding: 5px;
|
||||||
|
float: left;
|
||||||
|
width: 95%;
|
||||||
|
}
|
||||||
|
#left #SortItems {
|
||||||
|
border-bottom: 1px solid #CCC;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
#TreeTools label {
|
||||||
|
display: block;
|
||||||
|
padding-top: 2px;
|
||||||
|
_padding-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
div.spacer, li.spacer {
|
#TreeTools #batchactionsforms {
|
||||||
|
padding: 0 0 7px 1px;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#TreeTools div p, #ShowChanged {
|
||||||
|
margin: 0 0 5px 0;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
#ShowChanged {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
#TreeTools div.middleColumn {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
#TreeTools #action_publish_selected,
|
||||||
|
#TreeTools #action_publish_selected {
|
||||||
|
padding: 2px 1px;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
div.spacer,
|
||||||
|
li.spacer {
|
||||||
float: none;
|
float: none;
|
||||||
clear: both;
|
clear: both;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
@ -102,8 +102,10 @@ CheckBoxRange.prototype = {
|
|||||||
this.form = form;
|
this.form = form;
|
||||||
this.field = field;
|
this.field = field;
|
||||||
this.eventPossibleCheckHappened = this.possibleCheckHappened.bindAsEventListener(this);
|
this.eventPossibleCheckHappened = this.possibleCheckHappened.bindAsEventListener(this);
|
||||||
Event.observe(form, "click", this.eventPossibleCheckHappened);
|
if(form) {
|
||||||
Event.observe(form, "keyup", this.eventPossibleCheckHappened);
|
Event.observe(form, "click", this.eventPossibleCheckHappened);
|
||||||
|
Event.observe(form, "keyup", this.eventPossibleCheckHappened);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
possibleCheckHappened: function(event) {
|
possibleCheckHappened: function(event) {
|
||||||
|
@ -451,6 +451,6 @@ window.name = windowName('cms');
|
|||||||
* Return a unique window name that contains the URL
|
* Return a unique window name that contains the URL
|
||||||
*/
|
*/
|
||||||
function windowName(suffix) {
|
function windowName(suffix) {
|
||||||
var base = document.getElementsByTagName('base')[0].href.replace('http://','').replace(/\//g,'_').replace(/\./g,'_');
|
var base = document.getElementsByTagName('base')[0].href.replace('~','').replace('http://','').replace(/\//g,'_').replace(/\./g,'_');
|
||||||
return base + suffix;
|
return base + suffix;
|
||||||
}
|
}
|
@ -144,7 +144,7 @@ $(document).ready(function() {
|
|||||||
* Table record handler for search result record
|
* Table record handler for search result record
|
||||||
* @todo: Shouldn't this be part of TableListField?
|
* @todo: Shouldn't this be part of TableListField?
|
||||||
*/
|
*/
|
||||||
$('#right #Form_ResultsForm tbody td a:not(.deletelink)')
|
$('#right #Form_ResultsForm tbody td a:not(.deletelink,.downloadlink)')
|
||||||
.livequery('click', function(){
|
.livequery('click', function(){
|
||||||
$(this).parent().parent().addClass('loading');
|
$(this).parent().parent().addClass('loading');
|
||||||
var el = $(this);
|
var el = $(this);
|
||||||
|
@ -242,7 +242,7 @@ TinyMCEImageEnhancement.prototype = {
|
|||||||
destHeight = imgTag.className.match(/destheight=([0-9.\-]+)([, ]|$)/) ? RegExp.$1 : null;
|
destHeight = imgTag.className.match(/destheight=([0-9.\-]+)([, ]|$)/) ? RegExp.$1 : null;
|
||||||
} catch(er) {
|
} catch(er) {
|
||||||
}
|
}
|
||||||
TinyMCE_AdvancedTheme._insertImage(relativeHref, altText, 0, null, null, destWidth, destHeight, null, null, cssClass);
|
TinyMCE_AdvancedTheme._insertImage(relativeHref, altText, 0, '', '', destWidth, destHeight, '', '', cssClass);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -7,65 +7,70 @@
|
|||||||
<% _t('SITECONTENT TITLE','Site Content and Structure',PR_HIGH) %>
|
<% _t('SITECONTENT TITLE','Site Content and Structure',PR_HIGH) %>
|
||||||
</h2>
|
</h2>
|
||||||
<div id="sitetree_holder">
|
<div id="sitetree_holder">
|
||||||
|
<div id="TreeTools">
|
||||||
<ul id="TreeActions">
|
<ul id="TreeActions">
|
||||||
<li class="action" id="addpage"><button<% if EditingLang %> disabled="disabled" class="disabled"<% end_if %>><% _t('CREATE','Create',PR_HIGH) %></button></li>
|
<li class="action" id="addpage"><button<% if EditingLang %> disabled="disabled" class="disabled"<% end_if %>><% _t('CREATE','Create',PR_HIGH) %></button></li>
|
||||||
<li class="action" id="search"><button><% _t('SEARCH','Search',PR_HIGH) %></button></li>
|
<li class="action" id="search"><button><% _t('SEARCH','Search',PR_HIGH) %></button></li>
|
||||||
<li class="action" id="batchactions"><button><% _t('BATCHACTIONS','Batch Actions',PR_HIGH) %></button></li>
|
<li class="action" id="batchactions"><button><% _t('BATCHACTIONS','Batch Actions',PR_HIGH) %></button></li>
|
||||||
<!-- <li class="action" id="duplicate"><a href="#">Duplicate</a></li>
|
<!-- <li class="action" id="duplicate"><a href="#">Duplicate</a></li>
|
||||||
Sam: this should be put into the Create area, I think, so we don't stuff up the layout -->
|
Sam: this should be put into the Create area, I think, so we don't stuff up the layout -->
|
||||||
</ul>
|
</ul>
|
||||||
<div style="clear:both;"></div>
|
<div style="clear:both;"></div>
|
||||||
<% control AddPageOptionsForm %>
|
<% control AddPageOptionsForm %>
|
||||||
<form class="actionparams" id="$FormName" style="display: none" action="$FormAction">
|
<form class="actionparams" id="$FormName" style="display: none" action="$FormAction">
|
||||||
<% control Fields %>
|
<% control Fields %>
|
||||||
$FieldHolder
|
$FieldHolder
|
||||||
<% end_control %>
|
|
||||||
<!--
|
|
||||||
<div>
|
|
||||||
<select name="Type">
|
|
||||||
<% control PageTypes %>
|
|
||||||
<option value="$ClassName">$AddAction</option>
|
|
||||||
<% end_control %>
|
<% end_control %>
|
||||||
</select>
|
<!--
|
||||||
<input type="hidden" name="ParentID" />
|
<div>
|
||||||
</div>
|
<select name="Type">
|
||||||
-->
|
<% control PageTypes %>
|
||||||
<div>
|
<option value="$ClassName">$AddAction</option>
|
||||||
<input class="action" type="submit" value="<% _t('GO','Go') %>" />
|
<% end_control %>
|
||||||
</div>
|
</select>
|
||||||
</form>
|
<input type="hidden" name="ParentID" />
|
||||||
<% end_control %>
|
</div>
|
||||||
<form class="actionparams" style="display: none" id="search_options" action="admin/filterSiteTree">
|
-->
|
||||||
<div>
|
<div>
|
||||||
<input type="hidden" id="SiteTreeIsFiltered" value="0" />
|
<input class="action" type="submit" value="<% _t('GO','Go') %>" />
|
||||||
<input type="text" id="SiteTreeSearchTerm" name="SiteTreeSearchTerm" />
|
</div>
|
||||||
<input type="submit" id="SiteTreeSearchButton" class="action" value="<% _t('SEARCH') %>" title="<% _t('SEARCHTITLE','Search through URL, Title, Menu Title, & Content') %>" />
|
</form>
|
||||||
<div style="display:none" id="TextSiteTreeFilterDate" class="SearchCriteria"><% _t('EDITEDSINCE','Edited Since') %>:</div>
|
|
||||||
<div style="display:none" id="InputSiteTreeFilterDate">$SiteTreeFilterDateField</div>
|
|
||||||
<% control SiteTreeFilterOptions %>
|
|
||||||
<div style="display:none" id="Text$Column" class="SearchCriteria">$Title:</div>
|
|
||||||
<input style="display:none" id="Input$Column" name="$Column" class="SearchCriteria" />
|
|
||||||
<% end_control %>
|
<% end_control %>
|
||||||
<select id="SiteTreeFilterAddCriteria">
|
<form class="actionparams" style="display: none" id="search_options" action="admin/filterSiteTree">
|
||||||
<option><% _t('ADDSEARCHCRITERIA','Add Criteria...') %></option>
|
<div>
|
||||||
<option value="SiteTreeFilterDate"><% _t('EDITEDSINCE','Edited Since') %></option>
|
<input type="hidden" id="SiteTreeIsFiltered" value="0" />
|
||||||
|
|
||||||
|
<div id="SearchBox">
|
||||||
|
<input type="text" id="SiteTreeSearchTerm" name="SiteTreeSearchTerm" />
|
||||||
|
<input type="submit" id="SiteTreeSearchButton" class="action" value="<% _t('SEARCH') %>" title="<% _t('SEARCHTITLE','Search through URL, Title, Menu Title, & Content') %>" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="display:none" id="TextSiteTreeFilterDate" class="SearchCriteria"><% _t('EDITEDSINCE','Edited Since') %>:</div>
|
||||||
|
<div style="display:none" id="InputSiteTreeFilterDate">$SiteTreeFilterDateField</div>
|
||||||
<% control SiteTreeFilterOptions %>
|
<% control SiteTreeFilterOptions %>
|
||||||
<option value="$Column">$Title</option>
|
<div style="display:none" id="Text$Column" class="SearchCriteria">$Title:</div>
|
||||||
|
<input style="display:none" id="Input$Column" name="$Column" class="SearchCriteria" />
|
||||||
<% end_control %>
|
<% end_control %>
|
||||||
</select>
|
<select id="SiteTreeFilterAddCriteria">
|
||||||
|
<option><% _t('ADDSEARCHCRITERIA','Add Criteria...') %></option>
|
||||||
|
<option value="SiteTreeFilterDate"><% _t('EDITEDSINCE','Edited Since') %></option>
|
||||||
|
<% control SiteTreeFilterOptions %>
|
||||||
|
<option value="$Column">$Title</option>
|
||||||
|
<% end_control %>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div id="batchactionsforms" style="display: none">
|
||||||
|
$DeleteItemsForm
|
||||||
|
$PublishItemsForm
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="SortItems">
|
||||||
|
<input type="checkbox" id="sortitems" /> <label for="sortitems"><% _t('ENABLEDRAGGING','Allow drag & drop reordering', PR_HIGH) %></label>
|
||||||
|
</div>
|
||||||
|
<div id="LangSelector_holder" <% if MultipleLanguages %><% else %> class="onelang"<% end_if %>>
|
||||||
|
Language: $LangSelector
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
<div id="batchactionsforms" style="display: none">
|
|
||||||
$DeleteItemsForm
|
|
||||||
$PublishItemsForm
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div id="SortItems">
|
|
||||||
<input type="checkbox" id="sortitems" /> <label for="sortitems"><% _t('ENABLEDRAGGING','Allow drag & drop reordering', PR_HIGH) %></label>
|
|
||||||
</div>
|
|
||||||
<div id="LangSelector_holder" <% if MultipleLanguages %><% else %> class="onelang"<% end_if %>>
|
|
||||||
Language: $LangSelector
|
|
||||||
</div>
|
</div>
|
||||||
<div id="sitetree_ul">
|
<div id="sitetree_ul">
|
||||||
$SiteTreeAsUL
|
$SiteTreeAsUL
|
||||||
|
Loading…
Reference in New Issue
Block a user