Welcome to Geeklog, Anonymous Saturday, November 23 2024 @ 05:11 am EST

Geeklog Forums

Professional theme 1.8.0 break dokuwiki plugin


Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
I'm trying to update dokuwiki plugin and :banghead: on a issue :

Professional theme 1.8.0 remove unresolved variables { } from template but dokuwiki use { } in javascript script
Text Formatted Code

Instead of:

<script type="text/javascript"><!--//--><![CDATA[//> I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1470
Location:Canada
I had the same problem with the scripts class when I was passing in variables to JavaScript. The solution was to add spaces around the brackets for the JavaScript variables (take a look at the last line).

Text Formatted Code

            // Create config variable array to pass to JavaScript
            $config_js = array();
            $keys = array('site_url', 'site_admin_url', 'layout_url', 'path', 'path_html', 'path_layout',
                          'site_name', 'site_slogan',
                          'theme', 'doctype', 'path_themes');
            foreach($keys as $key){
                $config_js[$key] = $_CONF[$key];
            }            
           
            // Had to trim and add spaces to json_encode output since the data in the {} is seen by the template class as a template variable
            //$footercode .= "var GeeklogConfig = new Object(" . json_encode($config_js) . ");" . LB;
            $footercode .= "var GeeklogConfig = new Object({ ".trim(json_encode($config_js), '{}')." });" . LB;
 


To work your line should look like this:
Text Formatted Code

var NS='';var SIG=' --- //[[my-email-adress@gmail.com|Geeklog SuperUser]] 2011/06/18 09:57//';var JSINFO = { "id":"start","namespace":"" };
 


There was some talk on the mailing list to update our template variables at somepoint so we do not run into this type of situation (like the use of double brackets).
One of the Geeklog Core Developers.
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
add spaces around the brackets works :shakehands:

Just out of curiosity: Why do we remove from the template the variable with no assigned value?

Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1470
Location:Canada
Just out of curiosity: Why do we remove from the template the variable with no assigned value?


As far as I know Geeklog has always done this. I just think the JavaScript issue hasn't happened to often so most people didn't notice the problem.
One of the Geeklog Core Developers.
 Quote

All times are EST. The time is now 05:11 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content