Skip to content

Add button for categories in Tree toolbar #7387

@ghost

Description

sottwell created Redmine issue ID 7387

Two modification add a "New Category" button to the Element Tree toolbar. Courtesy of Mark Hamstra.

manager/assets/modext/widgets/modx.tree.element.js lines 67-77 - to add and activate a button in the toolbar

,{
icon: MODx.config.manager_url+'templates/default/images/restyle/icons/category.png'
,cls: 'x-btn-icon'
,tooltip: {text: _('new_category')}
,handler: function() {
this.cm.activeNode = { attributes: {}, id: 'n_category' };
this.createCategory(null,{target: null})
}
,scope: this
,hidden: MODx.perm.new_category ? false : true
}

core/model/modx/processors/system/config.js.php line 90 - to enable permissions checks on the button

if ($modx->hasPermission('new_category')) { $o .= 'MODx.perm.new_category = true;'; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureRequest about implementing a brand new function or possibility.type-frontendIssues related to UI/UX issues, mostly about styles and frontend implementations on JavaScript.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions