[pLog-svn] r3576 - plog/trunk/class/view/admin

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Wed Jun 14 09:55:13 GMT 2006


Author: jondaley
Date: 2006-06-14 09:55:13 +0000 (Wed, 14 Jun 2006)
New Revision: 3576

Modified:
   plog/trunk/class/view/admin/adminregisterblogview.class.php
Log:
added multi-domain code

Modified: plog/trunk/class/view/admin/adminregisterblogview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminregisterblogview.class.php	2006-06-14 09:54:51 UTC (rev 3575)
+++ plog/trunk/class/view/admin/adminregisterblogview.class.php	2006-06-14 09:55:13 UTC (rev 3576)
@@ -4,6 +4,7 @@
 	include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
 	include_once( PLOG_CLASS_PATH."class/locale/locales.class.php" );
 	include_once( PLOG_CLASS_PATH."class/template/templatesets/templatesets.class.php" );
+	include_once( PLOG_CLASS_PATH."class/net/http/subdomains.class.php" );
 	
 	class AdminRegisterBlogView extends View
 	{
@@ -37,6 +38,31 @@
             $this->setValue( "locale", $locale );
             $this->setValue( "user", $this->_userInfo );
             $this->setValue( "locales", Locales::getLocales());
+
+            // only do blog_domain stuff if subdomains are enabled
+            // Don't waste time here, as well as be less confusing by
+            // not showing the option to users who can't use it
+            if( Subdomains::getSubdomainsEnabled()) {
+				$available_domains = Subdomains::getAvailableDomains();
+                
+                $subdomain = "";
+                $maindomain = "";
+
+                if($available_domains){
+                    foreach($available_domains as $avdomain){
+                        $maindomain = $avdomain;
+                        break;
+                    }
+                }
+
+                // pass the domain information to the view
+                $this->setValue( "blogSubDomain", $subdomain );
+                $this->setValue( "blogMainDomain", $maindomain );
+                $this->setValue( "blogAvailableDomains", $available_domains );
+                $this->setValue( "blogDomainsEnabled", 1 );
+            }			
+
+
             $ts = new TemplateSets();
             $this->setValue( "templates", $ts->getGlobalTemplateSets());
             // assign all the values



More information about the pLog-svn mailing list