Use of groupCollapsed

3 messages Options
Embed this post
Permalink
SaWeyy () Use of groupCollapsed
Reply Threaded More More options
Print post
Permalink
Hi,

Would it be possible to also include the console.groupCollapsed function in a next firePHP version?
this way, the grouped message is collapsed by default, I would love to use that function for my Smarty integration.

Thanx
SaWey
SaWeyy () Re: Use of groupCollapsed
Reply Threaded More More options
Print post
Permalink
Ok, I already solved this, so f you want to include it in your code:

in RequestProcessor.js of the FF plugin, find 'FirePHPProcessor.processMessage' and add:

------------------------------

else
  if(mode=='group_collapsed') {
  
    if(meta && meta.Label) {
      var row = Firebug.Console.openGroup([meta.Label], null, "group", null, true);
    } else {
      var row = Firebug.Console.openGroup([data[0]], null, "group", null, true);
    }
    removeClass(row, "opened");
    
  }

------------------------------


Then in the PHP class, add a new constant:

------------------------------

    /**
   * Starts a group in firebug console which is collapsed by default
   * 
   * @var string
   */
  const GROUP_COLLAPSED = 'GROUP_COLLAPSED';

------------------------------


Then change the group function to the one below:
------------------------------

  /**
   * Start a group for following messages
   *
   * @param string $Name
   * @return true
   * @throws Exception
   */
  public function group($Name, $collapsed = false) {
  	if($collapsed){
		return $this->fb(null, $Name, FirePHP::GROUP_COLLAPSED);
	}else{
		return $this->fb(null, $Name, FirePHP::GROUP_START);
	}
  }

------------------------------


Hopfully you can do something with it...
Christoph Dorn () Re: Use of groupCollapsed
Reply Threaded More More options
Print post
Permalink