Development

Changeset 7980

You must first sign up to be able to contribute.

Changeset 7980

Show
Ignore:
Timestamp:
03/19/08 18:23:13 (1 year ago)
Author:
fabien
Message:

added user information to the web debug toolbar

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/debug/sfDebug.class.php

    r7878 r7980  
    106106   * @return array The request parameter holders 
    107107   */ 
    108   public static function requestAsArray($request) 
     108  public static function requestAsArray(sfRequest $request) 
    109109  { 
    110110    if (!$request) 
     
    126126   * @return array The response parameters 
    127127   */ 
    128   public static function responseAsArray($response) 
     128  public static function responseAsArray(sfResponse $response) 
    129129  { 
    130130    if (!$response) 
     
    145145 
    146146  /** 
     147   * Returns user parameters as an array. 
     148   * 
     149   * @param sfUser A sfUser instance 
     150   * 
     151   * @return array The user parameters 
     152   */ 
     153  public static function userAsArray(sfUser $user) 
     154  { 
     155    if (!$user) 
     156    { 
     157      return array(); 
     158    } 
     159 
     160    return array( 
     161      'options'         => $user->getOptions(), 
     162      'attributeHolder' => self::flattenParameterHolder($user->getAttributeHolder()), 
     163      'culture'         => $user->getCulture(), 
     164    ); 
     165  } 
     166 
     167  /** 
    147168   * Returns a parameter holder as an array. 
    148169   * 
  • branches/1.1/lib/debug/sfWebDebug.class.php

    r7965 r7980  
    325325    $result .= $this->formatArrayAsHtml('request',  sfDebug::requestAsArray($context->getRequest())); 
    326326    $result .= $this->formatArrayAsHtml('response', sfDebug::responseAsArray($context->getResponse())); 
     327    $result .= $this->formatArrayAsHtml('user',     sfDebug::userAsArray($context->getUser())); 
    327328    $result .= $this->formatArrayAsHtml('settings', sfDebug::settingsAsArray()); 
    328329    $result .= $this->formatArrayAsHtml('globals',  sfDebug::globalsAsArray()); 
     
    346347    $content = ' 
    347348    <h2>'.$id.' <a href="#" onclick="sfWebDebugToggle(\'sfWebDebug'.$id.'\'); return false;">'.image_tag(sfConfig::get('sf_web_debug_web_dir').'/images/toggle.gif').'</a></h2> 
    348     <div id="sfWebDebug'.$id.'" style="display: none"><pre>'.htmlspecialchars(@sfYaml::dump($values), ENT_QUOTES, sfConfig::get('sf_charset')).'</pre></div> 
     349    <div id="sfWebDebug'.$id.'" style="display: none"><pre>'.htmlspecialchars(sfYaml::dump($values), ENT_QUOTES, sfConfig::get('sf_charset')).'</pre></div> 
    349350    '; 
    350351 
  • branches/1.1/lib/user/sfUser.class.php

    r7970 r7980  
    118118  } 
    119119 
     120  public function getOptions() 
     121  { 
     122    return $this->options; 
     123  } 
     124 
    120125  /** 
    121126   * Sets the user culture. 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.