Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Smarty debug console & popup blockers

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
g00fy
Smarty Rookie


Joined: 07 Dec 2005
Posts: 19

PostPosted: Sat Mar 05, 2011 7:26 am    Post subject: Smarty debug console & popup blockers Reply with quote

Hi,

When using a popup blocker, the _smarty_console (in debug.tpl) is not defined. My proposal would be to adapt debug.tpl and capture this:

Code:
    if ( _smarty_console ) _smarty_console.document.write("{$debug_output|escape:'javascript'}");
    if ( _smarty_console ) _smarty_console.document.close();


If this is not done, there will be an error thrown. The end-user will still see in the major browsers that a popup was blocked via the normal ways.

And when we're extending this debug.tpl I propose to extend it even more to make it even more usefull for developers like me:
Code:
{function name=write_next}
  {if isset($var1) && (count($var1) > 0)}
  <h2>{$var2}</h2>

  <table id="{$var2}">
      {foreach $var1 as $vars}
         <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">   
         <th>{$vars@key|escape:'html'}</th>
         <td>{$vars|debug_print_var}</td></tr>
      {/foreach}
  </table>
  {/if}
{/function}

{write_next var1=$smarty.get var2="_GET"}
{write_next var1=$smarty.post var2="_POST"}
{write_next var1=$smarty.cookies var2="_COOKIE"}
{write_next var1=$smarty.session var2="_SESSION"}
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP