[ 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/summary/view/ -> summaryview.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/templateservice.class.php" );
   5      lt_include( PLOG_CLASS_PATH."class/locale/locales.class.php" );
   6      lt_include( PLOG_CLASS_PATH."class/config/config.class.php" );
   7  
   8      class SummaryView extends View
   9      {
  10  
  11          var $_templateName;
  12          var $_templateFolder;
  13  
  14          function SummaryView( $templateName, $templateFolder = "summary" )
  15          {
  16              $this->View();
  17              $this->_templateName = $templateName;
  18              $this->_templateFolder = $templateFolder;
  19          }
  20  
  21          /**
  22           * @private
  23           */
  24          function _getLocale()
  25          {
  26              // load the Locale object from the view context or initialize it now
  27              if( $this->_params->keyExists( "locale" )) {
  28                  $this->_locale = $this->_params->getValue( "locale" );
  29              }
  30              else {
  31                  $config =& Config::getConfig();
  32                  $this->_locale =& Locales::getLocale( $config->getValue("default_locale" ));
  33              }
  34          }
  35  
  36          function render()
  37          {
  38              // fetch the baseurl
  39              $config =& Config::getConfig();
  40              $baseurl = $config->getValue( "base_url" );
  41  
  42              // load the locale
  43              $this->_getLocale();
  44              // set the view character set based on the locale
  45              $this->setCharset( $this->_locale->getCharset());
  46  
  47              parent::render();
  48  
  49              $templateService = new TemplateService();
  50              $template = $templateService->customTemplate( $this->_templateName, $this->_templateFolder );
  51  
  52              $this->_params->setValue( "version", new Version());
  53              $this->_params->setValue( "locale", $this->_locale );
  54              $this->_params->setValue( "baseurl", $baseurl);
  55              $this->_params->setValue( "serviceName", $config->getValue( "summary_service_name" ));            
  56              lt_include( PLOG_CLASS_PATH."class/summary/net/summaryrequestgenerator.class.php" );
  57              $this->_params->setValue( "url", new SummaryRequestGenerator());
  58  
  59              $template->assign( $this->_params->getAsArray());
  60              print $template->fetch();
  61          }
  62      }
  63  ?>


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