Перейти к содержимому
4.2.7
Sipsb

Toggle Developers Mode On/Off

Рекомендованные сообщения

Sipsb

Toggle Developers Mode On/Off


So many questions:

  1. Why did I make this instead of doing more productive things?
  2. Why is this not baked into the software to begin with?
  3. Why did it take me (anyone?) over two years to get around to making this?
  4. Does there exist in the world a better gif to use as a primary screenshot?

 

Here is a list of things. You should read them.

1) If you install this on a live site to toggle dev mode on and off you ain't real smarts. If I've done my url check right, this cannot be used on live sites. 

Another 1) CIC user? Why are you here? You can't run developers mode on CIC. Also, I check for CIC installation and then stop you from doing something stupid like using this.

2) You must already have a constants.php file; this won't make one for you. Oh, I could, maybe later... I could even just add a full on "edit your constants file from the ACP" thing. Maybe. Buy me beer. Seems like an "I'm drinking so lets do this" coding thing. Oh yeah, this constants file should have the define( 'IN_DEV', TRUE ); line already in there. True or false; either one. 

Also 2) If you don't have a constants.php file and try to turn dev mode on/off the plugin will insult you, or just tell you it can't be found. Not entirely sure as I have a constants.php file and am far too attached to it to even move it for the briefest period of time, let alone rename it. This shall remain a mystery until @AndyF is forced to test it. And he has! No insult alas...

2 the Third) Another good thing to have is a dev folder. I check for that. Just the folder. If you want to enable developers mode with an empty dev folder that's up to you.

3) This grabs the constants.php content, case insensitive regex for the in_dev true or false, switches yonder true/false, then redirects. Where you ask? Journey to yonder plugin settings and chooseth your post-toggle target: the applications page or ye'olde plugins page.

4) I'm targeting single quotes for 'IN_DEV', so don't use "IN_DEV" in your constants.php. Yes I could deal with that. I could.

5) The toggle you seek is on your ACP usermenu.

devmodetoggle1.PNG.edf46e0bf6cce53be0e5ee3605d66ee3.PNG

6) You're stuck with fa-flask for an icon. I'll let you run wild and free with the next version whenever that is...

7) dmt_on and dmt_off are the language bits you seek if the existing words are not to your tastes.

8) IPS 4.2 or better. The usermenu hook might still be fine on 4.19.4 or lower but that's untested.


 

  • Смех 1

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Создайте аккаунт или войдите в него для комментирования

Вы должны быть пользователем, чтобы оставить комментарий

Создать аккаунт

Зарегистрируйтесь для получения аккаунта. Это просто!

Зарегистрировать аккаунт

Войти

Уже зарегистрированы? Войдите здесь.

Войти сейчас

  • Сейчас на странице   0 пользователей

    Нет пользователей, просматривающих эту страницу.

×