PageRenderTime 50ms CodeModel.GetById 11ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/plugins/slidedeck2-personal/views/elements/_options.php

https://bitbucket.org/andydahl/5star
PHP | 214 lines | 155 code | 25 blank | 34 comment | 41 complexity | 2fb3b622216b459aa0875854c482ce29 MD5 | raw file
Possible License(s): AGPL-1.0, BSD-3-Clause, GPL-3.0, LGPL-3.0, LGPL-2.1, GPL-2.0
  1. <?php
  2. /**
  3. * SlideDeck Options view
  4. *
  5. * More information on this project:
  6. * http://www.slidedeck.com/
  7. *
  8. * Full Usage Documentation: http://www.slidedeck.com/usage-documentation
  9. *
  10. * @package SlideDeck
  11. * @subpackage SlideDeck 2 Pro for WordPress
  12. * @author dtelepathy
  13. */
  14. /*
  15. Copyright 2012 digital-telepathy (email : support@digital-telepathy.com)
  16. This file is part of SlideDeck.
  17. SlideDeck is free software: you can redistribute it and/or modify
  18. it under the terms of the GNU General Public License as published by
  19. the Free Software Foundation, either version 3 of the License, or
  20. (at your option) any later version.
  21. SlideDeck is distributed in the hope that it will be useful,
  22. but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. GNU General Public License for more details.
  25. You should have received a copy of the GNU General Public License
  26. along with SlideDeck. If not, see <http://www.gnu.org/licenses/>.
  27. */
  28. ?>
  29. <div id="options-group-wrapper">
  30. <div id="slidedeck-options-groups">
  31. <dl class="slidedeck">
  32. <dd>
  33. <dl class="slidesVertical clearfix">
  34. <dt><?php _e( "Lenses", $namespace ); ?></dt>
  35. <dd class="clearfix options-group-leneses">
  36. <div id="slidedeck-section-lenses" class="options-list clearfix">
  37. <?php include( SLIDEDECK2_DIRNAME . '/views/elements/_options-lenses.php' ); ?>
  38. </div>
  39. </dd>
  40. <dt><?php _e( "Setup", $namespace ); ?></dt>
  41. <dd class="clearfix options-group-setup">
  42. <ul class="options-list">
  43. <li id="slidedeck-sizes">
  44. <span class="label"><?php _e( $options_model['Setup']['size']['label'], $namespace ); ?> <span class="tooltip" title="<?php _e( $options_model['Setup']['size']['description'], $namespace ); ?>"></span></span>
  45. <?php
  46. $custom_size = $sizes['custom'];
  47. unset( $sizes['custom'] );
  48. $sizes['custom'] = $custom_size;
  49. $inc = 1;
  50. foreach( $sizes as $value => $size ):
  51. ?>
  52. <label<?php if( $inc++ == ( count( $sizes ) - 1 ) ) echo ' class="last-fixed-size"'; ?>>
  53. <input type="radio" name="options[size]" value="<?php echo $value; ?>" class="fancy"<?php if( $slidedeck['options']['size'] == $value ) echo ' checked="checked"'; ?> />
  54. <?php echo $size['label']; ?>
  55. <?php if( $value != "custom" ): ?><em><?php echo "{$size['width']}x{$size['height']}"; ?></em><?php endif; ?>
  56. </label>
  57. <?php endforeach; ?>
  58. <span id="slidedeck-custom-dimensions"<?php if( $slidedeck['options']['size'] == "custom" ) echo ' class="selected"'; ?>>
  59. <label><input type="text" name="options[width]" value="<?php echo $slidedeck['options']['width']; ?>" size="5" /> px</label> x
  60. <label><input type="text" name="options[height]" value="<?php echo $slidedeck['options']['height']; ?>" size="5" /> px</label>
  61. </span>
  62. </li>
  63. <li<?php if( $options_model['Setup']['total_slides']['type'] == "hidden" ) echo ' style="display:none;"'; ?>>
  64. <?php slidedeck2_html_input( "options[total_slides]", $slidedeck['options']['total_slides'], $options_model['Setup']['total_slides'] ); ?>
  65. </li>
  66. <li id="slidedeck-covers">
  67. <span class="label"><?php _e( "Covers", $namespace ); ?> <span class="tooltip" title="<?php _e( "Covers let you add a title slide to your SlideDeck, and add a call-to-action to the last slide.", $namespace ); ?>"></span></span>
  68. <span class="cover-option">
  69. <span class="cover-text"><?php _e( "Front Cover :", $namespace ); ?></span>
  70. <label for="options-show-front-cover-on" class="label">On
  71. <input type="radio" id="options-show-front-cover-on" name="options[show-front-cover]" class="fancy" value="1"<?php if( $slidedeck['options']['show-front-cover'] ) echo ' checked="checked"'; ?> />
  72. </label>
  73. <label for="options-show-front-cover-off" class="label">Off
  74. <input type="radio" id="options-show-front-cover-off" name="options[show-front-cover]" class="fancy" value=""<?php if( !$slidedeck['options']['show-front-cover'] ) echo ' checked="checked"'; ?> />
  75. </label>
  76. </span>
  77. <span class="cover-option">
  78. <span class="cover-text"><?php _e( "Back Cover :", $namespace ); ?></span>
  79. <label for="options-show-back-cover-on" class="label">On
  80. <input type="radio" id="options-show-back-cover-on" name="options[show-back-cover]" class="fancy" value="1"<?php if( $slidedeck['options']['show-back-cover'] ) echo ' checked="checked"'; ?> />
  81. </label>
  82. <label for="options-show-back-cover-off" class="label">Off
  83. <input type="radio" id="options-show-back-cover-off" name="options[show-back-cover]" class="fancy" value=""<?php if( !$slidedeck['options']['show-back-cover'] ) echo ' checked="checked"'; ?> />
  84. </label>
  85. </span>
  86. <span class="cover-option cover-option-edit">
  87. <a href="<?php echo admin_url( wp_nonce_url( 'admin-ajax.php?action=slidedeck_covers_modal&slidedeck=' . $slidedeck['id'], 'slidedeck-cover-modal' ) ); ?>" id="slidedeck-covers-modal-link" class="button"><?php _e( "Edit", $namespace ); ?></a>
  88. </span>
  89. </li>
  90. <li>
  91. <?php
  92. $overlay = $this->SlideDeck->options_model['Setup']['overlays'];
  93. $overlay['attr']['class'] = "fancy";
  94. slidedeck2_html_input( 'options[overlays]', $slidedeck['options']['overlays'], $overlay );
  95. ?>
  96. </li>
  97. <li>
  98. <?php
  99. $overlay = $this->SlideDeck->options_model['Setup']['overlays_open'];
  100. $overlay['attr']['class'] = "fancy";
  101. slidedeck2_html_input( 'options[overlays_open]', $slidedeck['options']['overlays_open'], $overlay );
  102. ?>
  103. </li>
  104. <?php do_action( "{$namespace}_setup_options_bottom", $slidedeck ); ?>
  105. </ul>
  106. </dd>
  107. <?php
  108. $hidden_options = "";
  109. for( $i = 0; $i < count( $options_groups ); $i++ ):
  110. ?>
  111. <?php
  112. $all_options_hidden = true;
  113. foreach( $options_model[$options_groups[$i]] as $name => $option ) {
  114. if( array_key_exists( 'type', $option ) ) {
  115. if( $option['type'] != 'hidden' )
  116. $all_options_hidden = false;
  117. } else {
  118. foreach( $option as $sub_name => $sub_option ) {
  119. if( $sub_option['type'] != 'hidden' )
  120. $all_options_hidden = false;
  121. }
  122. }
  123. }
  124. ?>
  125. <?php if( !$all_options_hidden ): ?>
  126. <dt><?php echo $options_groups[$i]; ?></dt>
  127. <dd class="clearfix">
  128. <ul class="options-list">
  129. <?php endif; ?>
  130. <?php
  131. foreach( $options_model[$options_groups[$i]] as $name => $option ) {
  132. $is_hidden = false;
  133. if( array_key_exists( 'type', $option ) )
  134. if( $option['type'] == "hidden" )
  135. $is_hidden = true;
  136. $html = "";
  137. if( $is_hidden !== true )
  138. $html .= "<li>";
  139. $input_html = "";
  140. if( array_key_exists( 'type', $option ) ) {
  141. if( !isset( $option['interface'] ) || empty( $option['interface'] ) ) {
  142. // Create attr property if it doesn't exist
  143. if( !isset( $option['attr'] ) ) $option['attr'] = array( 'class' => "" );
  144. // Create class attribute if it doesn't exist
  145. if( !isset( $option['attr']['class'] ) ) $option['attr']['class'] = "";
  146. $option['attr']['class'].= " fancy";
  147. }
  148. $input_html.= slidedeck2_html_input( "options[$name]", $slidedeck['options'][$name], $option, false );
  149. } else {
  150. foreach( $option as $sub_name => $sub_option ) {
  151. if( !isset( $sub_option['interface'] ) || empty( $sub_option['interface'] ) ) {
  152. // Create attr property if it doesn't exist
  153. if( !isset( $sub_option['attr'] ) ) $sub_option['attr'] = array( 'class' => "" );
  154. // Create class attribute if it doesn't exist
  155. if( !isset( $sub_option['attr']['class'] ) ) $sub_option['attr']['class'] = "";
  156. $sub_option['attr']['class'].= " fancy";
  157. }
  158. $input_html.= slidedeck2_html_input( 'options[' . $name . '][' . $sub_name . ']', $slidedeck['options'][$name][$sub_name], $sub_option, false );
  159. }
  160. }
  161. if( array_key_exists( 'type', $option ) && $option['type'] == 'hidden' )
  162. $hidden_options .= $input_html;
  163. else
  164. $html .= $input_html;
  165. if( $is_hidden !== true )
  166. $html .= "</li>";
  167. echo $html;
  168. }
  169. ?>
  170. <?php if( !$all_options_hidden ): ?>
  171. </ul>
  172. </dd>
  173. <?php endif; ?>
  174. <?php endfor; ?>
  175. </dl>
  176. </dd>
  177. </dl>
  178. <?php echo $hidden_options; ?>
  179. <div id="slidedeck-options-groups-cap">
  180. <span class="left">&nbsp;</span>
  181. <span class="center">&nbsp;</span>
  182. <span class="right">&nbsp;</span>
  183. </div>
  184. </div>
  185. </div>