PageRenderTime 23ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/catalog/controller/module/HtmlModule.php

https://gitlab.com/leijianbin/gotobus
PHP | 166 lines | 153 code | 13 blank | 0 comment | 22 complexity | 2866abe525987565752ed50515feef71 MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. class ControllerModuleHtmlModule extends Controller {
  3. private $_name = 'HtmlModule';
  4. private $_version = '1.0';
  5. protected function index($setting) {
  6. $this->load->model('localisation/language');
  7. $languages = $this->model_localisation_language->getLanguages();
  8. $this->data['heading_title'] = "HTML Module";
  9. $this->data['code1'] = html_entity_decode($this->config->get($this->_name . '_code1_' . $this->config->get('config_language_id')));
  10. $this->data['code2'] = html_entity_decode($this->config->get($this->_name . '_code2_' . $this->config->get('config_language_id')));
  11. $this->data['code3'] = html_entity_decode($this->config->get($this->_name . '_code3_' . $this->config->get('config_language_id')));
  12. $this->data['code4'] = html_entity_decode($this->config->get($this->_name . '_code4_' . $this->config->get('config_language_id')));
  13. $this->data['code5'] = html_entity_decode($this->config->get($this->_name . '_code5_' . $this->config->get('config_language_id')));
  14. $this->data['code6'] = html_entity_decode($this->config->get($this->_name . '_code6_' . $this->config->get('config_language_id')));
  15. $this->data['code7'] = html_entity_decode($this->config->get($this->_name . '_code7_' . $this->config->get('config_language_id')));
  16. $this->data['code8'] = html_entity_decode($this->config->get($this->_name . '_code8_' . $this->config->get('config_language_id')));
  17. $this->data['code9'] = html_entity_decode($this->config->get($this->_name . '_code9_' . $this->config->get('config_language_id')));
  18. $this->data['code10'] = html_entity_decode($this->config->get($this->_name . '_code10_' . $this->config->get('config_language_id')));
  19. $this->data['title1'] = $this->config->get($this->_name . '_title1_' . $this->config->get('config_language_id'));
  20. $this->data['title2'] = $this->config->get($this->_name . '_title2_' . $this->config->get('config_language_id'));
  21. $this->data['title3'] = $this->config->get($this->_name . '_title3_' . $this->config->get('config_language_id'));
  22. $this->data['title4'] = $this->config->get($this->_name . '_title4_' . $this->config->get('config_language_id'));
  23. $this->data['title5'] = $this->config->get($this->_name . '_title5_' . $this->config->get('config_language_id'));
  24. $this->data['title6'] = $this->config->get($this->_name . '_title6_' . $this->config->get('config_language_id'));
  25. $this->data['title7'] = $this->config->get($this->_name . '_title7_' . $this->config->get('config_language_id'));
  26. $this->data['title8'] = $this->config->get($this->_name . '_title8_' . $this->config->get('config_language_id'));
  27. $this->data['title9'] = $this->config->get($this->_name . '_title9_' . $this->config->get('config_language_id'));
  28. $this->data['title10'] = $this->config->get($this->_name . '_title10_' . $this->config->get('config_language_id'));
  29. $this->data['header1'] = $this->config->get( $this->_name . '_header1');
  30. $this->data['header2'] = $this->config->get( $this->_name . '_header2');
  31. $this->data['header3'] = $this->config->get( $this->_name . '_header3');
  32. $this->data['header4'] = $this->config->get( $this->_name . '_header4');
  33. $this->data['header5'] = $this->config->get( $this->_name . '_header5');
  34. $this->data['header6'] = $this->config->get( $this->_name . '_header6');
  35. $this->data['header7'] = $this->config->get( $this->_name . '_header7');
  36. $this->data['header8'] = $this->config->get( $this->_name . '_header8');
  37. $this->data['header9'] = $this->config->get( $this->_name . '_header9');
  38. $this->data['header10'] = $this->config->get( $this->_name . '_header10');
  39. $this->data['borderless1'] = $this->config->get( $this->_name . '_borderless1');
  40. $this->data['borderless2'] = $this->config->get( $this->_name . '_borderless2');
  41. $this->data['borderless3'] = $this->config->get( $this->_name . '_borderless3');
  42. $this->data['borderless4'] = $this->config->get( $this->_name . '_borderless4');
  43. $this->data['borderless5'] = $this->config->get( $this->_name . '_borderless5');
  44. $this->data['borderless6'] = $this->config->get( $this->_name . '_borderless6');
  45. $this->data['borderless7'] = $this->config->get( $this->_name . '_borderless7');
  46. $this->data['borderless8'] = $this->config->get( $this->_name . '_borderless8');
  47. $this->data['borderless9'] = $this->config->get( $this->_name . '_borderless9');
  48. $this->data['borderless10'] = $this->config->get( $this->_name . '_borderless10');
  49. if( !$this->data['title1'] ) {
  50. $this->data['title1'] = $this->data['heading_title'];
  51. }
  52. if( !$this->data['title2'] ) {
  53. $this->data['title2'] = $this->data['heading_title'];
  54. }
  55. if( !$this->data['title3'] ) {
  56. $this->data['title3'] = $this->data['heading_title'];
  57. }
  58. if( !$this->data['title4'] ) {
  59. $this->data['title4'] = $this->data['heading_title'];
  60. }
  61. if( !$this->data['title5'] ) {
  62. $this->data['title5'] = $this->data['heading_title'];
  63. }
  64. if( !$this->data['title6'] ) {
  65. $this->data['title6'] = $this->data['heading_title'];
  66. }
  67. if( !$this->data['title7'] ) {
  68. $this->data['title7'] = $this->data['heading_title'];
  69. }
  70. if( !$this->data['title8'] ) {
  71. $this->data['title8'] = $this->data['heading_title'];
  72. }
  73. if( !$this->data['title9'] ) {
  74. $this->data['title9'] = $this->data['heading_title'];
  75. }
  76. if( !$this->data['title10'] ) {
  77. $this->data['title10'] = $this->data['heading_title'];
  78. }
  79. if( !$this->data['header1'] ) { $this->data['title1'] = ''; }
  80. if( !$this->data['header2'] ) { $this->data['title2'] = ''; }
  81. if( !$this->data['header3'] ) { $this->data['title3'] = ''; }
  82. if( !$this->data['header4'] ) { $this->data['title4'] = ''; }
  83. if( !$this->data['header5'] ) { $this->data['title5'] = ''; }
  84. if( !$this->data['header6'] ) { $this->data['title6'] = ''; }
  85. if( !$this->data['header7'] ) { $this->data['title7'] = ''; }
  86. if( !$this->data['header8'] ) { $this->data['title8'] = ''; }
  87. if( !$this->data['header9'] ) { $this->data['title9'] = ''; }
  88. if( !$this->data['header10'] ) { $this->data['title10'] = ''; }
  89. $position = $setting["area_id"];
  90. $this->data['classname'] = $setting['classname'];
  91. switch($position){
  92. case "area1":
  93. $this->data['code'] = $this->data['code1'];
  94. $this->data['title'] = $this->data['title1'];
  95. $this->data['borderless'] = $this->data['borderless1'];
  96. break;
  97. case "area2":
  98. $this->data['code'] = $this->data['code2'];
  99. $this->data['title'] = $this->data['title2'];
  100. $this->data['borderless'] = $this->data['borderless2'];
  101. break;
  102. case "area3":
  103. $this->data['code'] = $this->data['code3'];
  104. $this->data['title'] = $this->data['title3'];
  105. $this->data['borderless'] = $this->data['borderless3'];
  106. break;
  107. case "area4":
  108. $this->data['code'] = $this->data['code4'];
  109. $this->data['title'] = $this->data['title4'];
  110. $this->data['borderless'] = $this->data['borderless4'];
  111. break;
  112. case "area5":
  113. $this->data['code'] = $this->data['code5'];
  114. $this->data['title'] = $this->data['title5'];
  115. $this->data['borderless'] = $this->data['borderless5'];
  116. break;
  117. case "area6":
  118. $this->data['code'] = $this->data['code6'];
  119. $this->data['title'] = $this->data['title6'];
  120. $this->data['borderless'] = $this->data['borderless6'];
  121. break;
  122. case "area7":
  123. $this->data['code'] = $this->data['code7'];
  124. $this->data['title'] = $this->data['title7'];
  125. $this->data['borderless'] = $this->data['borderless7'];
  126. break;
  127. case "area8":
  128. $this->data['code'] = $this->data['code8'];
  129. $this->data['title'] = $this->data['title8'];
  130. $this->data['borderless'] = $this->data['borderless8'];
  131. break;
  132. case "area9":
  133. $this->data['code'] = $this->data['code9'];
  134. $this->data['title'] = $this->data['title9'];
  135. $this->data['borderless'] = $this->data['borderless9'];
  136. break;
  137. case "area10":
  138. $this->data['code'] = $this->data['code10'];
  139. $this->data['title'] = $this->data['title10'];
  140. $this->data['borderless'] = $this->data['borderless10'];
  141. break;
  142. default: $this->data['code'] = ''; $this->data['title'] = ''; $this->data['borderless'] = 0;
  143. } // switch
  144. $this->id = $this->_name;
  145. if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/'.$this->_name.'.tpl')) {
  146. $this->template = $this->config->get('config_template') . '/template/module/'.$this->_name.'.tpl';
  147. } else {
  148. $this->template = 'default/template/module/'.$this->_name.'.tpl';
  149. }
  150. $this->render();
  151. }
  152. }
  153. ?>