Commit Graph

36 Commits

Author SHA1 Message Date
Andreas Gohr d4f83172d9 code style: line breaks 2023-08-31 22:44:40 +02:00
Andreas Gohr 8c7c53b032 codestyle adjustments: class declaration braces 2023-08-30 17:05:28 +02:00
Andreas Gohr 74981a4e68 apply PSR-12 constant visibility rule
PSR-12 says constants need their visibility declared from PHP 7.1
onwards
2023-08-30 13:02:49 +02:00
Andreas Gohr 33b91513e2 Apply rector fixes to inc/Menu 2023-08-29 14:45:13 +02:00
Andreas Gohr 0877de155d do not display "show page" in pagetools if no read permission 2023-08-16 09:34:28 +02:00
Andreas Gohr 601a1f6035 Allow revert action for logged in users only
This should prevent accidental reverts by bots on open wikis
2020-11-20 23:13:47 +01:00
Phy 2ae2e00140
relax Revert permission to EDIT from manager
Revert is another type of edit, which may be simulated by manual editing without using this shortcut. This patch thus relaxes the permission check.

Thank you @Klap-in for pointing this out.
2020-03-02 21:39:16 -05:00
Phy 3a5cb0342f
PHP8 fix: string offset out of range due to null 2019-12-01 16:09:43 -05:00
Andreas Gohr cbb44eabe0 deprecated trigger_event() in favor of a static method on Event 2019-04-20 21:48:53 +02:00
eiroca 792cbafa44 Fix issue #2396 2019-02-25 20:08:04 +01:00
Phy 5940772264 don't show empty optiongroup item in Mobilemenu
Co-authored-by: eiroca <eiroca@users.noreply.github.com>
2019-01-07 17:56:26 -05:00
Andreas Gohr 3d90b12c09 Admin Menu Item should not throw an exception
instead the visibility is properly checked in the visibleInContext()
method.
2018-10-30 16:21:11 +01:00
Michael Große 220966d399
fix: display "show" item in page menu during search action
Since we no longer change the page during a search, using the "show"
menu item to return to the current page makes more sense.
2018-03-27 20:16:32 +02:00
Michael Große e824d633ab
fix: enforce optional svg & prevent arbitrary html in html_btn
To prevent abusing this functionality for inserting arbitrary html,
inlineSVG is now called inside the html_btn function.
2018-01-19 16:32:22 +01:00
Michael Große 679dba01b4
feat: add optionally an SVG to html_btn 2018-01-18 19:45:07 +01:00
Andreas Gohr 2a85c6914d abbreviated ternary operator 2017-09-07 16:28:06 +02:00
Andreas Gohr b965a04478 added convenience method to display item as button 2017-09-02 17:27:59 +02:00
Andreas Gohr 50ca245c23 MenuItems: add possibility to set a different title attribute 2017-09-02 17:27:59 +02:00
Andreas Gohr cf71061da2 added two more missing action icons 2017-09-02 10:16:35 +02:00
Andreas Gohr 92ca7c1e55 added missing icon for register 2017-09-02 09:34:17 +02:00
Andreas Gohr 31110e1991 introduce a MenuInterface
this helps tieing together the "normal" menus and the MobileMenu and
makes them both implement a getItems() method.
2017-09-01 15:22:50 +02:00
Andreas Gohr 51b0b64b54 move type initialization to getter 2017-08-15 21:43:18 +02:00
Andreas Gohr e6bd4c92e1 used index array for menu items
This makes it a little easier to splice new elements into position
2017-08-15 21:42:31 +02:00
Andreas Gohr 4887c15447 make use of the new classes in tpl_get_action()
This function is now deprecated.

Tests even surfaced some smaller bugs :-)
2017-05-25 15:33:23 +02:00
Andreas Gohr 4bb2fc4a55 overwrite item properties in constructor only
Othewise weird side effects may happen when a parent constructor
overwrites them again.
2017-05-25 15:29:27 +02:00
Andreas Gohr 4875c35452 avoid double encoding of generated URLs
getLink() now no longer escapes ampersands - this is task of the code
producing the HTML. When using asHtmlLink(), buildAttributes() will take
care of the escaping for you.
2017-05-24 16:41:00 +02:00
Andreas Gohr e5226905ca fix do parameter of revisions type 2017-05-24 16:37:43 +02:00
Andreas Gohr 368ce25864 more doc blocks for the menu system 2017-05-19 21:12:37 +02:00
Andreas Gohr b3680c4f04 added mobile menu
This basically reimplements tpl_action_dropdown but makes use of the
other menus (by setting the context to mobile) and thus still triggers
the appropriate events. This makes #1598 obsolete.

tpl_action_dropdown (and the other tpl_action* methods) still need to be
replaced to make use of the new Menu system.
2017-05-19 20:31:29 +02:00
Andreas Gohr 8c51da59a9 remove unused $category property 2017-05-19 20:01:50 +02:00
Andreas Gohr 2f7a5efd5a use menu for site tools
this adds an option to print the menu without icons (as we do in the
dokuwiki template) but icons were added nontheless
2017-05-19 19:57:04 +02:00
Andreas Gohr b85a7f3bd0 use menu system for user tools
also adjusts styles and adds images
2017-05-19 18:17:34 +02:00
Andreas Gohr 7c844e0e3d fixed icons for edit action 2017-05-19 17:13:51 +02:00
Andreas Gohr c3766a92e4 fixed typo 2017-05-19 17:13:27 +02:00
Andreas Gohr c2b9771a2c fix base dir for images 2017-05-19 17:02:13 +02:00
Andreas Gohr 93b8c351fa beginning of a complete refactoring of the menues
This is an attempt to:

* get rid of the super long, complex functions in in/template.php
* make it easy for plugin authors to add their own items to any
  of our menus, regardless of the used template
* continue the progress to make use of SVG in the menues

This takes a similar approach as my actionrefactor branch. Originially
I thought both refactorings could be done in one, merging the
functionality of DokuWiki actions and the menu items. However I couldn't
make it work. So instead we have two separate but similar things.
Maybe they can converge later on.
2017-05-19 17:02:13 +02:00