Posts by: juergen

Posts: 1384
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 (?)

11 months 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 ]

 

 

 

 

 

11 months 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.

11 months 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: 11 months 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: 11 months 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?
11 months 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).

11 months ago
Post: 11149
Topic: PHPMailer

Do you know if someone have done this work?

Sorry, not as far as I know.

Before you start coding it yourself - have you noticed that Typesetter doesn't support editiing by diferent users at the same time?
Not a big deal If there are only 2 or 3 users, but with lots of them this will likely become a real problem.

11 months ago
Post: 11147
Topic: Can not login to admin?

Sorry, I don't know the cause of this issue this time, but two things come to mind:

uploading the unzipped files from my recent gpexport-file

  1. Have you tried to create an _exports directory in the new site's /data directory, copy the exported archive there and restore it via gpEasy's internal method?
    That's the way to restore an export, normally (which will care about an installation's unique ID).
  2. Does anything speak against using a more recent Typesetter version?
11 months ago
Post: 11146
Topic: Cookie Law Policy Banner plugin?

Everything seems to be correctly installed, but…

Yep, there is a 'SyntaxError: '' string literal contains an unescaped line break' Javascript error.
It's in the message:

… upplÃ&frac12;singar um tína nÃ&frac12;tslu av heimasíðu okkara.
Okkara samstarvsfelagar kunnu samanseta …

Try to replace it with <br/>

11 months ago

News

Typesetter 5.1
8/12/2017

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

Over 8 Times Faster Than Wordpress
5/3/2016

We've known for a long time that Typesetter is fast. It's something we take pride ... 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