Posts by: juergen

Posts: 1427
Post: 11173
Topic: Admin Menu: how to rise one level of some pages
Sure thing. Glad you like it.
1 year ago
Post: 11169
Topic: Admin Menu: how to rise one level of some pages

I just made a small separate plugin, solely to add links to the admin panel. Might come in handy

get it from here AddAdminLinks_1_0.zip

Links are defined in $links array in Addon.php

edit: every panelgroup has 2 css classes: add-admin-link add-admin-linkN (where N is 0 to total number of links in reverse order)
I only defined the common .add-admin-link to have a dark blue-grey background. If you want to use different colors, just add sth. like
.add-admin-link0 { background:#543; }
.add-admin-link1 { background:#453; }
and so on, to Addon.css

Edited: 1 year ago
Post: 11167
Topic: Admin Menu: how to rise one level of some pages

First thing I see:

$item_class_name was meant to be used for possible CSS class(es), e.g. for custom backgroubd colors or alike.



But if you're going to add several links, we'd be better off with a different approach. Give me a few minutes…
 

1 year ago
Post: 11164
Topic: Admin Menu: how to rise one level of some pages

[GetHead]
script = jscript.php
method = plugin_function

Should have worked.
You probably just didn't click 'Upgrade' in Plugins->Manage->nbcDevice->Options, which is required after Addon.ini changed / hooks were added (?)

1 year ago
Post: 11162
Topic: Admin Menu: how to rise one level of some pages

where do have to I put this code?

Are your custom IOT admin pages coded as a Typesetter plugin? If so, you could use the GetHead() plugin hook.
It differs a bit whether the plugin class is instantiated or called statically - both will work.
How does your Addon.ini look like?


But you can also simply add the code to the very top of your template.php, without using a plugin hook. Will also work:

<?php

  global $page;

  if( \gp\tool::LoggedIn() && $page->title ){

    $item_link =               '/My_Item_Link';
    $item_label =              'My Item Label';
    $item_title =              'My Item Title';
    $item_fa_icon_class_name = 'fa-flag';
    $item_class_name =         'my-item-class-name';

    $page->jQueryCode .= '$("<div '
      . 'class=\"panelgroup ' . $item_class_name . '\" '
      . 'title=\"' . $item_title . '\">'
      .   '<a class=\"toplink\" href=\"' . $item_link . '\">'
      .     '<i class=\"fa ' . $item_fa_icon_class_name . '\"></i>'
      .     '<span>' . $item_label . '</span>'
      .   '</a>'
      . '</div>")'
      . '.insertAfter("div#simplepanel > div > div.toolbar")';
  }

?><DOCTYPE html>[ ... rest of template.php ]

 

 

 

 

 

1 year ago
Post: 11160
Topic: Cookie Law Policy Banner plugin?

There must be an issue with Chorme

Probably because Chrome increasingly enforces the use of HTTPS.
Can you switch your site to use https. Many hosting providers make it rather easy nowadays to use free "Let's encrypt' certificates.

1 year ago
Post: 11159
Topic: Admin Menu: how to rise one level of some pages

Ok. Try sth. like this:

public static function GetHead(){

  global $page;

  if( \gp\tool::LoggedIn() && $page->title ){

    $item_link =               '/My_Item_Link';
    $item_label =              'My Item Label';
    $item_title =              'My Item Title';
    $item_fa_icon_class_name = 'fa-flag';
    $item_class_name =         'my-item-class-name';

    $page->jQueryCode .= '$("<div '
      . 'class=\"panelgroup ' . $item_class_name . '\" '
      . 'title=\"' . $item_title . '\">'
      .   '<a class=\"toplink\" href=\"' . $item_link . '\">'
      .     '<i class=\"fa ' . $item_fa_icon_class_name . '\"></i>'
      .     '<span>' . $item_label . '</span>'
      .   '</a>'
      . '</div>")'
      . '.insertAfter("div#simplepanel > div > div.toolbar")';
  }

}

 

edit: 'insertAfter' instead of 'after'

Edited: 1 year ago
Post: 11156
Topic: Admin Menu: how to rise one level of some pages

Sample how to add a first link to the admin top bar, via GetHead hook:

public static function GetHead(){

  global $page;

  if( \gp\tool::LoggedIn() && $page->title ){ // FYI: $page->title means we're not on an admin page

    $item_link =               '/My_Item_Link';
    $item_label =              'My Item Label';
    $item_title =              'My Item Title';
    $item_fa_icon_class_name = 'fa-flag';
    $item_class_name =         'my-item-class-name';

    $page->jQueryCode .= '$("'
    . '<li '
    .   'class=\"' . $item_class_name . '\" '
    .   'title=\"' . $item_title . '\">'
    .     '<a href=\"' . $item_link . '\">'
    .       '<i class=\"fa ' . $item_fa_icon_class_name . '\"></i> '
    .       $item_label 
    .     '</a>'
    . '</li>'
    . '")'
    . '.prependTo("#admincontent_panel > ul:not(.panel_tabs)");';
  }

}

Edited: 1 year ago
Post: 11155
Topic: Admin Menu: how to rise one level of some pages
It's only possible using JavaScript.
Which one do you mean? The admin top bar or the floating panel?
1 year ago
Post: 11154
Topic: Cookie Law Policy Banner plugin?

I can't even deactivate it, because I'm not admitted.

Renaming the /addons/Cookie_Compliance folder will render it useless. If the plugin is the cause, you should now be able to log in (getting an error message that plugin hooks don't exist).

1 year ago

News

elFinder 2.1.50 in Upcoming Release
12/28/2019

A new release for Typesetter is in the works with a lot of improvements including the ... Read More

Typesetter 5.1
8/12/2017

Typesetter 5.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

More News

creisi productions

Dienstleistungen von creisi productions, Luzern (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Website * ...

Find out more about our Provider Spotlight

Log In

  Register