[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/view/ -> trackbackview.class.php (source)

   1  <?php
   2  
   3      lt_include( PLOG_CLASS_PATH."class/view/view.class.php" );
   4      lt_include( PLOG_CLASS_PATH."class/template/templatesets/templatesetstorage.class.php" );
   5      lt_include( PLOG_CLASS_PATH."class/template/templateservice.class.php" );    
   6      
   7      /**
   8       * \ingroup View
   9       * @private
  10       *
  11       * Provides XML-based responses to trackback requests
  12       */
  13      class TrackbackView extends View
  14      {
  15      
  16          var $_profile;
  17  
  18      	function TrackbackView( $message, $error = false )
  19          {
  20              $this->View();
  21          
  22              $ts = new TemplateSetStorage();
  23  
  24              // we need to overwrite the $this->_template object with the Template object of our choice...
  25              $templateService = new TemplateService();
  26              $this->_template = $templateService->Template( 'trackback', 'misc' );
  27              
  28              // set the correct content type
  29              $this->setContentType( 'text/xml' );
  30              
  31              $this->setValue( "message", $message );
  32              if( $error ) $errorCode = 1;
  33              else $errorCode = 0;
  34              $this->setValue( "error", $errorCode );
  35          }
  36          
  37          /**
  38           * View::render() does not implement any rendering logic so we'll have to provide our own
  39           * @private
  40           */
  41  		function render()
  42          {
  43              parent::render();
  44          
  45              // pass all the data to the template
  46              $this->_template->assign( $this->_params->getAsArray());
  47              // and render it
  48              $response = $this->_template->fetch();
  49              
  50              AddTrackbackAction::tblog( "*** Sending response ***" );
  51              AddTrackbackAction::tblog(  $response );
  52              
  53              print( $response );
  54          }
  55      }
  56  ?>


Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics