function lambda_table_edit() { ?> <div id="lambda-option-panel" class="bootstrap-wpadmin option-tables"> <form method="post" action="options.php" class="well form-inline" > <?php wp_nonce_field('update-options'); //get needed slider data $table = $_GET['edit']; $options = get_option($table); ?> <div class="lambda-opttitle"> <div class="lambda-opttitle-pad settingstitle"> <h1><?php echo _e('Table Manager', UT_THEME_NAME); ?> </h1> <input type="hidden" name="action" value="update" /> <input type="hidden" name="page_options" value="<?php echo $table; ?> " /> <input type="submit" class="lambda_save btn btn-success right" value="<?php _e('Save Settings', UT_THEME_NAME); ?> " /> <div class="clear"></div> </div> </div> <div id="table-items" class="tab-pane"> <div id="single-columns"> <?php $table_basic_columns = empty($options['columns']) ? lambda_table_item_array() : $options['columns']; foreach ($table_basic_columns as $key => $value) { ?> <div id="lambda_<?php echo $key; ?> " class="column_item"> <label for="column_<?php echo $key; ?> "><?php _e('Activate Column?', UT_THEME_NAME); ?> </label><br /> <div class="lambda_row"> <div class="btn-group" data-toggle="buttons-radio"> <button value="<?php echo $key; ?> _on" type="button" class="btn btn-mini btn-info <?php echo $value['column_active'] == 'on' ? 'active' : 'inactive'; ?> radio_<?php echo $value['column_active'] == 'on' ? 'active' : 'inactive'; ?> "><?php _e('on', UT_THEME_NAME); ?> </button> <button value="<?php echo $key; ?> _off" type="button" class="btn btn-mini btn-info <?php echo $value['column_active'] == 'off' ? 'active' : 'inactive'; ?> radio_<?php echo $value['column_active'] == 'off' ? 'active' : 'inactive'; ?> "><?php _e('off', UT_THEME_NAME); ?> </button> <input class="radiostate_<?php echo $value['column_active'] == 'on' ? 'active' : 'inactive'; ?> " style="display:none;" id="<?php echo $key; ?> _on" type="radio" name="<?php echo $table; ?> [columns][<?php echo $key; ?> ][column_active]" value="on" <?php echo $value['column_active'] == 'on' ? 'checked="checked"' : ''; ?> /><br /> <input class="radiostate_<?php echo $value['column_active'] == 'off' ? 'active' : 'inactive'; ?> " style="display:none;" id="<?php echo $key; ?> _off" type="radio" name="<?php echo $table; ?> [columns][<?php echo $key; ?> ][column_active]" value="off" <?php echo $value['column_active'] == 'off' ? 'checked="checked"' : ''; ?> /><br /> </div> </div> <hr /> <label for="column_<?php echo $key; ?> "><?php _e('Column is featured?', UT_THEME_NAME); ?> </label><br /> <div class="lambda_row"> <div class="btn-group" data-toggle="buttons-radio"> <button value="<?php echo $key; ?> _yes" type="button" class="btn btn-mini btn-info <?php echo $value['featured'] == 'yes' ? 'active' : 'inactive'; ?> radio_<?php echo $value['featured'] == 'yes' ? 'active' : 'inactive'; ?> "><?php _e('yes', UT_THEME_NAME); ?> </button> <button value="<?php echo $key; ?> _no" type="button" class="btn btn-mini btn-info <?php echo $value['featured'] == 'no' ? 'active' : 'inactive'; ?> radio_<?php echo $value['featured'] == 'no' ? 'active' : 'inactive'; ?> "><?php _e('no', UT_THEME_NAME); ?> </button> <input class="radiostate_<?php echo $value['featured'] == 'yes' ? 'active' : 'inactive'; ?> " style="display:none;" id="<?php echo $key; ?> _yes" type="radio" name="<?php echo $table; ?> [columns][<?php echo $key; ?> ][featured]" value="yes" <?php echo $value['featured'] == 'yes' ? 'checked="checked"' : ''; ?> /><br /> <input class="radiostate_<?php echo $value['featured'] == 'no' ? 'active' : 'inactive'; ?> " style="display:none;" id="<?php echo $key; ?> _no" type="radio" name="<?php echo $table; ?> [columns][<?php echo $key; ?> ][featured]" value="no" <?php echo $value['featured'] == 'no' ? 'checked="checked"' : ''; ?> /><br /> </div> </div> <hr /> <label><?php _e('Column Headline', UT_THEME_NAME); ?> </label><br /> <input style="width:148px !important; min-width: inherit !important;" id="<?php echo $key; ?> " type="text" name="<?php echo $table; ?> [columns][<?php echo $key; ?> ][column_head]" value="<?php echo $value['column_head']; ?> " /><br /> <hr /> <label><?php _e('Column Price', UT_THEME_NAME); ?> </label><br /> <input style="width:148px !important; min-width: inherit !important;" id="<?php echo $key; ?> " type="text" name="<?php echo $table; ?> [columns][<?php echo $key; ?> ][column_price]" value="<?php echo $value['column_price']; ?> " /><br /> <hr /> <label><?php _e('Price Currency', UT_THEME_NAME); ?> </label><br /> <input style="width:148px !important; min-width: inherit !important;" id="<?php echo $key; ?> " type="text" name="<?php echo $table; ?> [columns][<?php echo $key; ?> ][column_curr]" value="<?php echo $value['column_curr']; ?> " /><br /> <hr /> <label><?php _e('Period', UT_THEME_NAME); ?> </label><br /> <input style="width:148px !important; min-width: inherit !important;" id="<?php echo $key; ?> " type="text" name="<?php echo $table; ?> [columns][<?php echo $key; ?> ][column_time]" value="<?php echo $value['column_time']; ?> " /><br /> <hr /> <label><?php _e('Features', UT_THEME_NAME); ?> </label><br /> <div id="features_<?php echo $key; ?> "> <?php foreach ($value['column_content'] as $x => $feature) { ?> <div class="feature_item"> <input style="width:115px !important; min-width: inherit !important;" class="feature" id="feature_<?php echo $x; ?> " type="text" name="<?php echo $table; ?> [columns][<?php echo $key; ?> ][column_content][<?php echo $x; ?> ]" value="<?php echo $value['column_content'][$x]; ?> " /><br /> <button type="button" class="btn btn-mini btn-danger remove-feature"><i class="icon-remove icon-white"></i></button> </div> <?php } ?> </div> <button data-key="<?php echo $key; ?> " data-table="<?php echo $table; ?> " type="button" value="features_<?php echo $key; ?> " class="add_column_feature right btn btn-mini btn-info" name="<?php echo $table; ?> "><i class="icon-picture icon-white"></i> <?php _e('Add Row', UT_THEME_NAME); ?> </button> <div class="clear"></div> <hr /> <label><?php _e('Custom URL', UT_THEME_NAME); ?> </label><br /> <input style="width:148px !important; min-width: inherit !important;" id="<?php echo $key; ?> " type="text" name="<?php echo $table; ?> [columns][<?php echo $key; ?> ][column_url]" value="<?php echo $value['column_url']; ?> " /><br /> <hr /> <label><?php _e('Buttontext', UT_THEME_NAME); ?> </label><br /> <input style="width:148px !important; min-width: inherit !important;" id="<?php echo $key; ?> " type="text" name="<?php echo $table; ?> [columns][<?php echo $key; ?> ][column_buttontext]" value="<?php echo $value['column_buttontext']; ?> " /><br /> </div> <?php } // endforeach ?> <div class="clear"></div> </div><!-- /#single columns --> </div><!-- /#table items --> </form> </div> <?php }
function lambda_table_edit() { ?> <div id="lambda-option-panel" class="bootstrap-wpadmin"> <div id="ut-confirm-overlay" style="display:none;"></div> <div id="content_wrap"> <form id="tablemanager" method="post"> <div class="lambda-opttitle lambda-controls"> <div class="lambda-opttitle-pad" style="padding-bottom:0;"> <span class="lambda-version"><?php _e('Theme Version', 'delaware-theme'); echo UT_THEME_VERSION; ?> </span> <button type="submit" class="lambda_save ut-framework-btn right" name="submit" /><?php _e('Save All Changes', 'delaware-theme'); ?> </button> <div class="clear"></div> </div> </div> <div id="lambda-options-panel-title"> <?php echo _e('Table Manager', 'delaware-theme'); ?> </div> <div style="padding:20px; padding-top:0px;"> <?php global $wpdb; $tablename = $table = $_GET['edit']; ?> <input type="hidden" name="action" value="table_update" /> <input type="hidden" name="page_options" value="<?php echo $tablename; ?> " /> <div id="table-items" class="tab-pane"> <div id="single-columns row"> <?php $counter = 1; $table_prefix = lambda_get_table_prefix(); $table_lambda_tables = $table_prefix . "lambda_tables"; // get table data from database $table_content = $wpdb->get_var("SELECT table_content FROM {$table_lambda_tables} WHERE table_name = '{$tablename}'"); $table_content = lambda_prepare_load($table_content); if (!empty($table_content[$tablename]['columns'])) { $table_content = $table_content[$tablename]['columns']; } else { $table_content = lambda_table_item_array(); } foreach ($table_content as $key => $value) { ?> <div id="lambda_<?php echo $tablename . '_' . $key; ?> " class="one_fourth <?php echo $counter == 4 ? 'last' : ''; ?> "> <div class="lambda-box"> <span class="lambda-section-title"><?php _e('Column', 'delaware-theme'); ?> <?php echo $counter; ?> </span> <label for="column_<?php echo $tablename . '_' . $key; ?> "><?php _e('Activate Column?', 'delaware-theme'); ?> </label><br /> <div class="lambda_row"> <div class="btn-group" data-toggle="buttons-radio"> <button value="<?php echo $tablename . '_' . $key; ?> _on" type="button" class="btn <?php echo $value['column_active'] == 'on' ? 'active' : 'inactive'; ?> radio_<?php echo $value['column_active'] == 'on' ? 'active' : 'inactive'; ?> "><?php _e('on', 'delaware-theme'); ?> </button> <button value="<?php echo $tablename . '_' . $key; ?> _off" type="button" class="btn <?php echo $value['column_active'] == 'off' ? 'active' : 'inactive'; ?> radio_<?php echo $value['column_active'] == 'off' ? 'active' : 'inactive'; ?> "><?php _e('off', 'delaware-theme'); ?> </button> <input class="radiostate_<?php echo $value['column_active'] == 'on' ? 'active' : 'inactive'; ?> " style="display:none;" id="<?php echo $tablename . '_' . $key; ?> _on" type="radio" name="lambda_table_content[<?php echo $tablename; ?> ][columns][<?php echo $key; ?> ][column_active]" value="on" <?php echo $value['column_active'] == 'on' ? 'checked="checked"' : ''; ?> /><br /> <input class="radiostate_<?php echo $value['column_active'] == 'off' ? 'active' : 'inactive'; ?> " style="display:none;" id="<?php echo $tablename . '_' . $key; ?> _off" type="radio" name="lambda_table_content[<?php echo $tablename; ?> ][columns][<?php echo $key; ?> ][column_active]" value="off" <?php echo $value['column_active'] == 'off' ? 'checked="checked"' : ''; ?> /><br /> </div> </div> <hr /> <label for="column_<?php echo $tablename . '_' . $key; ?> "><?php _e('Column is featured?', 'delaware-theme'); ?> </label><br /> <div class="lambda_row"> <div class="btn-group" data-toggle="buttons-radio"> <button value="<?php echo $tablename . '_' . $key; ?> _yes" type="button" class="btn <?php echo $value['featured'] == 'yes' ? 'active' : 'inactive'; ?> radio_<?php echo $value['featured'] == 'yes' ? 'active' : 'inactive'; ?> "><?php _e('yes', 'delaware-theme'); ?> </button> <button value="<?php echo $tablename . '_' . $key; ?> _no" type="button" class="btn <?php echo $value['featured'] == 'no' ? 'active' : 'inactive'; ?> radio_<?php echo $value['featured'] == 'no' ? 'active' : 'inactive'; ?> "><?php _e('no', 'delaware-theme'); ?> </button> <input class="radiostate_<?php echo $value['featured'] == 'yes' ? 'active' : 'inactive'; ?> " style="display:none;" id="<?php echo $tablename . '_' . $key; ?> _yes" type="radio" name="lambda_table_content[<?php echo $tablename; ?> ][columns][<?php echo $key; ?> ][featured]" value="yes" <?php echo $value['featured'] == 'yes' ? 'checked="checked"' : ''; ?> /><br /> <input class="radiostate_<?php echo $value['featured'] == 'no' ? 'active' : 'inactive'; ?> " style="display:none;" id="<?php echo $tablename . '_' . $key; ?> _no" type="radio" name="lambda_table_content[<?php echo $tablename; ?> ][columns][<?php echo $key; ?> ][featured]" value="no" <?php echo $value['featured'] == 'no' ? 'checked="checked"' : ''; ?> /><br /> </div> </div> <hr /> <label><?php _e('Column Headline', 'delaware-theme'); ?> </label><br /> <input id="<?php echo $tablename . '_' . $key; ?> " type="text" name="lambda_table_content[<?php echo $tablename; ?> ][columns][<?php echo $key; ?> ][column_head]" value="<?php echo $value['column_head']; ?> " /><br /> <hr /> <label><?php _e('Column Price', 'delaware-theme'); ?> </label><br /> <input id="<?php echo $tablename . '_' . $key; ?> " type="text" name="lambda_table_content[<?php echo $tablename; ?> ][columns][<?php echo $key; ?> ][column_price]" value="<?php echo $value['column_price']; ?> " /><br /> <hr /> <label><?php _e('Price Currency', 'delaware-theme'); ?> </label><br /> <input id="<?php echo $tablename . '_' . $key; ?> " type="text" name="lambda_table_content[<?php echo $tablename; ?> ][columns][<?php echo $key; ?> ][column_curr]" value="<?php echo $value['column_curr']; ?> " /><br /> <hr /> <label><?php _e('Period', 'delaware-theme'); ?> </label><br /> <input id="<?php echo $tablename . '_' . $key; ?> " type="text" name="lambda_table_content[<?php echo $tablename; ?> ][columns][<?php echo $key; ?> ][column_time]" value="<?php echo $value['column_time']; ?> " /><br /> <hr /> <label><?php _e('Features', 'delaware-theme'); ?> </label><br /> <div id="features_<?php echo $tablename . '_' . $key; ?> "> <?php foreach ($value['column_content'] as $x => $feature) { ?> <div class="feature_item"> <input class="feature" id="feature_<?php echo $x; ?> " type="text" name="lambda_table_content[<?php echo $tablename; ?> ][columns][<?php echo $key; ?> ][column_content][<?php echo $x; ?> ]" value="<?php echo $value['column_content'][$x]; ?> " /><br /> <button type="button" class="btn remove-feature"><i class="icon-trash"></i></button> </div> <?php } ?> </div> <button data-key="<?php echo $key; ?> " data-group="lambda_table_content" data-table="<?php echo $table; ?> " type="button" value="features_<?php echo $tablename . '_' . $key; ?> " class="add_column_feature btn" name="lambda_table_content[<?php echo $tablename; ?> ]"><i class="icon-plus"></i> <?php _e('Add Row', 'delaware-theme'); ?> </button> <div class="clear"></div> <hr /> <label><?php _e('Custom URL', 'delaware-theme'); ?> </label><br /> <input style="width:148px !important; min-width: inherit !important;" id="<?php echo $tablename . '_' . $key; ?> " type="text" name="lambda_table_content[<?php echo $tablename; ?> ][columns][<?php echo $key; ?> ][column_url]" value="<?php echo $value['column_url']; ?> " /><br /> <hr /> <label><?php _e('Buttontext', 'delaware-theme'); ?> </label><br /> <input style="width:148px !important; min-width: inherit !important;" id="<?php echo $tablename . '_' . $key; ?> " type="text" name="lambda_table_content[<?php echo $tablename; ?> ][columns][<?php echo $key; ?> ][column_buttontext]" value="<?php echo $value['column_buttontext']; ?> " /><br /> <hr /> <?php $content_output = isset($value['column_htmltext']) ? $value['column_htmltext'] : ''; ?> <label><?php _e('HTML Content', 'delaware-theme'); ?> </label><br /> <textarea id="<?php echo $tablename . '_' . $key; ?> " name="lambda_table_content[<?php echo $tablename; ?> ][columns][<?php echo $key; ?> ][column_htmltext]"/><?php echo $content_output; ?> </textarea><br /> </div> </div> <?php $counter++; } // endforeach ?> <div class="clear"></div> </div><!-- /#single columns --> </div><!-- /#table items --> </div> </form> </div> </div> <?php }