Jump to content

AdminOnSteroids


tpr

Recommended Posts

No idea why is that - could you replace "$this->config" to "wire('config')" in that line?

Also what is the version of PW? If you can, could you check with a newer PHP? (eg if you can switch PHP version on the server via cPanel or other)

  • Like 1
Link to comment
Share on other sites

Changing to "wire('config')" was successful. The next "this"-error was on line 430 ( Using $this when not in object context). I changed the output to only "$disabledText" and now AOS is working on PHP 5.3.8 :-) Unfortunately, I can not switch to a newer PHP version on the server because there is still an old application running PHP 5.3.8.
Processwire is on latest Dev (3.0.40), but I think the error is because the old PHP.

Thanks for your support!

  • Like 1
Link to comment
Share on other sites

hi tpr,

i have an issue with your module in a panel frame. i created a demo process module so you should be able to reproduce it. just install the module, go to the hello world page and click "reply"

2016-11-13 13_33_12-Hello World • ProcessWire • hrdiamonds.dev.png

when i click into the field the first line is moved down and also there is some error on top

you can import the needed field here:

{
    "rocktodos_body": {
        "id": 148,
        "type": "FieldtypeTextarea",
        "flags": 0,
        "name": "rocktodos_body",
        "label": "Nachricht",
        "contentType": 1,
        "htmlOptions": [
            2,
            4,
            8
        ],
        "icon": "align-justify",
        "inputfieldClass": "InputfieldCKEditor",
        "tags": "-RockTools -RockTodos",
        "collapsed": 0,
        "required": 1,
        "minlength": 0,
        "maxlength": 0,
        "showCount": 0,
        "rows": 5,
        "toolbar": "Format, Styles, -, Bold, Italic, -, RemoveFormat\nNumberedList, BulletedList, -, Blockquote\nPWLink, Unlink, Anchor\nPWImage, Table, HorizontalRule, SpecialChar\nPasteText, PasteFromWord\nScayt, -, Sourcedialog",
        "inlineMode": 0,
        "useACF": 1,
        "usePurifier": 1,
        "formatTags": "p;h1;h2;h3;h4;h5;h6;pre;address",
        "extraPlugins": [
            "pwimage",
            "pwlink",
            "sourcedialog"
        ],
        "removePlugins": "image,magicline",
        "textformatters": "",
        "showIf": "",
        "columnWidth": 100,
        "requiredAttr": "",
        "requiredIf": "",
        "toggles": "",
        "extraAllowedContent": "",
        "contentsCss": "",
        "contentsInlineCss": "",
        "stylesSet": "",
        "customOptions": "",
        "plugin_sourcedialog": ""
    }
}

 

ps: seems that it has something todo with the getinputfield method and the id... don't know whats going on :(

ProcessHello.zip

Link to comment
Share on other sites

The edit field link is failing because I use a CSS selector "#ProcessPageEdit .aos_hasTooltip .title", so it is not applied to non-processpageedit type pages. I guess I can remove this limitation.

The extra top seems to come from the Sticky CKEditor toolbar setting ON, but I couldn't reproduce. Could you find what CSS rule is causing this?

  • Like 1
Link to comment
Share on other sites

thank you tpr, makes sense :)

sorry i had to change my code and i am using a modified page edit screen (because i have a files field and need to store files, so it has to be a page). there everything works fine.

would be nice to remove the editlink limitation. i'm using lots of my fields in custom forms for a processmodule! thank you

Link to comment
Share on other sites

Just uploaded v104 that adds ctrl+u source mode toggle to CKEditors (CKEaddons keystrokes), plus a new CKEditor plugin Keep TextSelection. The latter works with the non-dialog source mode only (plugin limitation).

Also contains bernhard's request to allow field edit links on non-pageedit pages, and a possible fix for the PHP 5.3.8 issue reported by @Noboru which is probably due to the missing support for closures - if so, I'll rewrite all of them in the module.

aos_ckesrc.gif

  • Like 3
Link to comment
Share on other sites

Hey @tpr - have you considered adding edit links to the breadcrumb trail so that when you are editing a page, you could easily click on one of its parents in the breadcrumb to edit it? Maybe an edit icon after its title, or maybe longclick (although this is becoming synonymous with modal editing which I don't think we want in this case).

Link to comment
Share on other sites

Sometimes I feel I write the readme in vain :)

Add long-click and ctrl+click actions to breadcrumbs: if enabled, long-click on a breadcrumb item will open the corresponding front-end page in a new tab/window, and holding the Ctrl key when clicking on them will navigate to their edit screen.

I know it's not too user-friendly but it's there and working :)

  • Like 1
Link to comment
Share on other sites

8 minutes ago, tpr said:

Sometimes I feel I write the readme in vain

Jeez - make me feel bad why don't you :)

I did think I'd seen something along those lines mentioned, but when I went to try it, it didn't work. I am getting a mix of "popup blocked" by Chrome for the long-click and nothing happening for the CTRL / CMD click. Remember I am on a Mac, so maybe that's the issue?

Link to comment
Share on other sites

It works here in both themes - this is the snippet responsible for it (in Hotkeys.js):

$('#breadcrumbs').on('click', 'a', function (e) {
    if ((e.metaKey || e.ctrlKey) && $(this).attr('data-editurl')) {
        e.preventDefault();
        var url = $(this).attr('data-editurl');
        window.location = url;
    }
});

Do you see something wrong with it?

If you type "ProcessWire.config.AOS_breadcrumbs" to the console and execute, you can see the array of objects for the breadcrumbs, perhaps there's something failing here.

Link to comment
Share on other sites

49 minutes ago, tpr said:

I know it's not too user-friendly but it's there and working :)

It's not working quite right in Firefox. The data-url and data-editurl attributes are for the neighbouring breadcrumb item. In the screenshot below the Home item has the data- attributes for the "Four" page.

aos.png

  • Like 2
Link to comment
Share on other sites

Ok, so the problem with the default theme is that the edit links are off by one level, so if you click on the direct parent it doesn't work and if you click on the Home link then you get the child below it. Everything is fine with Reno. 

I expect the problem is similar to what I experienced when modifying the breadcrumbs with AdminRestrictBranch. Do a quick search for breadcrumb in my commit history: https://github.com/adrianbj/AdminRestrictBranch/commits/master and you'l see some of the things I did to make it work with Reno. Maybe this will help you in the reverse direction to get this working for the default theme.

EDIT: Sorry, this is exactly what @Robin S just pointed out!

Link to comment
Share on other sites

2 minutes ago, adrian said:

Ok, so the problem with the default theme is that the edit links are off by one level, so if you click on the direct parent it doesn't work and if you click on the Home link then you get the child below it.

It seems to be browser-specific on PC. In Chrome the attributes are correct but in Firefox they're wrong.

Link to comment
Share on other sites

Thanks - actually the screenshot helped, you have debug mode on and that adds an extra item there.

Replace line 45 in Hotkeys.js with this:

$('#breadcrumbs a:not(.pw-panel):not([href="#"])').each(function (i) {

@adrian I'm just generating the editurl/url for the current page and add the data-attributes with jQuery, which is not the smartest way I admit. Maybe this thing needs to be revised some day.

  • Like 1
Link to comment
Share on other sites

10 minutes ago, tpr said:

Thanks - actually the screenshot helped, you have debug mode on and that adds an extra item there.

That raises the question: why aren't the debug and quick-tree icons shown in Chrome PC? An AOS issue or core issue?

chrome.png

Edit: they're not visible in IE11 either. Weird.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...