PageRenderTime 54ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/appl/views/system/text_content.php

https://bitbucket.org/gan_kwok_wei/th-wcms-sandbox
PHP | 209 lines | 180 code | 3 blank | 26 comment | 30 complexity | 5e0094f5ea23f08e6b070da3cf6dc1a0 MD5 | raw file
  1. <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
  2. /**
  3. * PHP 5
  4. *
  5. * GreenLabGroup Application System Environment (GreASE)
  6. * GreenLabGroup(tm) : Rapid Development Framework (http://www.greenlabgroup.com)
  7. * Copyright 2011-2012, P.T. Green Lab Group.
  8. *
  9. * Licensed under The MIT License
  10. * Redistributions of files must retain the above copyright notice.
  11. *
  12. * @filesource content_text.php
  13. * @copyright Copyright 2011-2012, P.T. Green Lab Group.
  14. * @author budi.lx
  15. * @package
  16. * @subpackage
  17. * @since Oct 9, 2012
  18. * @version
  19. * @modifiedby budi.lx
  20. * @lastmodified
  21. *
  22. *
  23. */
  24. ?>
  25. <script type="text/javascript" charset="utf-8">
  26. $().ready(function() {
  27. $( "#lang_tabs" ).tabs();
  28. });
  29. </script>
  30. <div id="lang_tabs">
  31. <ul>
  32. <?php
  33. foreach ($this->system_model->get_registered_lang() as $lang_k => $lang_v) {
  34. echo '<li><a href="#tabs-' . $lang_k . '">' . ucfirst($lang_v) . '</a></li>';
  35. }
  36. ?>
  37. </ul>
  38. <?php
  39. foreach ($this->system_model->get_registered_lang() as $lang_k => $lang_v) {
  40. if($mode != 'add') {
  41. $result = $this->system_model->get_content_text($content_text_type, $parent_id, $lang_v);
  42. if($result->num_rows() > 0) {
  43. $text = $result->row();
  44. } else {
  45. $text = new stdClass();
  46. $text->content_text_id = "0";
  47. $text->title = "";
  48. $text->icon = "";
  49. $text->image = "";
  50. $text->teaser = "";
  51. $text->content = "";
  52. $text->icon_1 = "";
  53. $text->image_1 = "";
  54. $text->teaser_1 = "";
  55. $text->content_1 = "";
  56. $text->link = "";
  57. $text->country = "";
  58. }
  59. echo form_hidden("content_text_id[$lang_k]", $text->content_text_id);
  60. }
  61. echo form_hidden("language[$lang_k]", $lang_v);
  62. ?>
  63. <div id="tabs-<?php echo $lang_k; ?>">
  64. <table>
  65. <tr>
  66. <td><?php echo lang('label_title'); ?>*</td>
  67. <td colspan="3">
  68. <?php
  69. $field_title = array(
  70. 'name' => "title[$lang_k]",
  71. 'id' => "title_$lang_k",
  72. 'value' => ($mode == 'add') ? set_value('title'): $text->title,
  73. 'maxlength' => '150',
  74. 'size' => '120'
  75. );
  76. echo form_input($field_title);
  77. ?>
  78. </td>
  79. </tr>
  80. <tr>
  81. <td valign="top"><?php echo lang('label_icon_' . $content_text_type); ?></td>
  82. <td valign="bottom">
  83. <?php
  84. if(($mode != 'add') && ($text->icon)) {
  85. echo '<img src="' . $text->icon . '" height="75"/> <br/>';
  86. }
  87. $field_icon = array(
  88. 'name' => "icon[$lang_k]",
  89. 'id' => "icon_$lang_k",
  90. 'value' => ($mode == 'add') ? set_value('icon'): $text->icon,
  91. 'maxlength' => '150',
  92. 'size' => '32'
  93. );
  94. echo form_input($field_icon);
  95. ?><input type="button" value="Browse Server" onclick="BrowseServer( 'Files:/images', 'icon_<?php echo $lang_k; ?>' );" />
  96. </td>
  97. <td valign="top"><?php echo lang('label_icon_1_' . $content_text_type); ?></td>
  98. <td valign="bottom">
  99. <?php
  100. if(($mode != 'add') && ($text->icon_1)) {
  101. echo '<img src="' . $text->icon_1 . '" height="75"/> <br/>';
  102. }
  103. $field_icon_1 = array(
  104. 'name' => "icon_1[$lang_k]",
  105. 'id' => "icon_1_$lang_k",
  106. 'value' => ($mode == 'add') ? set_value('icon_1'): $text->icon_1,
  107. 'maxlength' => '150',
  108. 'size' => '32'
  109. );
  110. echo form_input($field_icon_1);
  111. ?><input type="button" value="Browse Server" onclick="BrowseServer( 'Files:/images', 'icon_1_<?php echo $lang_k; ?>' );" />
  112. </td>
  113. </tr>
  114. <tr>
  115. <td valign="top"><?php echo lang('label_image_' . $content_text_type); ?></td>
  116. <td valign="bottom">
  117. <?php
  118. if(($mode != 'add') && ($text->image)) {
  119. echo '<img src="' . $text->image . '" height="100"/> <br/>';
  120. }
  121. $field_image = array(
  122. 'name' => "image[$lang_k]",
  123. 'id' => "image_$lang_k",
  124. 'value' => ($mode == 'add') ? set_value('image'): $text->image,
  125. 'maxlength' => '150',
  126. 'size' => '32'
  127. );
  128. echo form_input($field_image);
  129. ?><input type="button" value="Browse Server" onclick="BrowseServer( 'Files:/images', 'image_<?php echo $lang_k; ?>' );" />
  130. </td>
  131. <td valign="top"><?php echo lang('label_image_1_' . $content_text_type); ?></td>
  132. <td valign="bottom">
  133. <?php
  134. if(($mode != 'add') && ($text->image_1)) {
  135. echo '<img src="' . $text->image_1 . '" height="100"/> <br/>';
  136. }
  137. $field_image_1 = array(
  138. 'name' => "image_1[$lang_k]",
  139. 'id' => "image_1_$lang_k",
  140. 'value' => ($mode == 'add') ? set_value('image_1'): $text->image_1,
  141. 'maxlength' => '150',
  142. 'size' => '32'
  143. );
  144. echo form_input($field_image_1);
  145. ?><input type="button" value="Browse Server" onclick="BrowseServer( 'Files:/images', 'image_1_<?php echo $lang_k; ?>' );" />
  146. </td>
  147. </tr>
  148. <tr>
  149. <td valign="top"><?php echo lang('label_teaser_' . $content_text_type); ?></td>
  150. <td colspan="3"><?php echo $this->ckeditor->editor("teaser[$lang_k]", ($mode == 'add') ? '' : $text->teaser); ?></td>
  151. </tr>
  152. <tr>
  153. <td valign="top"><?php echo lang('label_teaser_1_' . $content_text_type); ?></td>
  154. <td colspan="3"><?php echo $this->ckeditor->editor("teaser_1[$lang_k]", ($mode == 'add') ? '' : $text->teaser_1); ?></td>
  155. </tr>
  156. <tr>
  157. <td valign="top"><?php echo lang('label_content_' . $content_text_type); ?></td>
  158. <td colspan="3"><?php echo $this->ckeditor->editor("content[$lang_k]", ($mode == 'add') ? '' : $text->content); ?></td>
  159. </tr>
  160. <tr>
  161. <td valign="top"><?php echo lang('label_content_1_' . $content_text_type); ?></td>
  162. <td colspan="3"><?php echo $this->ckeditor->editor("content_1[$lang_k]", ($mode == 'add') ? '' : $text->content_1); ?></td>
  163. </tr>
  164. <tr>
  165. <td><?php echo lang('label_link'); ?></td>
  166. <td colspan="3">
  167. <?php
  168. $field_link = array(
  169. 'name' => "link[$lang_k]",
  170. 'id' => "link_$lang_k",
  171. 'value' => ($mode == 'add') ? set_value('link'): $text->link,
  172. 'maxlength' => '150',
  173. 'size' => '132'
  174. );
  175. echo form_input($field_link);
  176. ?>
  177. </td>
  178. </tr>
  179. <tr>
  180. <td><?php echo lang('label_country'); ?></td>
  181. <td colspan="3">
  182. <?php
  183. if($mode == 'add') {
  184. foreach ($this->system_model->get_registered_country() as $country_k => $country_v) {
  185. echo form_checkbox("country[$lang_k][]", $country_k, TRUE) . ucwords($country_v) . "|&nbsp;&nbsp;";
  186. }
  187. } else {
  188. $country_array = explode('|', $text->country);
  189. foreach ($this->system_model->get_registered_country() as $country_k => $country_v) {
  190. echo form_checkbox("country[$lang_k][]", $country_k, (in_array($country_k, $country_array)) ? TRUE : FALSE) . ucwords($country_v) . "|&nbsp;&nbsp;";
  191. }
  192. }
  193. ?>
  194. </td>
  195. </tr>
  196. </table>
  197. </div>
  198. <?php
  199. }
  200. ?>
  201. </div>
  202. <?php
  203. /**
  204. * End of file content_text.php
  205. * Location: ./.../.../.../content_text.php
  206. */