Posts by: juergen

Posts: 1480
Post: 7324
Topic: Triggering an Admin Box in INline Editing
Thanks for the hint Frédéric!

The whole inline editing stuff is sort of new to me and I'm trying to get the concept of all the AJAX, section.object and bulit-in tools.
Actually, for my current FullCalendar plugin I have abandoned the idea of editing JSON in a codemirror instance. But I got it working and it will likely come in handy sometimes.

FYI: gpEasy'S included codemirror cannot be loaded using common::LoadComponents()but there will be no conflicts since gpEasy only uses codemirror for writing CSS/LESS in the layout editor. Therefore a custom, independent version can be loaded safely from a plugin.
6 years ago
Post: 7322
Topic: Provide current page language

Hi Josh,

as already discussed here I've made a function (with Frédéric/fly06's help) that returns the current page’s language to be used in the template.php and in JS.
Maybe sth. similar could go into the gpEasy core?
 

<?php

function getPageLanguage() {

  global $page, $languages, $config, $dataDir, $ml_object;

  $lang = $config["language"]; // gpEasy interface language

  if ($ml_object) { // only if Multi-Language Manager ist installed
    $ml_list = $ml_object->GetList($page->gp_index);
    $ml_lang = is_array($ml_list) && ($ml_lang = array_search($page->gp_index, $ml_list)) !== false ? $ml_lang : false;
  } else {
    $ml_lang = false;
  }

  $page_lang = $ml_lang ? $ml_lang : $lang;

  $page->head  .= "\n<script type=\"text/javascript\">\n";
  $page->head  .= 'var gp_pagelang = "' . $page_lang . '"; ' . "\n";

  if ($ml_lang != $lang && array_key_exists($ml_lang, $languages)) {
    $lang_inc_file = $dataDir . "/include/languages/" . $ml_lang . "/main.inc";
    if ( file_exists($lang_inc_file) ) {
      // message("Multi-Language Manager='" . $ml_lang . "', gpEasy Interface='" . $lang . "', Page='" . $page_lang . "'");
      include $lang_inc_file; // loads current page language $langmessage array
      $page->head  .= 'var colorbox_lang = {' .
        '"previous":"' . $langmessage['Previous'] . '",' .
        '"next":"' . $langmessage['Next'] . '",' .
        '"close":"' . $langmessage['Close'] . '",' .
        '"caption":"' . $langmessage['caption'] . '",' .
        '"current":"' . sprintf( $langmessage['Image_of'], '{current}', '{total}' ) . '"}; ' . "\n";
      }
  }
  $page->head  .= "</script>\n";
 
  return $page_lang;
}

?>

 

In the template.php use …

<!doctype html>
<html lang="<?php echo getPageLanguage(); ?>">

… into the <html> tag.

 

If the function is called, it doesn't only return the current language but…

  • in case the page's language is also available as translation in gpEasy, it will make colorbox use it ("Previous/Next, Image 1 of n, Close etc.")
  • it sets a global JavaScript variable gp_pagelang that can be used in other JS/jQuery scripts, e.g. jQuery UI datepicker.
6 years ago
Post: 7321
Topic: Multi Language Manager - get current page language

For everybody interested in this topic:

If you want even more internationalization support in your template, i have made a function that can be included in your template php (e.g. at the very end):

 

<?php

function getPageLanguage() {

  global $page, $languages, $config, $dataDir, $ml_object;

  $lang = $config["language"]; // gpEasy interface language

  if ($ml_object) { // only if Multi-Language Manager ist installed
    $ml_list = $ml_object->GetList($page->gp_index);
    $ml_lang = is_array($ml_list) && ($ml_lang = array_search($page->gp_index, $ml_list)) !== false ? $ml_lang : false;
  } else {
    $ml_lang = false;
  }

  $page_lang = $ml_lang ? $ml_lang : $lang;

  $page->head  .= "\n<script type=\"text/javascript\">\n";
  $page->head  .= 'var gp_pagelang = "' . $page_lang . '"; ' . "\n";

  if ($ml_lang != $lang && array_key_exists($ml_lang, $languages)) {
    $lang_inc_file = $dataDir . "/include/languages/" . $ml_lang . "/main.inc";
    if ( file_exists($lang_inc_file) ) {
      // message("Multi-Language Manager='" . $ml_lang . "', gpEasy Interface='" . $lang . "', Page='" . $page_lang . "'");
      include $lang_inc_file; // loads current page language $langmessage array
      $page->head  .= 'var colorbox_lang = {' .
        '"previous":"' . $langmessage['Previous'] . '",' .
        '"next":"' . $langmessage['Next'] . '",' .
        '"close":"' . $langmessage['Close'] . '",' .
        '"caption":"' . $langmessage['caption'] . '",' .
        '"current":"' . sprintf( $langmessage['Image_of'], '{current}', '{total}' ) . '"}; ' . "\n";
      }
  }
  $page->head  .= "</script>\n";
 
  return $page_lang;
}

?>

 

and insert …

<!doctype html>
<html lang="<?php echo getPageLanguage(); ?>">

