Author: Crafty_Shadow
Date: 2010-02-09 12:17:31 +0100 (Tue, 09 Feb 2010)
New Revision: 27778

Modified:
   
plugins/diemPlugin/trunk/dmCorePlugin/lib/view/html/layout/dmCoreLayoutHelper.php
   plugins/diemPlugin/trunk/dmFrontPlugin/modules/dmFront/templates/layout.php
   
plugins/diemPlugin/trunk/dmFrontPlugin/modules/dmFront/templates/pageSuccess.php
Log:
[Diem] Proper doctypes generation + compliant html for each doctype

Modified: 
plugins/diemPlugin/trunk/dmCorePlugin/lib/view/html/layout/dmCoreLayoutHelper.php
===================================================================
--- 
plugins/diemPlugin/trunk/dmCorePlugin/lib/view/html/layout/dmCoreLayoutHelper.php
   2010-02-09 09:31:14 UTC (rev 27777)
+++ 
plugins/diemPlugin/trunk/dmCorePlugin/lib/view/html/layout/dmCoreLayoutHelper.php
   2010-02-09 11:17:31 UTC (rev 27778)
@@ -6,7 +6,9 @@
     $dispatcher,
     $serviceContainer,
     $baseWebPath,
+    $isHtml4,
     $isHtml5;
+    
 
   public function __construct(sfEventDispatcher $dispatcher, 
dmBaseServiceContainer $serviceContainer)
   {
@@ -18,6 +20,7 @@
   
   protected function initialize()
   {
+    $this->isHtml4 = 4 == $this->getDocTypeOption('version', 4);
     $this->isHtml5 = 5 == $this->getDocTypeOption('version', 5);
   }
   
@@ -60,13 +63,17 @@
     {
       $doctype = '<!DOCTYPE html>';
     }
+    else if ($this->isHtml4)
+    {
+      $doctype = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd";>';
+    }
     else
     {
       $doctype = sprintf(
-        '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML %s %s//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-%s.dtd";>',
+        '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML %s%s//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1%s.dtd";>',
         $this->getDocTypeOption('version', '1.0'),
-        ucfirst(strtolower($this->getDocTypeOption('compliance', 
'transitional'))),
-        strtolower($this->getDocTypeOption('compliance', 'transitional'))
+        '1.1' == $this->getDocTypeOption('version', '1.0') ? ''  : ' 
'.ucfirst(strtolower($this->getDocTypeOption('compliance', 'transitional'))),
+        '1.1' == $this->getDocTypeOption('version', '1.0') ? '1' : 
'-'.strtolower($this->getDocTypeOption('compliance', 'transitional'))
       );
     }
     
@@ -75,7 +82,7 @@
   
   public function renderHtmlTag()
   {
-    if ($this->isHtml5())
+    if ($this->isHtml5() || $this->isHtml4)
     {
       return '<html>';
     }
@@ -83,9 +90,9 @@
     $culture = $this->serviceContainer->getParameter('user.culture');
 
     return sprintf(
-      '<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="%s" lang="%s">',
+      '<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="%s" >',
       $culture,
-      $culture
+      '1.1' == $this->getDocTypeOption('version', '1.0') ? '' : 
"lang=\"$culture\""
     );
   }
   

Modified: 
plugins/diemPlugin/trunk/dmFrontPlugin/modules/dmFront/templates/layout.php
===================================================================
--- plugins/diemPlugin/trunk/dmFrontPlugin/modules/dmFront/templates/layout.php 
2010-02-09 09:31:14 UTC (rev 27777)
+++ plugins/diemPlugin/trunk/dmFrontPlugin/modules/dmFront/templates/layout.php 
2010-02-09 11:17:31 UTC (rev 27778)
@@ -1,5 +1,5 @@
 <?php
-
+/** @var dmCoreLayoutHelper */
 $helper = $sf_context->get('layout_helper');
 
 echo 

Modified: 
plugins/diemPlugin/trunk/dmFrontPlugin/modules/dmFront/templates/pageSuccess.php
===================================================================
--- 
plugins/diemPlugin/trunk/dmFrontPlugin/modules/dmFront/templates/pageSuccess.php
    2010-02-09 09:31:14 UTC (rev 27777)
+++ 
plugins/diemPlugin/trunk/dmFrontPlugin/modules/dmFront/templates/pageSuccess.php
    2010-02-09 11:17:31 UTC (rev 27778)
@@ -9,7 +9,7 @@
  */
 ?>
 
-<div id="dm_page" class="<?php $isEditMode && print 'edit' ?>">
+<div id="dm_page" <?php $isEditMode && print 'class="edit"' ?>>
 
   <div class="layout">
 

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to