View Revisions: Issue #16702

Summary 16702: Replace VueJS top-bar with Yii widget
Revision 2020-10-14 11:18 by ollehar
Description Alternatives:

1. Keep current Vue component (but possible improve it/make it easier to add/remove buttons)
2. Use raw HTML (forwardporting LS3, compare: https://github.com/LimeSurvey/LimeSurvey/blob/3.x-LTS/application/views/admin/survey/Question/questionbar_view.php) (pro: straigh-forward, con: too much logic in viewfiles?)
3. Use CMenu Yii widget
4. Extend CMenu Yii widget and use objects instead of associative arrays to define the menu data
5. As 4, but extend CWidget (CMenu does not contain much that we need, and doesn't use view files)

Some brainstorming being done.

https://www.yiiframework.com/doc/api/1.1/CMenu

Personally I am not a fan of using associative arrays as data carriers. I don't believe they scale well in huge projects.

Alternative to 4 is casting plugin Menu objects to arrays that CMenu can understand. Like `$menuArray = (array) $menu`. Or using built-in ArrayAccess interface.

The top-bar should do only one thing - display buttons that are fed to it. the different types of buttons (or widgets, since condition designer also has a question selector) correspond to different classes carrying the data. the mapping from object data to HTML is done in the widget view files.

E.g., if you have a DropDownMenu class, then you'll have a dropdownmenu.php view file in the widget.

So in the controller view you end up with

```
?php $this->widget('ls.widget.topbar', [$dropdownmenu1, $dropdownmenu2, $separator, $menuitem]); ?
```

Branch: feature/16702-replace-vuejs-topbar-with-widget
Revision 2020-09-29 14:55 by ollehar
Description Alternatives:

1. Keep current Vue component (but possible improve it/make it easier to add/remove buttons)
2. Use raw HTML (forwardporting LS3, compare: https://github.com/LimeSurvey/LimeSurvey/blob/3.x-LTS/application/views/admin/survey/Question/questionbar_view.php)
3. Use CMenu Yii widget
4. Extend CMenu Yii widget and use objects instead of associative arrays to define the menu data
5. As 4, but extend CWidget (CMenu does not contain much that we need, and doesn't use view files)

Some brainstorming being done.

https://www.yiiframework.com/doc/api/1.1/CMenu

Personally I am not a fan of using associative arrays as data carriers. I don't believe they scale well in huge projects.

Alternative to 4 is casting plugin Menu objects to arrays that CMenu can understand. Like `$menuArray = (array) $menu`. Or using built-in ArrayAccess interface.

The top-bar should do only one thing - display buttons that are fed to it. the different types of buttons (or widgets, since condition designer also has a question selector) correspond to different classes carrying the data. the mapping from object data to HTML is done in the widget view files.

E.g., if you have a DropDownMenu class, then you'll have a dropdownmenu.php view file in the widget.

So in the controller view you end up with

```
?php $this->widget('ls.widget.topbar', [$dropdownmenu1, $dropdownmenu2, $separator, $menuitem]); ?
```

Branch: feature/16702-replace-vuejs-topbar-with-widget
Revision 2020-09-29 12:09 by ollehar
Description Alternatives:

1. Keep current Vue component (but possible improve it/make it easier to add/remove buttons)
2. Use raw HTML (forwardporting LS3)
3. Use CMenu Yii widget
4. Extend CMenu Yii widget and use objects instead of associative arrays to define the menu data
5. As 4, but extend CWidget (CMenu does not contain much that we need, and doesn't use view files)

Some brainstorming being done.

https://www.yiiframework.com/doc/api/1.1/CMenu

Personally I am not a fan of using associative arrays as data carriers. I don't believe they scale well in huge projects.

Alternative to 4 is casting plugin Menu objects to arrays that CMenu can understand. Like `$menuArray = (array) $menu`. Or using built-in ArrayAccess interface.

The top-bar should do only one thing - display buttons that are fed to it. the different types of buttons (or widgets, since condition designer also has a question selector) correspond to different classes carrying the data. the mapping from object data to HTML is done in the widget view files.

E.g., if you have a DropDownMenu class, then you'll have a dropdownmenu.php view file in the widget.

So in the controller view you end up with

```
?php $this->widget('ls.widget.topbar', [$dropdownmenu1, $dropdownmenu2, $separator, $menuitem]); ?
```

Branch: feature/16702-replace-vuejs-topbar-with-widget
Revision 2020-09-29 11:49 by ollehar
Description Alternatives:

1. Keep current Vue component (but possible improve it/make it easier to add/remove buttons)
2. Use raw HTML (LS3 style?)
3. Use CMenu Yii widget
4. Extend CMenu Yii widget and use objects instead of associative arrays to define the menu data
5. As 4, but extend CWidget (CMenu does not contain much that we need, and doesn't use view files)

Some brainstorming being done.

https://www.yiiframework.com/doc/api/1.1/CMenu

Personally I am not a fan of using associative arrays as data carriers. I don't believe they scale well in huge projects.

Alternative to 4 is casting plugin Menu objects to arrays that CMenu can understand. Like `$menuArray = (array) $menu`. Or using built-in ArrayAccess interface.

The top-bar should do only one thing - display buttons that are fed to it. the different types of buttons (or widgets, since condition designer also has a question selector) correspond to different classes carrying the data. the mapping from object data to HTML is done in the widget view files.

E.g., if you have a DropDownMenu class, then you'll have a dropdownmenu.php view file in the widget.

So in the controller view you end up with

```
?php $this->widget('ls.widget.topbar', [$dropdownmenu1, $dropdownmenu2, $separator, $menuitem]); ?
```

Branch: feature/16702-replace-vuejs-topbar-with-widget
Revision 2020-09-28 15:31 by ollehar
Description Alternatives:

1. Keep current Vue component (but possible improve it/make it easier to add/remove buttons)
2. Use raw HTML (LS3 style?)
3. Use CMenu Yii widget
4. Extend CMenu Yii widget and use objects instead of associative arrays to define the menu data

Some brainstorming being done.

https://www.yiiframework.com/doc/api/1.1/CMenu

Personally I am not a fan of using associative arrays as data carriers. I don't believe they scale well in huge projects.

Alternative to 4 is casting plugin Menu objects to arrays that CMenu can understand. Like `$menuArray = (array) $menu`. Or using built-in ArrayAccess interface.

The top-bar should do only one thing - display buttons that are fed to it. the different types of buttons (or widgets, since condition designer also has a question selector) correspond to different classes carrying the data. the mapping from object data to HTML is done in the widget view files.

E.g., if you have a DropDownMenu class, then you'll have a dropdownmenu.php view file in the widget.

So in the controller view you end up with

```
?php $this->widget('ls.widget.topbar', [$dropdownmenu1, $dropdownmenu2, $separator, $menuitem]); ?
```

Branch: feature/16702-replace-vuejs-topbar-with-widget
Revision 2020-09-28 12:44 by ollehar
Description Alternatives:

1. Keep current Vue component (but possible improve it/make it easier to add/remove buttons)
2. Use raw HTML (LS3 style?)
3. Use CMenu Yii widget
4. Extend CMenu Yii widget and use objects instead of associative arrays to define the menu data

Some brainstorming being done.

https://www.yiiframework.com/doc/api/1.1/CMenu

Personally I am not a fan of using associative arrays as data carriers. I don't believe they scale well in huge projects.

Alternative to 4 is casting plugin Menu objects to arrays that CMenu can understand. Like `$menuArray = (array) $menu`. Or using built-in ArrayAccess interface.

The top-bar should do only one thing - display buttons that are fed to it. the different types of buttons (or widgets, since condition designer also has a question selector) correspond to different classes carrying the data. the mapping from object data to HTML is done in the widget view files.

E.g., if you have a DropDownMenu class, then you'll have a dropdownmenu.php view file in the widget.

So in the controller view you end up with

```
?php $this->widget('ls.widget.topbar', [$dropdownmenu1, $dropdownmenu2, $separator, $menuitem]); ?
```
Revision 2020-09-28 12:44 by ollehar
Description Alternatives:

1. Keep current Vue component (but possible improve it/make it easier to add/remove buttons)
2. Use raw HTML (LS3 style?)
3. Use CMenu Yii widget
4. Extend CMenu Yii widget and use objects instead of associative arrays to define the menu data

Some brainstorming being done.

https://www.yiiframework.com/doc/api/1.1/CMenu

Personally I am not a fan of using associative arrays as data carriers. I don't believe they scale well in huge projects.

Alternative to 4 is casting plugin Menu objects to arrays that CMenu can understand. Like `$menuArray = (array) $menu`. Or using built-in ArrayAccess interface.

The top-bar should do only one thing - display buttons that are fed to it. the different types of buttons (or widgets, since condition designer also has a question selector) correspond to different classes carrying the data. the mapping from object data to HTML is done in the widget view files.

E.g., if you have a DropDownMenu class, then you'll have a dropdownmenu.php view file in the widget.

So in the controller view you end up with

```
<?php $this->widget('ls.widget.topbar', [$dropdownmenu1, $dropdownmenu2, $separator, $menuitem]); ?>
```
Revision 2020-09-28 12:42 by ollehar
Description Alternatives:

1. Keep current Vue component (but possible improve it/make it easier to add/remove buttons)
2. Use raw HTML (LS3 style?)
3. Use CMenu Yii widget
4. Extend CMenu Yii widget and use objects instead of associative arrays to define the menu data

Some brainstorming being done.

https://www.yiiframework.com/doc/api/1.1/CMenu

Personally I am not a fan of using associative arrays as data carriers. I don't believe they scale well in huge projects.

Alternative to 4 is casting plugin Menu objects to arrays that CMenu can understand. Like `$menuArray = (array) $menu`. Or using built-in ArrayAccess interface.
Revision 2020-09-28 12:42 by ollehar
Description Alternatives:

1. Keep current Vue component (but possible improve it/make it easier to add/remove buttons)
2. Use raw HTML (LS3 style?)
3. Use CMenu Yii widget
4. Extend CMenu Yii widget and use objects instead of associative arrays to define the menu data

Some brainstorming being done.

https://www.yiiframework.com/doc/api/1.1/CMenu

Personally I am not a fan of using associative arrays as data carriers. I don't believe they scale well in huge projects.
Revision 2020-09-28 12:41 by ollehar
Description Alternatives:

1. Keep current Vue component (but possible improve it/make it easier to add/remove buttons)
2. Use raw HTML (LS3 style?)
3. Use CMenu Yii widget
4. Extend CMenu Yii widget and use objects instead of associative arrays to define the menu data

Some brainstorming being done.
Revision 2020-09-28 12:41 by ollehar
Description Alternatives:

1. Keep current Vue component (but possible improve it/make it easier to add/remove buttons)
2. Use raw HTML (LS3 style?)
3. Use CMenu Yii widget
4. Extend CMenu Yii widget and use objects instead of associative arrays to define the menu data