Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

[Debug Console] Switching easy between showing variables or files

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-02-2009, 02:11 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Lightbulb [Debug Console] Switching easy between showing variables or files

Hi Guys,

By default in smarty.php $smarty->debug_tpl = "file:debug_templates.tpl";. Setting up this value means showing the template files in the Debugging Console.

I would like to insert a check box in Admin before activating the Webmaster mode. When this box is checked to set up $smarty->debug_tpl = "file:debug.tpl";. This means to switch showing smarty variables instead of template files.

Could anyone help?
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #2  
Old 01-02-2009, 04:58 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: [Debug Console] Switching easy between showing variables or files

That's a great idea... instead of having to edit the file before every variable search - a checkbox! I am subscribing to this thread. Hope someone knows how to do this.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #3  
Old 01-02-2009, 06:58 AM
  Ene's Avatar 
Ene Ene is offline
 

X-Cart team
  
Join Date: Aug 2004
Posts: 907
 

Default Re: [Debug Console] Switching easy between showing variables or files

Download the attached debug_templates.tpl template.
Backup the existing one. Then upload the new one.

That's all.
Attached Thumbnails
Click image for larger version

Name:	debug.png
Views:	281
Size:	8.5 KB
ID:	1301  Click image for larger version

Name:	debug1.png
Views:	301
Size:	31.3 KB
ID:	1302  
Attached Files
File Type: tpl debug_templates.tpl (4.7 KB, 217 views)
__________________
Eugene Kaznacheev,
Evangelist/Product Manager at Ecwid: http://www.ecwid.com/ (since Sept 2009)

ex-Head of X-Cart Tech Support Department
ex- X-Cart Hosting Manager - X-Cart hosting
ex-X-Cart Technical Support Engineer


Note: For the official guaranteed tech support services please turn to the Customers HelpDesk.
Reply With Quote

The following 4 users thank Ene for this useful post:
am2003 (08-04-2009), andrewmattress (03-05-2013), carpeperdiem (08-11-2009), gb2world (06-28-2009)
  #4  
Old 01-02-2009, 07:19 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default Re: [Debug Console] Switching easy between showing variables or files

Wow! Very good!

How can I make this window by default to show the variables not the files?

P.S. This forum is a treasure with a lot of value people. Keep going!
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #5  
Old 01-03-2009, 07:25 AM
  Ene's Avatar 
Ene Ene is offline
 

X-Cart team
  
Join Date: Aug 2004
Posts: 907
 

Default Re: [Debug Console] Switching easy between showing variables or files

Edit the debug_templates.tpl file.

Replace this line:

HTML Code:
_smarty_console.document.getElementById('vars').style.display = 'none';

with the:

HTML Code:
_smarty_console.document.getElementById('templates').style.display = 'none';
__________________
Eugene Kaznacheev,
Evangelist/Product Manager at Ecwid: http://www.ecwid.com/ (since Sept 2009)

ex-Head of X-Cart Tech Support Department
ex- X-Cart Hosting Manager - X-Cart hosting
ex-X-Cart Technical Support Engineer


Note: For the official guaranteed tech support services please turn to the Customers HelpDesk.
Reply With Quote

The following 3 users thank Ene for this useful post:
am2003 (08-19-2009), andrewmattress (03-05-2013), carpeperdiem (08-11-2009)
  #6  
Old 01-11-2009, 12:43 PM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default Re: [Debug Console] Switching easy between showing variables or files

Works fine. Nice tip!
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #7  
Old 08-19-2009, 04:45 PM
 
ozchris ozchris is offline
 

Senior Member
  
Join Date: Jun 2007
Posts: 100
 

Default Re: [Debug Console] Switching easy between showing variables or files

I tried this on an old site running 4.1.9 and got the message:

Error
: Smarty error: [in file:debug_templates.tpl line 10]: [plugin] modifier 'wm_remove' is not implemented (core.load_plugins.php, line 11 in C:\xampp\htdocs\mysite\Smarty-2.6.12\Smarty.class.php on line 1095
__________________
Linux. Apache. PHP 5.2
Site 1 - now xcart 4.4.1 DSEFU, AOM, RMA, Magnifier, Upsells. Heavy mods for Australian postcode validation and extra Aussie payment method.
Site 2 - xcart 4.1.11, DSEFU
Site 3 - xcart 4.2
Site 4 - xcart 4.3
Reply With Quote
  #8  
Old 08-19-2009, 04:59 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: [Debug Console] Switching easy between showing variables or files

Open the template and delete all instances of "wm_remove"
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
andrewmattress (03-05-2013)
  #9  
Old 08-19-2009, 07:29 PM
 
ozchris ozchris is offline
 

Senior Member
  
Join Date: Jun 2007
Posts: 100
 

Default Re: [Debug Console] Switching easy between showing variables or files

cflsystems, you're beautiful!
__________________
Linux. Apache. PHP 5.2
Site 1 - now xcart 4.4.1 DSEFU, AOM, RMA, Magnifier, Upsells. Heavy mods for Australian postcode validation and extra Aussie payment method.
Site 2 - xcart 4.1.11, DSEFU
Site 3 - xcart 4.2
Site 4 - xcart 4.3
Reply With Quote
  #10  
Old 03-05-2013, 07:58 AM
 
andrewmattress andrewmattress is offline
 

Advanced Member
  
Join Date: Feb 2013
Posts: 39
 

Default Re: [Debug Console] Switching easy between showing variables or files

This was very helpful. Thank-you very much!
__________________
JK
X-Cart version 4.7
We have about lots of add-on modules.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:55 PM.

   

 
X-Cart forums © 2001-2020