[ 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/admin/ -> adminregisterblogview.class.php (source)

   1  <?php
   2  
   3      lt_include( PLOG_CLASS_PATH."class/view/view.class.php" );
   4      lt_include( PLOG_CLASS_PATH."class/config/config.class.php" );
   5      lt_include( PLOG_CLASS_PATH."class/locale/locales.class.php" );
   6      lt_include( PLOG_CLASS_PATH."class/template/templatesets/templatesets.class.php" );
   7      lt_include( PLOG_CLASS_PATH."class/net/http/subdomains.class.php" );
   8      lt_include( PLOG_CLASS_PATH."class/dao/blogcategories.class.php" );
   9      
  10      class AdminRegisterBlogView extends View
  11      {
  12          var $_userInfo;
  13      
  14  		function AdminRegisterBlogView( $userInfo )
  15          {
  16              $this->View();
  17              
  18              $this->_userInfo = $userInfo;
  19          }
  20          
  21  		function setUserInfo( $user )
  22          {
  23              // whatever...
  24          }
  25          
  26  		function render()
  27          {
  28              // set the view character set based on the default locale
  29              $config =& Config::getConfig();
  30              $locale =& Locales::getLocale( $config->getValue( "default_locale" ));            
  31              $this->setCharset( $locale->getCharset());        
  32          
  33              parent::render();
  34              $ts = new TemplateService();
  35              $template = $ts->AdminTemplate( "registerblog" );
  36              // assign a few values that have been loaded locally
  37              $this->setValue( "defaultLocale",
  38                               $config->getValue( "default_locale" ));
  39              $this->setValue( "locale", $locale );
  40              $this->setValue( "user", $this->_userInfo );
  41              $this->setValue( "locales", Locales::getLocales());
  42  
  43              // only do blog_domain stuff if subdomains are enabled
  44              // Don't waste time here, as well as be less confusing by
  45              // not showing the option to users who can't use it
  46              if( Subdomains::getSubdomainsEnabled()) {
  47                  $available_domains = Subdomains::getAvailableDomains();
  48                  
  49                  $subdomain = "";
  50                  $maindomain = "";
  51  
  52                  if($available_domains){
  53                      foreach($available_domains as $avdomain){
  54                          $maindomain = $avdomain;
  55                          break;
  56                      }
  57                  }
  58  
  59                  // pass the domain information to the view
  60                  $this->setValue( "blogSubDomain", $subdomain );
  61                  $this->setValue( "blogMainDomain", $maindomain );
  62                  $this->setValue( "blogAvailableDomains", $available_domains );
  63                  $this->setValue( "blogDomainsEnabled", 1 );
  64              }            
  65  
  66  
  67              $ts = new TemplateSets();
  68              $this->setValue( "templates", $ts->getGlobalTemplateSets());
  69              
  70              // and the blog categories
  71              $blogCategories = new BlogCategories();
  72              $this->setValue( "blogcategories", $blogCategories->getBlogCategories());
  73              
  74              // assign all the values
  75              $template->assign( $this->_params->getAsArray());
  76  
  77              // and send the results
  78              print $template->fetch();        
  79          }
  80      }
  81  ?>


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