PageRenderTime 77ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/osCommerce/OM/Core/Site/Shop/templates/oscom.php

http://github.com/osCommerce/oscommerce
PHP | 334 lines | 239 code | 82 blank | 13 comment | 46 complexity | 464aeac451dc7071aa96d37c221ebf00 MD5 | raw file
  1. <?php
  2. /**
  3. * osCommerce Online Merchant
  4. *
  5. * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
  6. * @license BSD License; http://www.oscommerce.com/bsdlicense.txt
  7. */
  8. use osCommerce\OM\Core\HTML;
  9. use osCommerce\OM\Core\OSCOM;
  10. use osCommerce\OM\Core\Registry;
  11. ?>
  12. <!doctype html>
  13. <html dir="<?php echo $OSCOM_Language->getTextDirection(); ?>" lang="<?php echo $OSCOM_Language->getCode(); ?>">
  14. <head>
  15. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $OSCOM_Language->getCharacterSet(); ?>" />
  16. <title><?php echo STORE_NAME . ($OSCOM_Template->hasPageTitle() ? ': ' . $OSCOM_Template->getPageTitle() : ''); ?></title>
  17. <link rel="icon" type="image/png" href="<?php echo OSCOM::getPublicSiteLink('images/store_icon.png'); ?>" />
  18. <meta name="generator" value="osCommerce Online Merchant" />
  19. <script type="text/javascript" src="public/external/jquery/jquery-1.7.1.min.js"></script>
  20. <link rel="stylesheet" type="text/css" href="public/external/jquery/ui/themes/start/jquery-ui-1.8.16.custom.css" />
  21. <script type="text/javascript" src="public/external/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script>
  22. <link rel="stylesheet" type="text/css" href="<?php echo OSCOM::getPublicSiteLink('templates/oscom/stylesheets/general.css'); ?>" />
  23. <?php
  24. if ( $OSCOM_Template->hasPageTags() ) {
  25. echo $OSCOM_Template->getPageTags();
  26. }
  27. if ($OSCOM_Template->hasJavascript()) {
  28. $OSCOM_Template->getJavascript();
  29. }
  30. ?>
  31. </head>
  32. <body>
  33. <div id="pageBlockLeft">
  34. <div id="pageContent">
  35. <?php
  36. if ( $OSCOM_MessageStack->exists('header') ) {
  37. echo $OSCOM_MessageStack->get('header');
  38. }
  39. if ( $OSCOM_Template->hasPageContentModules() ) {
  40. foreach ( $OSCOM_Service->getCallBeforePageContent() as $service ) {
  41. Registry::get($service[0])->$service[1]();
  42. }
  43. foreach ( $OSCOM_Template->getContentModules('before') as $content_module ) {
  44. $OSCOM_ContentModule = new $content_module();
  45. $OSCOM_ContentModule->initialize();
  46. if ( $OSCOM_ContentModule->hasContent() ) { // HPDL move logic elsewhere
  47. if ( $OSCOM_Template->getCode() == DEFAULT_TEMPLATE ) {
  48. include(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/Module/Content/' . $OSCOM_ContentModule->getCode() . '/pages/main.php');
  49. } else { //HPDL old
  50. if (file_exists('templates/' . $osC_Template->getCode() . '/modules/content/' . $osC_Box->getCode() . '.php')) {
  51. include('templates/' . $osC_Template->getCode() . '/modules/content/' . $osC_Box->getCode() . '.php');
  52. } else {
  53. include('templates/' . DEFAULT_TEMPLATE . '/modules/content/' . $osC_Box->getCode() . '.php');
  54. }
  55. }
  56. }
  57. unset($OSCOM_ContentModule);
  58. }
  59. }
  60. if ( $OSCOM_Template->getCode() == DEFAULT_TEMPLATE ) {
  61. include(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/Application/' . OSCOM::getSiteApplication() . '/pages/' . $OSCOM_Template->getPageContentsFilename());
  62. } else { // HPDL old
  63. if (file_exists('templates/' . $osC_Template->getCode() . '/content/' . $osC_Template->getGroup() . '/' . $osC_Template->getPageContentsFilename())) {
  64. include('templates/' . $osC_Template->getCode() . '/content/' . $osC_Template->getGroup() . '/' . $osC_Template->getPageContentsFilename());
  65. } else {
  66. include('templates/' . DEFAULT_TEMPLATE . '/content/' . $osC_Template->getGroup() . '/' . $osC_Template->getPageContentsFilename());
  67. }
  68. }
  69. ?>
  70. <div style="clear: both;"></div>
  71. <?php
  72. if ( $OSCOM_Template->hasPageContentModules() ) {
  73. foreach ( $OSCOM_Service->getCallAfterPageContent() as $service ) {
  74. Registry::get($service[0])->$service[1]();
  75. }
  76. foreach ( $OSCOM_Template->getContentModules('after') as $content_module ) {
  77. $OSCOM_ContentModule = new $content_module();
  78. $OSCOM_ContentModule->initialize();
  79. if ( $OSCOM_ContentModule->hasContent() ) { // HPDL move logic elsewhere
  80. if ( $OSCOM_Template->getCode() == DEFAULT_TEMPLATE ) {
  81. include(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/Module/Content/' . $OSCOM_ContentModule->getCode() . '/pages/main.php');
  82. } else { //HPDL old
  83. if (file_exists('templates/' . $osC_Template->getCode() . '/modules/content/' . $osC_Box->getCode() . '.php')) {
  84. include('templates/' . $osC_Template->getCode() . '/modules/content/' . $osC_Box->getCode() . '.php');
  85. } else {
  86. include('templates/' . DEFAULT_TEMPLATE . '/modules/content/' . $osC_Box->getCode() . '.php');
  87. }
  88. }
  89. }
  90. unset($OSCOM_ContentModule);
  91. }
  92. }
  93. ?>
  94. </div>
  95. <?php
  96. $content_left = '';
  97. if ( $OSCOM_Template->hasPageBoxModules() ) {
  98. ob_start();
  99. foreach ( $OSCOM_Template->getBoxModules('left') as $box ) {
  100. $OSCOM_Box = new $box();
  101. $OSCOM_Box->initialize();
  102. if ( $OSCOM_Box->hasContent() ) { // HPDL move logic elsewhere
  103. if ( $OSCOM_Template->getCode() == DEFAULT_TEMPLATE ) {
  104. include(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/Module/Box/' . $OSCOM_Box->getCode() . '/pages/main.php');
  105. } else { //HPDL old
  106. if (file_exists('templates/' . $osC_Template->getCode() . '/modules/boxes/' . $osC_Box->getCode() . '.php')) {
  107. include('templates/' . $osC_Template->getCode() . '/modules/boxes/' . $osC_Box->getCode() . '.php');
  108. } else {
  109. include('templates/' . DEFAULT_TEMPLATE . '/modules/boxes/' . $osC_Box->getCode() . '.php');
  110. }
  111. }
  112. }
  113. unset($OSCOM_Box);
  114. }
  115. $content_left = ob_get_contents();
  116. ob_end_clean();
  117. }
  118. if ( !empty($content_left) ) {
  119. ?>
  120. <div id="pageColumnLeft">
  121. <div class="boxGroup">
  122. <?php
  123. echo $content_left;
  124. ?>
  125. </div>
  126. </div>
  127. <?php
  128. } else {
  129. ?>
  130. <style type="text/css">
  131. #pageContent {
  132. width: 99%;
  133. padding-left: 5px;
  134. }
  135. </style>
  136. <?php
  137. }
  138. ?>
  139. </div>
  140. <?php
  141. $content_right = '';
  142. if ( $OSCOM_Template->hasPageBoxModules() ) {
  143. ob_start();
  144. foreach ( $OSCOM_Template->getBoxModules('right') as $box ) {
  145. $OSCOM_Box = new $box();
  146. $OSCOM_Box->initialize();
  147. if ( $OSCOM_Box->hasContent() ) { // HPDL move logic elsewhere
  148. if ( $OSCOM_Template->getCode() == DEFAULT_TEMPLATE ) {
  149. include(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/Module/Box/' . $OSCOM_Box->getCode() . '/pages/main.php');
  150. } else { //HPDL old
  151. if (file_exists('templates/' . $osC_Template->getCode() . '/modules/boxes/' . $osC_Box->getCode() . '.php')) {
  152. include('templates/' . $osC_Template->getCode() . '/modules/boxes/' . $osC_Box->getCode() . '.php');
  153. } else {
  154. include('templates/' . DEFAULT_TEMPLATE . '/modules/boxes/' . $osC_Box->getCode() . '.php');
  155. }
  156. }
  157. }
  158. unset($OSCOM_Box);
  159. }
  160. $content_right = ob_get_contents();
  161. ob_end_clean();
  162. }
  163. if (!empty($content_right)) {
  164. ?>
  165. <div id="pageColumnRight">
  166. <div class="boxGroup">
  167. <?php
  168. echo $content_right;
  169. ?>
  170. </div>
  171. </div>
  172. <?php
  173. } elseif (empty($content_left)) {
  174. ?>
  175. <style type="text/css"><!--
  176. #pageBlockLeft {
  177. width: 99%;
  178. }
  179. //--></style>
  180. <?php
  181. } else {
  182. ?>
  183. <style type="text/css"><!--
  184. #pageContent {
  185. width: 82%;
  186. padding-right: 5px;
  187. }
  188. #pageBlockLeft {
  189. width: 99%;
  190. }
  191. #pageColumnLeft {
  192. width: 16%;
  193. }
  194. //--></style>
  195. <?php
  196. }
  197. unset($content_left);
  198. unset($content_right);
  199. if ( $OSCOM_Template->hasPageHeader() ) {
  200. ?>
  201. <div id="pageHeader">
  202. <?php
  203. echo HTML::link(OSCOM::getLink(OSCOM::getDefaultSite(), OSCOM::getDefaultSiteApplication()), HTML::image(OSCOM::getPublicSiteLink('images/store_logo.png'), STORE_NAME), 'id="siteLogo"');
  204. ?>
  205. <div id="navigationIcons">
  206. <?php
  207. echo HTML::button(array('title' => OSCOM::getDef('cart_contents') . ($OSCOM_ShoppingCart->numberOfItems() > 0 ? ' (' . $OSCOM_ShoppingCart->numberOfItems() . ')' : ''), 'icon' => 'cart', 'href' => OSCOM::getLink(null, 'Cart'))) .
  208. HTML::button(array('title' => OSCOM::getDef('checkout'), 'icon' => 'triangle-1-e', 'href' => OSCOM::getLink(null, 'Checkout', null, 'SSL'))) .
  209. HTML::button(array('title' => OSCOM::getDef('my_account'), 'icon' => 'person', 'href' => OSCOM::getLink(null, 'Account', null, 'SSL')));
  210. if ( $OSCOM_Customer->isLoggedOn() ) {
  211. echo HTML::button(array('title' => OSCOM::getDef('sign_out'), 'href' => OSCOM::getLink(null, 'Account', 'LogOff', 'SSL')));
  212. }
  213. ?>
  214. </div>
  215. <script type="text/javascript">
  216. $('#navigationIcons').buttonset();
  217. </script>
  218. <div id="navigationBar">
  219. <?php
  220. if ( $OSCOM_Service->isStarted('Breadcrumb') ) {
  221. ?>
  222. <div id="breadcrumbPath" class="ui-widget">
  223. <div class="ui-widget-header">
  224. <span style="padding-left: 5px;">
  225. <?php
  226. echo $OSCOM_Breadcrumb->getPath();
  227. ?>
  228. </span>
  229. </div>
  230. </div>
  231. <?php
  232. }
  233. ?>
  234. </div>
  235. </div>
  236. <?php
  237. } // ($osC_Template->hasPageHeader())
  238. if ( $OSCOM_Template->hasPageFooter() ) {
  239. ?>
  240. <div id="pageFooter">
  241. <?php
  242. echo sprintf(OSCOM::getDef('footer'), date('Y'), OSCOM::getLink(), STORE_NAME);
  243. ?>
  244. </div>
  245. <?php
  246. if ( $OSCOM_Service->isStarted('banner') && $OSCOM_Banner->exists('468x60') ) {
  247. echo '<p align="center">' . $OSCOM_Banner->display() . '</p>';
  248. }
  249. }
  250. ?>
  251. </body>
  252. </html>