… in the <html> tag.

 

when the function is called, it doesn't only return the current language but…

  • in case the page's language is also available as translation in gpEasy, it will make colorbox use it ("Previous/Next, Image 1 of n, Close etc.")
  • it sets a global JavaScript variable gp_pagelang that can be used in other JS/jQuery scripts, e.g. jQuery UI datepicker.

 

 

 

Edited: 6 years ago
Post: 7316
Topic: alter Thumbnailsize in gpeasy 4.3.4

You can change the thumbnail size in the main admin panel via Settings -> Configuration -> Performance ->  Gallery Thumbnail Size

The new thumbnail size will apply to all images that you upload after changing the setting.

To render bigger/smaller thumbnails in the galleries you will also have to change the gallery styles. You can override them from within your theme/layout CSS (or LESS).

Override the styles of the following classes:

.gp_gallery, .gp_gallery li, .gp_gallery div, .gp_gallery .caption, .gp_gallery a, .gp_gallery a img


Refer to [gpEasy Installation root]/include/css/default_gallery.css

Edited: 6 years ago
Post: 7314
Topic: Cant upload pictures over 12kb

When exactly do you get the error and how does it look like.Does it appear inside the file manager or is it a unformatted error page?

15360 sounds to me like a PHP memory limit (kB in this case) which would be insufficient to generate thumbnails/resampled images from large sources (a 4 MB JPEG can easily consume 40 MB of RAM when decompressed for resampling).

Normally gpEasy wants 64M+ available RAM (mainly for the LESS compiler) but I'm uncertain in which cases it actually drops an error if there is too little of it.

Do you have access to your php.ini?
If not, you can view your PHP confguration by placing a file e.g. called phpinfo.php in your gpEasy installation directory that contains

<?php
phpinfo();
?>

and load it in the browser using http://your.site.address/phpinfo.php
Search  for "15360" and see if there are any values matching.
/edit: Also look for "15M"

Edited: 6 years ago
Post: 7313
Topic: Triggering an Admin Box in INline Editing

I'm looking for a way to get the following working in my current project (FullCalendar for gpEasy):

The FullCalendar will be a new Section Type containing solely the default content ...

'<div class="fullcalendar" data-config="'
. $fullCalendarDefaultConfig_JSON .
'"></div>'

$fullCalendarDefaultConfig_JSON will store the calendar's options which will be applied when the calendar instance in this section is invoked (using FullCalendar jQuery Plugin)

When editing this section I'd like to trigger a modal admin box ($gp.AdminBoxC ?) that sports a codemirror instance to edit the calendar configuration.
I have trouble figuring out how to achieve this in my FullCalendar::InlineEdit_Scripts function.

Furthermore can I use common::LoadComponents('codemirror'); and if so, which Hook should I use?

A faux screenshot of the favored interface:


Thanks in advance!

Edited: 6 years ago
Post: 7311
Topic: FullCalendar

Hi folks,

I'm considering to write a FullCalendar Add-on for gpEasy (see http://fullcalendar.io) – primarily to use Google Calendar and OwnCloud as data sources.

Shouldn't  be too complicated but before I start from scratch: Has anyone already done sth. and is willing to share code?

6 years ago
Post: 7310
Topic: Can't log in to site

Try to copy your .htaccess file from your /gpeasy subdirectory to your server root directory and replace all occurrences of /gpeasy/ with /

If this doesn't help you could try to activate debugging in your gpconfig.php file in the root directory

define('gpdebug',true);

(it's somewhere around line 102) and post if any new error messages show up when trying to log in.

If this doesn't help either, the best way is to copy your entrie gpEasy installation from /gpeasy to / and perform the steps I described here
But let's see if we get any debug messages first.

Edited: 6 years ago
Post: 7309
Topic: Can't login after installation of gpEasy 4.3.4
Have you installed gpEasy in the server root or in a subdirectory?

The Server replies it cannot find /index.php so it's probably not there.
 
6 years ago
Post: 7308
Topic: Making gpEasy site active

I'd recommend the folloging steps:

1. Get a text editor that supports search and replace for multiple files.
    Under Windows I use Notepad++ for that purpose. It's free + open source (GPL).   

2. Copy your entire /data directory and the .htaccess file from your gpEasy Installation
    to a folder on your local computer.
     Make a backup copy of this file/folder in case something goes wrong!

3. Open the .htaccess file
    Perform a search and replace* in your .htaccess file and in all files in your /data subdirectory:
    Replace /gpEasy/  with /

4. Copy/Overwrite .htaccess and /data/* in the gpEasy installation on your server.

Now everything should work.
(Keep your backup copies until you have checked your entire site!)

* In Notepad++ it's located in "Search" Menu -> "Find in Files". Check the checkboxes "Directory of the active file" and "Subdirectories"

Another note: I have tested a bunch of search and replace tools and quite a lot of them mess up the encoding of the files - which must remain UTF-8.
Notepad++ get's this right. If you use a different editor keep an eye on possible umlauts, diacritics and other non ASCII characters!

HTH

Edited: 6 years 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