// SYSTEM PANEL //
[ROOT]
/
home
/
salvufkx
/
homedir
/
public_html
/
wp-content
/
plugins
/
gallery-images-ape
/
libs
/
fields
[ PARENT ]
EDIT :: switch.php
<?php /* * Ape Gallery http://wpape.net * Version: 1.2.4 - 61253 * Author: Wp Ape (c) * Author URI: http://wpape.net * License: GPL-2.0+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt * Date: Thu, 08 Dec 2016 16:31:35 GMT */ function jt_cmb2_switch_field( $metakey, $post_id = 0 ) { echo jt_cmb2_get_switch_field( $metakey, $post_id ); } function jt_cmb2_render_switch_field_callback( $field, $value, $object_id, $object_type, $field_type_object ) { if( empty($value) ) $value = $field->args('default'); $onText = $field->args('onText'); $offText = $field->args('offText'); if($field->args('showhide')){ $onText='Show'; $offText='Hide'; } $onStyle = 'success'; $offStyle= 'default'; $invert = $field->args('invert'); if($invert){ $tempOnText = $onText; $onText = $offText; $offText = $tempOnText; $tempOnStyle = $onStyle; $onStyle = $offStyle.' active '; $offStyle = $tempOnStyle; } if( $field->args('level') ) echo '<div class="ape_premium wpape-block-premium"> <p>'.WPAPE_GALLERY_BUTTON_PREMIUM.'</p></div>'; ?> <div class="form-horizontal"> <div class="form-group"> <label class="col-sm-2 control-label" for="<?php echo $field_type_object->_id(); ?>'"> <?php echo $field->args('name'); ?> </label> <div class="col-sm-10"> <?php $class= ''; if( $field->args('depends') ) $class .= ' wpape_action_element'; echo '<input type="checkbox" class="'.$class.'" data-toggle="toggle" ' .'data-onstyle="'.$onStyle.'" ' .'data-offstyle="'.$offStyle.'" ' .($onText?' data-on="'.__($onText, 'wpape_gallery').'" ':'') .($offText?' data-off="'.__($offText, 'wpape_gallery').'" ':'') .'name="'.$field_type_object->_name( ).'" ' .'id="'. $field_type_object->_id( ).'" ' .($field->args('depends')?'data-depends="'.$field->args('depends').'" ':'') .( $value==1 ?'checked="checked" ':'') .'value="1"> <span class="wpape_desc">'.$field->args('desc').'</span>'; ?> </div> </div> </div> <?php } add_filter( 'cmb2_render_switch', 'jt_cmb2_render_switch_field_callback', 10, 5 );
SAVE
CANCEL