PageRenderTime 67ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/oc-admin/themes/modern/items/settings.php

https://code.google.com/
PHP | 182 lines | 160 code | 5 blank | 17 comment | 4 complexity | fa9b2f6f5c1cd0f075ddbf590424f647 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1
  1. <?php
  2. /**
  3. * OSClass รข&#x20AC;&#x201C; software for creating and publishing online classified advertising platforms
  4. *
  5. * Copyright (C) 2010 OSCLASS
  6. *
  7. * This program is free software: you can redistribute it and/or modify it under the terms
  8. * of the GNU Affero General Public License as published by the Free Software Foundation,
  9. * either version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  12. * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU Affero General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Affero General Public
  16. * License along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. function addHelp() {
  19. echo '<p>' . __('Modify the general settings for your listings. Decide if users have to register in order to publish something, the number of pictures allowed for each listing, etc.') . '</p>';
  20. }
  21. osc_add_hook('help_box','addHelp');
  22. //customize Head
  23. function customHead(){ ?>
  24. <script type="text/javascript">
  25. $(document).ready(function() {
  26. $('input[name="moderate_items"]').bind('change', function() {
  27. if( $(this).is(':checked') ) {
  28. $('input[name="logged_user_item_validation"]').attr('disabled', false) ;
  29. $(".num-moderated-items").show() ;
  30. $('input[name="num_moderate_items"]').val(0) ;
  31. } else {
  32. $('input[name="logged_user_item_validation"]').attr('disabled', true) ;
  33. $('.num-moderated-items').hide();
  34. }
  35. }) ;
  36. }) ;
  37. </script>
  38. <?php
  39. }
  40. osc_add_hook('admin_header','customHead');
  41. function render_offset(){
  42. return 'row-offset';
  43. }
  44. osc_add_hook('admin_page_header','customPageHeader');
  45. function customPageHeader(){ ?>
  46. <h1><?php _e('Listing') ; ?>
  47. <a href="#" class="btn ico ico-32 ico-help float-right"></a>
  48. </h1>
  49. <?php
  50. }
  51. function customPageTitle($string) {
  52. return sprintf(__('Listing Settings &raquo; %s'), $string);
  53. }
  54. osc_add_filter('admin_title', 'customPageTitle');
  55. osc_current_admin_theme_path( 'parts/header.php' ) ; ?>
  56. <div id="general-setting">
  57. <!-- settings form -->
  58. <div id="item-settings">
  59. <h2 class="render-title"><?php _e('Listing Settings') ; ?></h2>
  60. <form action="<?php echo osc_admin_base_url(true) ; ?>" method="post">
  61. <input type="hidden" name="page" value="items" />
  62. <input type="hidden" name="action" value="settings_post" />
  63. <fieldset>
  64. <div class="form-horizontal">
  65. <div class="form-row">
  66. <div class="form-label"> <?php _e('Settings') ; ?></div>
  67. <div class="form-controls">
  68. <div class="form-label-checkbox">
  69. <label>
  70. <input type="checkbox" <?php echo ( osc_reg_user_post() ? 'checked="checked"' : '') ; ?> name="reg_user_post" value="1" />
  71. <?php _e('Only logged in users can post listings') ; ?>
  72. </label>
  73. </div>
  74. <div>
  75. <?php printf( __('An user has to wait %s seconds between each listing added'), '<input type="text" class="input-small" name="items_wait_time" value="' . osc_items_wait_time() . '" />') ; ?>
  76. <div class="help-box">
  77. <?php _e('If the value is set to zero, there is no wait period') ; ?>
  78. </div>
  79. </div>
  80. <div class="separate-top-medium">
  81. <label>
  82. <input type="checkbox" <?php echo ( ( osc_moderate_items() == -1 ) ? '' : 'checked="checked"' ) ; ?> name="moderate_items" value="1" />
  83. <?php _e('Users have to validate their listings') ; ?>
  84. </label>
  85. </div>
  86. <div>
  87. <?php printf( __("After %s validated listings the user doesn't need to validate the listings any more"), '<input type="text" class="input-small" name="num_moderate_items" value="' . ( ( osc_moderate_items() == -1 ) ? '' : osc_moderate_items() ) . '" />') ; ?>
  88. <div class="help-box">
  89. <?php _e('If the value is zero, it means that each listing must be validated') ; ?>
  90. </div>
  91. </div>
  92. <div class="separate-top-medium">
  93. <label>
  94. <input type="checkbox" <?php echo ( osc_logged_user_item_validation() ? 'checked="checked"' : '' ) ; ?> name="logged_user_item_validation" value="1" <?php echo ( ( osc_moderate_items() != -1 ) ? '' : 'disabled="disabled"') ; ?> />
  95. <?php _e("Logged in users don't need to validate their listings") ; ?>
  96. </label>
  97. </div>
  98. <div class="separate-top-medium">
  99. <label>
  100. <input type="checkbox" <?php echo ( ( osc_recaptcha_items_enabled() == '0' ) ? '' : 'checked="checked"' ) ; ?> name="enabled_recaptcha_items" value="1" />
  101. <?php _e('Show reCAPTCHA in add/edit listing form') ; ?>
  102. </label>
  103. <div class="help-box"><?php _e('<strong>Remember</strong> that you must configure reCAPTCHA first') ; ?></div>
  104. </div>
  105. </div>
  106. </div>
  107. <div class="form-row">
  108. <div class="form-label"> <?php _e('Contact publisher') ; ?></div>
  109. <div class="form-controls">
  110. <div class="form-label-checkbox">
  111. <label>
  112. <input type="checkbox" <?php echo ( osc_reg_user_can_contact() ? 'checked="checked"' : '' ) ; ?> name="reg_user_can_contact" value="1" />
  113. <?php _e('Only allow registered users to contact publisher') ; ?>
  114. </label>
  115. </div>
  116. <div class="separate-top-medium">
  117. <label>
  118. <input type="checkbox" <?php echo ( osc_item_attachment() ? 'checked="checked"' : '' ) ; ?> name="item_attachment" value="1" />
  119. <?php _e('Allow attached files in contact publisher form') ; ?>
  120. </label>
  121. </div>
  122. </div>
  123. </div>
  124. <div class="form-row">
  125. <div class="form-label"> <?php _e('Notifications') ; ?></div>
  126. <div class="form-controls">
  127. <div class="form-label-checkbox">
  128. <label>
  129. <input type="checkbox" <?php echo ( osc_notify_new_item() ? 'checked="checked"' : '') ; ?> name="notify_new_item" value="1" />
  130. <?php _e('Notify admin when a new listing is added') ; ?>
  131. </label>
  132. </div>
  133. <div class="separate-top-medium">
  134. <label>
  135. <input type="checkbox" <?php echo ( osc_notify_contact_item() ? 'checked="checked"' : '' ) ; ?> name="notify_contact_item" value="1" />
  136. <?php _e('Send admin a copy of the "contact publisher" email') ; ?>
  137. </label>
  138. </div>
  139. <div class="separate-top-medium">
  140. <label>
  141. <input type="checkbox" <?php echo ( osc_notify_contact_friends() ? 'checked="checked"' : '' ) ; ?> name="notify_contact_friends" value="1" />
  142. <?php _e('Send admin a copy to "share listing" email') ; ?>
  143. </label>
  144. </div>
  145. </div>
  146. </div>
  147. <div class="form-row">
  148. <div class="form-label"> <?php _e('Optional fields') ; ?></div>
  149. <div class="form-controls">
  150. <div class="form-label-checkbox">
  151. <label>
  152. <input type="checkbox" <?php echo ( osc_price_enabled_at_items() ? 'checked="checked"' : '' ) ; ?> name="enableField#f_price@items" value="1" />
  153. <?php _e('Price') ; ?>
  154. </label>
  155. <div class="separate-top-medium">
  156. <label>
  157. <input type="checkbox" <?php echo ( osc_images_enabled_at_items() ? 'checked="checked"' : '' ) ; ?> name="enableField#images@items" value="1" />
  158. <?php _e('Attach images') ; ?>
  159. </label>
  160. </div>
  161. <div class="separate-top-medium">
  162. <?php printf( __('Attach %s images per listing'), '<input type="text" class="input-small" name="numImages@items" value="' . osc_max_images_per_item() . '" />' ) ; ?>
  163. <div class="help-box"><?php _e('If the value is zero, it means an unlimited number of images is allowed') ; ?></div>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. <div class="form-actions">
  169. <input type="submit" id="save_changes" value="<?php echo osc_esc_html( __('Save changes') ) ; ?>" class="btn btn-submit" />
  170. </div>
  171. </div>
  172. </fieldset>
  173. </form>
  174. </div>
  175. <!-- /settings form -->
  176. </div>
  177. <?php osc_current_admin_theme_path( 'parts/footer.php' ) ; ?>