Allow Fast edit for custom widget

36 views
Skip to first unread message

Anthony Coutant

unread,
Apr 22, 2012, 4:59:34 PM4/22/12
to diem-...@googlegroups.com
Hi,

I am currently trying to make my own widget that contains both simple and advanced parameters.
I would like this widget to be partly configurable (simple parameters) for front-editors.

The problem is that i don't know how to enable the fast edit behavior.
Indeed, the usual pen does not display.

How can i activate that and tell diem which are the form widgets a front-editor can update ?

Thank you in advance !

PS : Really great job for all the work on Diem, that i discovered just a month ago !

Anthony Coutant

unread,
May 2, 2012, 2:16:56 PM5/2/12
to diem-...@googlegroups.com
Hi again,

I have found some code to hide some fields in some conditions :

if(($user = $this->getService('user')) && !$user->can('widget_edit'))
    {
      $this->changeToHidden('aaa');
      $this->widgetSchema['aaa']->setAttribute('readonly', true);
      //unset($this['aaa']);
    }

The problem is that now some configuring must be missing because i don't see any "fast-edit" mode for non admin users (event front editors ...).
Can someone tell me what can allow this mode ? Or where to look in the library ? I tried to look at dmFrontPlugin widget but i have not found the piece that is missing.

Thank you !

4levels

unread,
May 2, 2012, 2:33:41 PM5/2/12
to diem-...@googlegroups.com

Hi Anthony,

The fast edit is controlled by the permission 'widget_edit' and some other permissions (admin access etc.)  Have a look at the permissions list in the admin to get familiar with the existing ones.

Kind regards,

Erik Van Kelst
IT specialist - OpenSource developer
--
sent from my mobile phone

Anthony Coutant

unread,
May 6, 2012, 6:20:19 PM5/6/12
to diem-...@googlegroups.com
I have seen that in C:\wamp\www\diem-aenomis\lib\vendor\diem\dmFrontPlugin\modules\dmWidget\lib\BasedmWidgetActions.class.php a list of actions that are called on every widget.
Then, i have checked the C:\wamp\www\diem-aenomis\lib\vendor\diem\dmFrontPlugin\modules\dmWidget\config\security.yml file that contains every credential definition for actions.

My "superuser" profile that has the "widget_fast_edit" right through the "front_editor" role, it can edit all of core widgets such as text, image, title ...
In my widget code, i don't have any code that hides form inputs if the user does not have the widget_edit role.
So, by default, the superuser guy should have access to this widget edition, right ?

I tried to add my own security.yml file but it does not work.
Do i have to modify the edit action of my custom widget or something ?
Reply all
Reply to author
Forward
0 new messages