Source for file SimpleTheme.class.php

Documentation is available at SimpleTheme.class.php

  1. <?php
  2.  
  3. require_once(HARMONI."GUIManager/Theme.class.php");
  4.  
  5. require_once(HARMONI."GUIManager/StyleCollection.class.php");
  6.  
  7. require_once(HARMONI."GUIManager/StyleProperties/BackgroundColorSP.class.php");
  8. require_once(HARMONI."GUIManager/StyleProperties/ColorSP.class.php");
  9. require_once(HARMONI."GUIManager/StyleProperties/BorderSP.class.php");
  10. require_once(HARMONI."GUIManager/StyleProperties/BorderTopSP.class.php");
  11. require_once(HARMONI."GUIManager/StyleProperties/BorderRightSP.class.php");
  12. require_once(HARMONI."GUIManager/StyleProperties/BorderBottomSP.class.php");
  13. require_once(HARMONI."GUIManager/StyleProperties/BorderLeftSP.class.php");
  14. require_once(HARMONI."GUIManager/StyleProperties/MarginSP.class.php");
  15. require_once(HARMONI."GUIManager/StyleProperties/PaddingSP.class.php");
  16. require_once(HARMONI."GUIManager/StyleProperties/FontSP.class.php");
  17. require_once(HARMONI."GUIManager/StyleProperties/FontFamilySP.class.php");
  18. require_once(HARMONI."GUIManager/StyleProperties/FontSizeSP.class.php");
  19. require_once(HARMONI."GUIManager/StyleProperties/FontWeightSP.class.php");
  20. require_once(HARMONI."GUIManager/StyleProperties/TextAlignSP.class.php");
  21. require_once(HARMONI."GUIManager/StyleProperties/TextDecorationSP.class.php");
  22. require_once(HARMONI."GUIManager/StyleProperties/DisplaySP.class.php");
  23.  
  24. /**
  25. * A simple theme with rounded boxes.
  26. *
  27. * @package harmoni.gui.themes
  28. *
  29. * @copyright Copyright &copy; 2005, Middlebury College
  30. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  31. *
  32. * @version $Id: SimpleTheme.class.php,v 1.7 2007/09/04 20:25:23 adamfranco Exp $
  33. */
  34. class SimpleTheme extends Theme {
  35.  
  36. /**
  37. * The constructor. All initialization and Theme customization is performed
  38. * here.
  39. * @access public
  40. ***/
  41. function SimpleTheme() {
  42. $this->Theme("Simple Theme", "A simple theme with rounded boxes.");
  43. // =====================================================================
  44. // global Theme style
  45. $body = new StyleCollection("body", null, "Global Style", "Style settings affecting the overall look and feel.");
  46. $body->addSP(new BackgroundColorSP("#FFF"));
  47. $body->addSP(new ColorSP("#000"));
  48. //$body->addSP(new FontFamilySP("Verdana"));
  49. $body->addSP(new PaddingSP("0px"));
  50. $body->addSP(new MarginSP("0px"));
  51. $this->addGlobalStyle($body);
  52.  
  53. // $links = new StyleCollection("a", null, "Link Style", "Style settings affecting the look and feel of links.");
  54. // $links->addSP(new TextDecorationSP("underline"));
  55. // $this->addGlobalStyle($links);
  56. //
  57. // $links_hover = new StyleCollection("a:hover", null, "Link Hover Style", "Style settings affecting the look and feel of hover links.");
  58. // $links_hover->addSP(new TextDecorationSP("underline"));
  59. // $this->addGlobalStyle($links_hover);
  60. //
  61. // =====================================================================
  62. // Block 1 style
  63. $block1 = new StyleCollection("*.block1", "block1", "Block 1", "The main block where normally all of the page content goes in.");
  64. $block1->addSP(new BackgroundColorSP("#DDD"));
  65. $block1->addSP(new PaddingSP("10px"));
  66. $block1->addSP(new MarginSP("10px"));
  67. $this->addStyleForComponentType($block1, BLOCK, 1);
  68. //
  69. // // =====================================================================
  70. // // Block 2 style
  71. // $block2 = new StyleCollection("*.block2", "block2", "Block 2", "A 2nd level block.");
  72. // //$block2->addSP(new PaddingSP("10px"));
  73. // $block2->addSP(new TextAlignSP("justify"));
  74. // $this->addStyleForComponentType($block2, BLOCK, 2);
  75. //
  76. // // =====================================================================
  77. // // Block 3 style
  78. // $block3 = new StyleCollection("*.block3", "block3", "Block 3", "A 3rd level block.");
  79. // //$block3->addSP(new BackgroundColorSP("#FFFFFF"));
  80. // //$block3->addSP(new ColorSP("#000"));
  81. // //$block3->addSP(new BorderSP("1px", "solid", "#000"));
  82. // $block3->addSP(new PaddingSP("10px"));
  83. // $block3->addSP(new TextAlignSP("justify"));
  84. // $this->addStyleForComponentType($block3, BLOCK, 3);
  85. //
  86. // // =====================================================================
  87. // // Block 4 style
  88. // $block4 = new StyleCollection("*.block4", "block4", "Block 4", "A 4th level block.");
  89. // $block4->addSP(new BackgroundColorSP("#D4D4D4"));
  90. // $block4->addSP(new ColorSP("#000"));
  91. // $block4->addSP(new BorderTopSP("1px", "solid", "#000"));
  92. // $block4->addSP(new BorderRightSP("1px", "solid", "#000"));
  93. // $block4->addSP(new BorderBottomSP("1px", "solid", "#000"));
  94. // $block4->addSP(new BorderLeftSP("1px", "solid", "#000"));
  95. // $block4->addSP(new PaddingSP("10px"));
  96. // $block4->addSP(new MarginSP("10px"));
  97. // $this->addStyleForComponentType($block4, BLOCK, 4);
  98. //
  99. // // =====================================================================
  100. // // Heading 1 style
  101. // $heading1 = new StyleCollection("*.heading1", "heading1", "Heading 1", "A 1st level heading.");
  102. // $heading1->addSP(new ColorSP("#F00"));
  103. // $heading1->addSP(new FontSizeSP("200%"));
  104. // $this->addStyleForComponentType($heading1, HEADING, 1);
  105. //
  106. // // =====================================================================
  107. // // Heading 2 style
  108. // $heading2 = new StyleCollection("*.heading2", "heading2", "Heading 2", "A 2nd level heading.");
  109. // $heading2->addSP(new BackgroundColorSP("#D4D4D4"));
  110. // $heading2->addSP(new ColorSP("#007"));
  111. // $heading2->addSP(new FontSizeSP("125%"));
  112. // $heading2->addSP(new PaddingSP("10px"));
  113. // $heading2->addSP(new MarginSP("10px"));
  114. // $heading2->addSP(new BorderTopSP("1px", "solid", "#000"));
  115. // $this->addStyleForComponentType($heading2, HEADING, 2);
  116. //
  117. // // =====================================================================
  118. // // Footer 1 style
  119. // $footer1 = new StyleCollection("*.footer1", "footer1", "Footer 1", "A 1st level footer.");
  120. // $footer1->addSP(new ColorSP("#959595"));
  121. // $footer1->addSP(new MarginSP("10px"));
  122. // $footer1->addSP(new FontSizeSP("125%"));
  123. // $this->addStyleForComponentType($footer1, FOOTER, 1);
  124. //
  125. // // =====================================================================
  126. // // Menu 1 style
  127. // $menu1 = new StyleCollection("*.menu1", "menu1", "Menu 1", "A 1st level menu.");
  128. // $menu1->addSP(new BackgroundColorSP("#D4D4D4"));
  129. // $menu1->addSP(new ColorSP("#000"));
  130. // $menu1->addSP(new BorderSP("1px", "solid", "#000"));
  131. // $this->addStyleForComponentType($menu1, MENU, 1);
  132. //
  133. // // =====================================================================
  134. // // Menu Heading 1 style
  135. // $menuHeading1 = new StyleCollection("*.menuHeading1", "menuHeading1", "Menu Heading 1", "A 1st level menu heading.");
  136. // $menuHeading1->addSP(new DisplaySP("block"));
  137. // $menuHeading1->addSP(new BackgroundColorSP("#AAA"));
  138. // $menuHeading1->addSP(new PaddingSP("10px"));
  139. // //$menuHeading1->addSP(new FontWeightSP("bold"));
  140. // $this->addStyleForComponentType($menuHeading1, MENU_ITEM_HEADING, 1);
  141. //
  142. // // =====================================================================
  143. // // Menu Unselected Link 1 style
  144. // $menuLink1_unselected = new StyleCollection("*.menuLink1_unselected a", "menuLink1_unselected", "Unselected Menu Link 1", "A 1st level unselected menu link.");
  145. // $menuLink1_unselected->addSP(new DisplaySP("block"));
  146. // $menuLink1_unselected->addSP(new BackgroundColorSP("#D4D4D4"));
  147. // $menuLink1_unselected->addSP(new PaddingSP("10px"));
  148. // $this->addStyleForComponentType($menuLink1_unselected, MENU_ITEM_LINK_UNSELECTED, 1);
  149. //
  150. // $menuLink1_hover = new StyleCollection("*.menuLink1_hover a:hover", "menuLink1_hover", "Menu Link 1 Hover", "A 1st level menu link hover behavior.");
  151. // $menuLink1_hover->addSP(new BackgroundColorSP("#AAA"));
  152. // $this->addStyleForComponentType($menuLink1_hover, MENU_ITEM_LINK_UNSELECTED, 1);
  153. //
  154. // // =====================================================================
  155. // // Menu Selected Link 1 style
  156. // $menuLink1_selected = new StyleCollection("*.menuLink1_selected a", "menuLink1_selected", "Selected Menu Link 1", "A 1st level selected menu link.");
  157. // $menuLink1_selected->addSP(new DisplaySP("block"));
  158. // $menuLink1_selected->addSP(new BackgroundColorSP("#AAA"));
  159. // $menuLink1_selected->addSP(new PaddingSP("10px"));
  160. // $this->addStyleForComponentType($menuLink1_selected, MENU_ITEM_LINK_SELECTED, 1);
  161. }
  162.  
  163.  
  164. }
  165.  
  166. ?>

Documentation generated on Wed, 19 Sep 2007 10:26:32 -0400 by phpDocumentor 1.3.0RC3