Changeset 1635652
- Timestamp:
- 04/11/2017 09:57:54 PM (9 years ago)
- Location:
- mage-forms
- Files:
-
- 9 added
- 1 deleted
- 11 edited
-
assets/screenshot-3.png (added)
-
trunk/addons (added)
-
trunk/addons/mage-summon.php (added)
-
trunk/addons/thumbnails (added)
-
trunk/addons/thumbnails/mage_events.png (added)
-
trunk/addons/thumbnails/mage_forms.png (added)
-
trunk/addons/thumbnails/mage_listings.png (added)
-
trunk/addons/thumbnails/mage_products.png (added)
-
trunk/addons/thumbnails/mage_reviews.png (added)
-
trunk/cast/attributes.php (modified) (15 diffs)
-
trunk/cast/craft.php (modified) (2 diffs)
-
trunk/cast/diagrams.php (modified) (1 diff)
-
trunk/cast/mage-forms.php (modified) (10 diffs)
-
trunk/core/css/bootstrap.full.min.css (modified) (1 diff)
-
trunk/core/css/magecast.css (modified) (2 diffs)
-
trunk/core/mage-cast.php (modified) (5 diffs)
-
trunk/core/mage-sanitize.php (modified) (1 diff)
-
trunk/core/plugins (deleted)
-
trunk/mage-forms.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/source/js/scribe.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mage-forms/trunk/cast/attributes.php
r1633734 r1635652 30 30 if (!defined('MAGECAST_FORMS')) exit; 31 31 add_action('init', 'summon_magecast_forms'); 32 add_filter('mage_forms_validate', 'mage_forms_options');33 32 add_action( 'wp_enqueue_scripts', 'enqueue_scribe_scripts'); 34 33 add_action('admin_init', 'summon_scrolls'); … … 92 91 function summon_magecast_forms(){ 93 92 if (current_user_can('switch_themes')) { 94 add_action('admin_init', 'mage_forms_init' );95 93 add_action('admin_menu', 'summon_magecast_forms_dashboard'); 96 94 } 97 95 } 98 function mage_forms_init() {99 global $pagenow;100 if('media-upload.php' == $pagenow || 'async-upload.php' == $pagenow )add_filter( 'gettext','replace_mage_upload_text',1,3);101 add_filter( 'mage_sanitize_text', 'sanitize_text_field' );102 add_filter( 'mage_sanitize_select', 'mage_sanitize_enum', 10, 2);103 add_filter( 'mage_sanitize_radio', 'mage_sanitize_enum', 10, 2);104 add_filter( 'mage_sanitize_legend', 'mage_sanitize_enum', 10, 2);105 add_filter( 'mage_sanitize_images', 'mage_sanitize_enum', 10, 2);106 add_filter( 'mage_sanitize_checkbox', 'mage_sanitize_checkbox' );107 add_filter( 'mage_sanitize_multicheck', 'mage_sanitize_multicheck', 10, 2 );108 add_filter( 'mage_sanitize_upload', 'mage_sanitize_upload' );109 $mage_settings = get_option('mage_forms');110 $id = 'mage_forms';111 if (isset($mage_settings['id'])){112 if ($mage_settings['id'] !== $id) {113 $mage_settings['id'] = $id;114 update_option('mage_forms',$mage_settings);115 }116 } else {117 $mage_settings['id'] = $id;118 update_option('mage_forms',$mage_settings);119 }120 if (get_option($mage_settings['id']) === false) mage_setdefaults('forms');121 register_setting('mage_forms',$mage_settings['id'],'mage_forms_validate' );122 }123 96 function summon_magecast_forms_dashboard(){ 124 97 global $themename, $shortname, $submenu, $menu; 125 98 //$mage_forms_page = add_menu_page('Mage Forms Settings','Mage Forms','manage_options','mage_forms', 'edit.php?post_type=mage_form',MAGECAST_FORMS_SOURCE.'img/icon.png','27.9'); 99 do_action('summon_mage_forms_menu_first'); 126 100 $mage_forms_help = add_submenu_page('edit.php?post_type=mage_form', 'Mage Forms Settings', 'Help', 'manage_options', 'mage_forms_help', 'mage_forms_page'); 127 101 $submenu['edit.php?post_type=mage_form'][5][0] = 'Forms'; … … 130 104 add_action('admin_print_scripts-post.php', 'mage_form_scripts' ); 131 105 add_action('admin_print_scripts-post-new.php', 'mage_form_scripts' ); 132 do_action('summon_mage_forms_ dashboard');106 do_action('summon_mage_forms_menu_last'); 133 107 } 134 108 function mage_form_scripts(){ … … 147 121 <div id="container" class="row"> 148 122 <form id="mage-form" method="post" class="form-horizontal" action="options.php"> 149 <?php settings_fields('mage_forms'); ?> 150 <div id="magecast-content" class="magecast-content tab-content"><?php fields(mage_forms_options(),'forms'); ?></div> 151 <!-- Footer Navbar and Submit --> 152 <div class="navbar navbar-static-bottom"> 153 <input type="submit" class="btn btn-brown" name="update" id="update" value="<?php esc_attr_e( 'Save Options', 'mage-forms' ); ?>" /> 154 </div> 123 <?php settings_fields('mage_forms_help'); ?> 124 <div id="magecast-content" class="magecast-content tab-content"><?php mage_fields(mage_forms_help(),'form_help'); ?></div> 155 125 </form> 156 126 </div> 157 127 </div><?php 158 128 } 159 function mage_forms_validate($input) { 160 global $craft, $magecast; 161 if (!current_user_can('manage_options'))die('Insufficient Permissions'); 162 $clean = array(); 163 $options = mage_forms_options(); 164 foreach ($options as $option ){ 165 if (!isset($option['id']))continue; 166 if (!isset($option['type']))continue; 167 $id = cog($option['id']); 168 if (!isset($input[$id])) { 169 if (in_array($option['type'], array('text','textarea','select','radio','color','upload')))$input[$id] = isset($option['std'])? $option['std']:''; 170 if ('checkbox' == $option['type'])$input[$id] = false; 171 if ('multicheck' == $option['type'])$input[$id] = array(); 172 } 173 if (has_filter('mage_sanitize_' .$option['type'])){ 174 $clean[$id] = apply_filters('mage_sanitize_' . $option['type'], $input[$id], $option); 175 } 176 } 177 add_settings_error('mage_forms','save_options', __( 'Options Saved', 'mage-forms' ), 'updated modal fade in' ); 178 return $clean; 179 } 180 function mage_forms_options(){ 129 function mage_forms_help(){ 181 130 //global $wp_roles; 182 131 //$mage_roles = (array) $wp_roles->get_names(); … … 185 134 //$users = array(0=>'Submitting User') + mage_get_users($args=array('role'=>'administrator')); 186 135 $options = array(); 187 $options[] = array('name' => ' Forms','icon' => 'star','type' => 'heading');188 $options[] = array('name' => __('General','mage-forms'),'parent' => ' forms','type' => 'subheading');136 $options[] = array('name' => 'Help','icon' => 'star','type' => 'heading'); 137 $options[] = array('name' => __('General','mage-forms'),'parent' => 'help','type' => 'subheading'); 189 138 /* 190 139 $options[] = array( … … 206 155 'type'=>'html'); 207 156 $options = apply_filters('mage_forms_attributes_general',$options); 208 $options[] = array(209 'name' => __('Debug Mode','mage-reviews'),210 'desc' => __('Enable WP Error output upon form submission on the front end.','mage-reviews'),211 'id' => 'mage_form_debug',212 'type' => 'checkbox',213 'std' => '0');214 215 $options[] = array(216 'name' => __('In Development!','mage-forms'),217 'type' => 'legend');218 $options[] = array(219 'content' => '<p>The Mage Forms plugin is still in heavy development. Please help this plugin improve by <u>reporting any issues</u>, <u>incompatibility with other plugins and themes</u>, <u>unclear descriptions</u>, or <u>new ideas & feature requests</u> to the <a href="https://wordpress.org/support/plugin/mage-forms/" rel="nofollow external" target="_blank">support forums</a> or by contacting me at <a href="mailto:[email protected]" target="_blank">[email protected]</a> directly.</p>220 <p>I recommend backing up the Mage Forms plugin before updating it, when a new version of Mage Forms becomes available.</p>221 <p>If you enjoy this plugin and find it useful, please support it by leaving a good review on <a href="https://wordpress.org/plugins/mage-forms/" rel="nofollow external" target="_blank">WordPress</a> or by <a href="paypal.me/maximusbusiness" target="_blank">making a donation</a>. Your support and patience is highly appreciated and helps keep the enthusiasm and motivation for its development alive.</p>222 <p><strong>Thank You.</strong></p>',223 'type'=>'html');224 $options[] = array(225 'type' => 'html',226 'for'=>'legend');227 157 /* 228 158 $options[] = array( … … 442 372 'type' => 'html', 443 373 'for'=>'legend'); 444 $options[] = array('name' => __('Custom Fields','mage-forms'),'parent' => 'forms','type' => 'subheading'); 374 $options = apply_filters('mage_form_help_general_after',$options); 375 $options[] = array('name' => __('Custom Fields','mage-forms'),'parent' => 'help','type' => 'subheading'); 445 376 $options[] = array( 446 377 'name' => __('Custom Field Shortcode & Template Tag','mage-forms'), … … 583 514 'type' => 'html', 584 515 'for'=>'legend'); 516 $options = apply_filters('mage_form_help_custom_fields_after',$options); 585 517 return $options; 586 518 } … … 588 520 589 521 function mage_scroll_settings() { 590 global $post ;522 global $post,$wp_roles; 591 523 $post_form = array( 592 524 'shortcode'=>array( … … 597 529 ); 598 530 summon_mage_form_fields(array('id'=>$post->ID,'nonce'=>'mage_form_save'), $post_form, 2); 599 global $wp_roles;600 531 $mage_roles = (array) $wp_roles->get_names(); 601 532 $mage_roles['public'] = 'Public'; … … 662 593 ); 663 594 summon_mage_form_fields(array('id'=>$post->ID,'title'=>'Media Upload Settings','class'=>'pform'), $pform,2); 595 do_action('after_mage_scroll_settings'); 664 596 $editing = array( 665 597 'shortcode'=>array( … … 669 601 ), 670 602 ); 671 summon_mage_form_fields(array('id'=>$post->ID,'title'=>'Edit Link','class'=>'pform','content'=> 'Requires the ID of the page that the [form] is placed in, not the ID of the form itself. Should be placed within loop.'),$editing,2);603 summon_mage_form_fields(array('id'=>$post->ID,'title'=>'Edit Link','class'=>'pform','content'=>__('Requires the ID of the page that the [form] is placed in, not the ID of the form itself. Should be placed within loop.','mage-forms')),$editing,2); 672 604 } 673 605 function mage_scroll_cast() { … … 791 723 ), 792 724 ); 793 summon_mage_form_fields(array('id'=>$post->ID,'class'=>'pform','title'=>'Setting Default Category & Values','content'=>'If you want a form to submit content into specific categories by default, or would like to include specific values without user input, you can set the value in a <strong>[text]</strong> element and simply hide it. Here is how you would set a form to always submit posts into category, using the category ID in the value.'), $cast); 725 summon_mage_form_fields(array('id'=>$post->ID,'class'=>'pform','title'=>'Setting Default Category & Values','content'=>'If you want a form to submit content into specific categories by default, or would like to include specific values without user input, you can set the value in a <strong>[text]</strong> element and simply hide it. Here is how you would set a form to always submit posts into category, using the category ID in the value.'), $cast); 726 do_action('after_mage_scroll_cast'); 794 727 //echo !empty($form)? mage_solve_form(false, $form, array(),'dump') : ''; 795 728 } … … 818 751 } 819 752 function mage_forms_column_data($column, $post_ID) { 820 $cast = (array) maybe_unserialize( get_post_meta($post_ID,' cast',true) );753 $cast = (array) maybe_unserialize( get_post_meta($post_ID,'mage_forms',true) ); 821 754 switch ($column) { 822 755 case 'shortcode': … … 832 765 } 833 766 if (isset($out)) echo $out; 834 } 767 } 768 add_filter('mage_forms_vessel_output','mage_forms_hide_upload_fields',10,2); 769 function mage_forms_hide_upload_fields($output,$args){ 770 if (in_array($args['type'],array('upload','attachments'))){ 771 if (!is_user_logged_in()) return ''; 772 } 773 return $output; 774 } -
mage-forms/trunk/cast/craft.php
r1633734 r1635652 45 45 } 46 46 function mage_form_edit( $atts, $content = null ){ 47 $args = shortcode_atts(mage_default_atts(array('blog'=>0),'link'), $atts); 48 global $post; 49 if ( ! $post = get_post( $id ) )return; 47 $args = shortcode_atts(mage_default_atts(array('blog'=>0, 'id'=>0),'link'), $atts); 48 global $post; 50 49 $type = $post->post_type; 51 50 $post_type_object = get_post_type_object( $type ); 52 if ( !$post_type_object ) return; 53 if(!current_user_can('edit_post', $post->ID))return; 51 52 $current_user = wp_get_current_user(); 53 if ($post->post_author != $current_user->ID) { 54 if (!current_user_can( $post_type_object->cap->edit_post, $post->ID )) return; 55 } 54 56 $name = !empty($args['name'])? $args['name'] : 'edit-'.$type; 55 57 $url = ($args['id'] != 0)? get_permalink( $args['id'] ): get_permalink(get_page_by_path( $name )); … … 115 117 if (!mage_form_permission_cap($attr['user_role'])) return __('You do not have sufficient permission to use this form.','mage-forms'); 116 118 } 119 $attr = apply_filters('mage_forms_attr',$attr,$cast); 117 120 } elseif (!empty($content)) $output .= $content; 118 121 do_action('after_mage_form_element'); -
mage-forms/trunk/cast/diagrams.php
r1633734 r1635652 280 280 } 281 281 return false; 282 //return $uploaded_file; 282 283 } 283 284 function mage_communicate(){ -
mage-forms/trunk/cast/mage-forms.php
r1633734 r1635652 50 50 //'form_post_edit'=>array('type'=>'checkbox'), // unknown 51 51 ); 52 $fields = apply_filters('mage_capture_mage_forms_fields',$fields); 52 53 foreach($fields as $field => $val) { 53 54 if ($val['type'] == 'checkbox'){ … … 411 412 } 412 413 $output .= '</div>'; 413 return $output;414 return apply_filters('mage_forms_vessel_output',$output,$args); 414 415 } 415 416 function mage_get_forms() { … … 425 426 $cast = array(); 426 427 $fields = '/\[(?P<type>textarea|select|radio|text|checkbox|multicheck).*?(name=["\'](?P<name>.*?)["\'].*?|label=["\'](?P<label>.*?)["\'].*?|options=["\'](?P<options>.*?)["\'].*?|req=(?P<req>0|1).*?)+\]/i'; 428 $fields = apply_filters('mage_solve_formula', $fields); 427 429 if (preg_match_all($fields, $content, $names)) { 428 430 $i = 0; … … 536 538 $user = wp_get_current_user(); 537 539 global $mage_form_settings; 538 $ errors = array();539 if (!empty($_FILES['mage_attachments']))$ errors= scribe_sanitize_upload();540 $data = array('custom_fields' => array(), 'errors'=>array(),'attr'=>$attr); 541 if (!empty($_FILES['mage_attachments']))$data['errors'] = scribe_sanitize_upload(); 540 542 $values = array( 541 543 'post_title' => '', … … 564 566 $args['post_status'] = $attr['post_status']; 565 567 $args['post_type'] = $attr['post_type']; 566 $custom_fields = $custom_data = $events = $raw_date = $custom_dates = $location = array();567 568 568 if (is_array($fields)) { 569 569 foreach ($fields as $field) { … … 572 572 $val = $_POST[$field['name']]; 573 573 if ($val !== 'yes') $val = ''; 574 $ custom_fields[$field['name']] = $val;574 $data['custom_fields'][$field['name']] = $val; 575 575 } elseif (array_key_exists($field['name'], $_POST)) { 576 576 $val = $_POST[$field['name']]; … … 578 578 if (($field['req'] == 1 ) && empty($val)) { 579 579 $name = is_array($field['name'])? implode(',',$field['name']): trim(strip_tags($field['name'])); 580 $ errors[] = $name;580 $data['errors'][] = $name; 581 581 } else { 582 $ custom_fields[$field['name']] = $val;582 $data['custom_fields'][$field['name']] = $val; 583 583 } 584 584 } //array_key_exists 585 585 } //foreach 586 586 } 587 if ($errors) return $errors; 587 $data = apply_filters('mage_forms_submit_data',$data); 588 if ($data['errors']) return $data['errors']; 588 589 $attach_id = isset( $_POST['mage_img_upload'] ) ? $_POST['mage_img_upload']: false; 589 590 do_action('before_mage_form_element'); … … 592 593 unset($args['post_type']); 593 594 unset($args['post_status']); 594 } else { 595 if ($ attr['post_author'] == 0 && $attr['user_role'] == 'public') return __('Error: A Front End Form set to public must select a user for post author within the Forms settings.','mage-forms');596 if ($ attr['post_author'] !== 0) $user == get_user_by( 'id',$attr['post_author']);597 if ($ attr['user_role'] !== 'public'){595 } else { 596 if ($data['attr']['post_author'] == 0 && $data['attr']['user_role'] == 'public') return __('Error: A Front End Form set to public must select a user for post author within the Forms settings.','mage-forms'); 597 if ($data['attr']['post_author'] !== 0) $user == get_user_by( 'id',$data['attr']['post_author']); 598 if ($data['attr']['user_role'] !== 'public'){ 598 599 if (!is_user_logged_in()) return __('You must be logged in to post.','mage-forms'); 599 if ($ attr['post_author'] == 0 && !mage_form_permission_cap($attr['user_role'])) return __('You do not have sufficient permissions to submit this post.','mage-forms');600 if ($data['attr']['post_author'] == 0 && !mage_form_permission_cap($data['attr']['user_role'])) return __('You do not have sufficient permissions to submit this post.','mage-forms'); 600 601 } 601 602 if (!is_object($user)) return __('No user assigned.','mage-forms'); 602 $args['post_author'] = apply_filters('mage_form_post_user_id',$ user->ID);603 $args['post_author'] = apply_filters('mage_form_post_user_id',$data['attr']['post_author']); 603 604 } 604 605 if (!isset($args['ID'])){ … … 608 609 mage_upload_attachments($post_id); 609 610 //if (!empty($format)) set_post_format( $id , $format); 610 if (isset($ attr['post_email']) && !empty($attr['post_email'])) mage_form_send_email($attr['post_email'],$user,$post_id );611 if (!empty($ custom_fields)) mage_add_post_meta($custom_fields,$post_id, $attr['post_custom_fields']);611 if (isset($data['attr']['post_email']) && !empty($data['attr']['post_email'])) mage_form_send_email($data['attr']['post_email'],$user,$post_id ); 612 if (!empty($data['custom_fields'])) mage_add_post_meta($data['custom_fields'],$post_id, $data['attr']['post_custom_fields']); 612 613 if ($attach_id) set_post_thumbnail( $post_id, $attach_id ); 613 614 attach_file_to_post($post_id); 614 $post_id = $ attr['post_redirect'] == 0? $post_id : $attr['post_redirect'];615 $post_id = $data['attr']['post_redirect'] == 0? $post_id : $data['attr']['post_redirect']; 615 616 wp_redirect(get_permalink( $post_id )); 616 617 exit; … … 625 626 mage_upload_attachments($post_id); 626 627 //if (!empty($format)) set_post_format( $id , $format); 627 if ( $ custom_fields ) mage_update_post_meta($custom_fields,$post_id, $attr['post_custom_fields']);628 if ( $data['custom_fields'] ) mage_update_post_meta($data['custom_fields'],$post_id, $data['attr']['post_custom_fields']); 628 629 if ( $attach_id ) set_post_thumbnail( $post_id, $attach_id ); 629 630 attach_file_to_post($post_id); -
mage-forms/trunk/core/css/bootstrap.full.min.css
r1361581 r1635652 327 327 color: #428bca; 328 328 text-decoration: none; 329 }330 331 a:hover,332 a:focus {333 color: #2a6496;334 text-decoration: underline;335 }336 337 a:focus {338 outline: thin dotted #333;339 outline: 5px auto -webkit-focus-ring-color;340 outline-offset: -2px;341 329 } 342 330 -
mage-forms/trunk/core/css/magecast.css
r1361581 r1635652 431 431 .popover.left .arrow {left:auto;overflow:visible;margin-left:auto;bottom:auto;z-index:auto;} 432 432 .popover.left .arrow:after {left:auto;top:auto;transform: none;-webkit-transform: none;-ms-transform: none;z-index:auto;background-color:transparent;} 433 .mage-core-plugin {padding-bottom: 15px;} 433 434 .mage-core-plugin, .mage-core-plugin img {opacity:0.5;} 434 435 .mage-core-plugin.active, .mage-core-plugin.active img {opacity:1;} … … 457 458 a.mage-core-btn {text-shadow: 0 1px 1px #ffffff;font-weight:bold;} 458 459 a.mage-pro-active {color: #336699;} 460 a.accordion-toggle:focus {text-decoration:none;outline:none;box-shadow:none;} 461 .mage-core-plugin.mage-forms-pro {opacity:1;} -
mage-forms/trunk/core/mage-cast.php
r1633734 r1635652 83 83 <form id="mage-form" method="post" class="form-horizontal" action="options.php"> 84 84 <?php settings_fields('magecast'); ?> 85 <div id="magecast-content" class="magecast-content tab-content"><?php fields($craft->options(),'cast'); ?></div>85 <div id="magecast-content" class="magecast-content tab-content"><?php mage_fields($craft->options(),'cast'); ?></div> 86 86 </form> 87 87 </div> … … 217 217 return $options; 218 218 } 219 if (!function_exists(' fields')){220 function fields($page='',$opt_group='') {219 if (!function_exists('mage_fields')){ 220 function mage_fields($page='',$opt_group='') { 221 221 global $allowedtags; 222 222 $mage_settings = get_option('mage_'.$opt_group); … … 274 274 $output .= $pre.'<input id="' . esc_attr( $value['id'] ) . '" name="' . esc_attr($option_name.'['.$value['id'].']').'" type="'.$text.'" class="form-control" value="' . esc_attr( $val ) . '" '.$ph.$dis.' />'.$pre2.'</div>'.$append.$slider; 275 275 break; 276 case 'number': 277 if (!isset($value['col'])) $value['col'] = 6; 278 $min = isset($value['min'])? $value['min'] : 0; 279 $max = isset($value['max'])? $value['max'] : 99; 280 $output .= $prepend.'<div class="col-lg-'.$value['col'].'">'; 281 $output .= $pre.'<input min="'.$min.'" max="'.$max.'" id="' . esc_attr( $value['id'] ) . '" name="' . esc_attr($option_name.'['.$value['id'].']').'" type="number" class="form-control" value="' . esc_attr( $val ) . '" '.$ph.$dis.' />'.$pre2.'</div>'.$append.$slider; 282 break; 276 283 case 'textarea': 277 284 $rows = isset($value['rows'])? $value['rows'] : '6'; 278 285 $val = stripslashes( $val ); 279 286 $output .= '<label class="col-lg-2 control-label" for="' .$value['id']. '">' .$value['name'].$shortcode.'</label>'; 280 $output .= '<div class="col-lg-6"><textarea id="' . esc_attr( $value['id'] ) . '" class="form-control mage-textarea" name="' . esc_attr( $option_name . '[' . $value['id'] . ']') . '" rows="' . $rows . '">' . esc_textarea( $val ) . '</textarea></div>';287 $output .= '<div class="col-lg-6"><textarea id="' . esc_attr( $value['id'] ) . '" class="form-control mage-textarea" name="' . esc_attr($option_name.'['.$value['id'].']') . '" rows="' . $rows . '">' . esc_textarea( $val ) . '</textarea></div>'; 281 288 break; 282 289 case 'select': … … 420 427 break; 421 428 case "catalog": 422 $mage_plugin = str_replace('/core/mage-cast.php','',plugin_basename( __FILE__ ));423 $output .= '<div class="alert alert-info" role="alert"><strong>Mage Core</strong> loaded from: '.$mage_plugin.'</div>';424 429 $output .= '<div class="row">'; 430 /* Addon Header content here... */ 425 431 foreach($value['options'] as $option => $opt){ 426 $active = $opt['active']? ' active' : ''; 427 $class = !empty($opt['class'])? $opt['class'] : 'col-sm-4 col-md-3'; 428 $desc = !empty($opt['desc'])? $opt['desc'] : ''; 429 $output .= '<div id="mage_dashboard_'.$option.'" class="mage-core-plugin '.$class.' '.$active.'">'; 432 $opt['active'] = isset($opt['active']) && $opt['active']? true: false; 433 $class = $opt['active']? 'active ' : ''; 434 $class .= !empty($opt['class'])? $opt['class'] : 'col-sm-4 col-md-3'; 435 $desc = !empty($opt['desc'])? $opt['desc'] : ''; 436 $output .= '<div id="mage_dashboard_'.$option.'" class="mage-core-plugin '.$class.'">'; 430 437 $output .= '<div class="thumbnail mage-core-plugin-thumbnail">'; 431 $output .= '<img src="'.MAGECAST .'plugins/'.$option.'.png" />';438 $output .= '<img src="'.MAGECAST_FORMS_URL.'addons/thumbnails/'.$option.'.png" />'; 432 439 $output .= '<div class="caption mage-core-plugin-caption">'; 433 440 $ver = isset($opt['version'])? '<span class="label label-primary">'.$opt['version'].'</span>' : ''; 434 $output .= '<h3 class="mage-core-plugin-title">'.$opt['name'].' '.$ver.'</h3><p>'.$desc.'</p>'; 441 $active = $opt['active']? '<span class="label label-success">'.__('Active','mage-forms').'</span>' : '<span class="label label-danger">'.__('Not Active','mage-forms').'</span>'; 442 $output .= '<h3 class="mage-core-plugin-title">'.$opt['name'].' '.$ver.' '.$active.'</h3><p>'.$desc.'</p>'; 435 443 $output .= '<div class="list-group">'; 444 $rel = 'target="_blank" rel="external"'; 436 445 if($opt['active']){ 437 446 foreach ($opt as $op => $in){ 438 if (in_array($op, array('settings','support','pro')) && !empty($in)) { 439 $rel = 'target="_blank" rel="external"'; 440 if ($op == 'pro') { 441 if(isset($opt['pro_active'])){ 442 $output .= '<a href="'.$in.'" class="list-group-item mage-core-btn mage-pro-active" '.$rel.'>Pro: Active</a>'; 443 } else { 444 $output .= '<a href="'.$in.'" class="list-group-item mage-core-btn" '.$rel.'>Pro</a>'; 445 } 446 } elseif ($op == 'settings') { 447 $output .= '<a href="'.$in.'" class="list-group-item mage-core-btn">Settings</a>'; 447 if (in_array($op, array('settings','support')) && !empty($in)) { 448 if ($op == 'settings') { 449 $output .= '<a href="'.$in.'" class="list-group-item mage-core-btn">Settings</a>'; 448 450 } else { 449 451 $output .= '<a href="'.$in.'" class="list-group-item mage-core-btn" '.$rel.'>'.ucfirst($op).'</a>'; … … 452 454 } 453 455 } 454 } elseif(mage_is_plugin_installed($option.'/'.$option.'.php')){ 456 } elseif($opt['active'] == false && isset($opt['pro'])) { 457 $output .= '<a href="'.$opt['pro'].'" class="list-group-item mage-core-btn mage-pro-active" '.$rel.'>Activate</a>'; 458 } /* additional options - now deprecated 459 elseif(mage_is_plugin_installed($option.'/'.$option.'.php')){ 455 460 $url = mage_plugin_activation_url($option); 456 461 $output .= '<a href="'.$url.'" class="list-group-item" title="'.esc_attr__('Activate ') .$opt['name']. '">Activate</a>'; 457 458 462 } else { 459 463 $url = is_main_site()? esc_url(network_admin_url( 'plugin-install.php?tab=plugin-information&plugin='.$option.'&TB_iframe=true&width=600&height=550')) : esc_url( network_admin_url( 'plugin-install.php?tab=search&s='.$option)); 460 464 $thick = is_main_site()? 'thickbox' : ''; 461 465 $output .= '<a href="'.$url.'" class="'.$thick.' list-group-item" title="'.esc_attr__('Install ') .$opt['name']. '">Install</a>'; 462 } 466 } */ 463 467 $output .= '</div>'; 464 468 $output .= '</div></div></div>'; -
mage-forms/trunk/core/mage-sanitize.php
r1633734 r1635652 78 78 return $output; 79 79 } 80 function mage_sanitize_textarea($input) { 81 global $allowedposttags; 82 $output = wp_kses( $input, $allowedposttags); 83 return $output; 84 } -
mage-forms/trunk/mage-forms.php
r1633734 r1635652 6 6 * Author: Mage Cast 7 7 * Author URI: http://www.maximusbusiness.com/plugins/mage-forms-pro/ 8 * Version: 1.1. 38 * Version: 1.1.4 9 9 * Text Domain: mage-forms 10 10 * Domain Path: /lang/ … … 14 14 <?php 15 15 if (!defined('ABSPATH')) exit; 16 define('MAGECAST_FORMS_VER', '1.1. 3');16 define('MAGECAST_FORMS_VER', '1.1.4'); 17 17 define('MAGECAST_FORMS', dirname( __FILE__ ). '/'); 18 18 define('MAGECAST_FORMS_URL',plugins_url('/',__FILE__)); -
mage-forms/trunk/readme.txt
r1633736 r1635652 1 1 === Mage Front End Forms === 2 2 Contributors: Maximilian Ruthe 3 Donate link: https://www.paypal. com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PVZ7QRZJCZXLY3 Donate link: https://www.paypal.me/maximusbusiness 4 4 Tags: form, forms, front-end, frontend, front, user, custom, admin, builder, tool, creator, manager, dashboard, post, submit, submission, mage 5 5 Requires at least: 3.0.1 6 6 Tested up to: 4.7 7 Stable tag: 1.1. 37 Stable tag: 1.1.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 13 13 == Description == 14 14 15 Mage Front End Forms allows you to create a Front End submission form for every post type you desire. 16 The main features that distinguish the Mage Forms plugin are the multiple forms that can be created, each with their own unique settings, such as form fields, post type, email to notify and more. 15 Mage Front End Forms allows you to create a Front End post submission form for any post type. Each post form can have unique settings with fully customizable fields and design. 17 16 18 = Features Include = 19 * Create multiple front-end submission forms for any post types. 20 * Allows users to submit and edit posts, pages or any custom post types from the front end. 21 * Complete customizable forms and input field placements via shortcodes. 22 * Enhanced category / custom taxonomy select dropdowns with child terms. 23 * Multiselect and tag select features for post tag taxonomies. 24 * Featured image and attachment uploads from the frontend. 25 * Email notification option on successful form submissions. 26 * Choose minimum user role for front end post access. 27 * Auto-Publish or set to Pending/Draft options after Form submission. 28 * Public / Guest Form submissions and assigning authorship to existing users. 29 * Redirect to submitted post or custom URL after successful submission. 17 = Submit and Edit Posts from the Frontend = 18 You can create multiple forms for users to submit and edit posts, pages or any custom post type from the front-end. 30 19 31 = Upcoming Features =32 Future updates will include BuddyPress capabilities, Author Dashboards to manage submitted content and more. Here are a few types of websites that may benefit from these Front End User posting capabilities: 20 = Custom Taxonomy Dropdows and Taggable input fields = 21 Allow users to select categories, tags or any custom taxonomy. Selecting a category or custom taxonomy with child terms will automatically open a subcategory dropdown until a term is chosen that has no child terms. You can also include taggable input for post tag taxonomies or other multi-select fields. 33 22 23 = Frontend Featured Image and Attachment Uploads = 24 Upload a featured image or a whole gallery via the attachment upload feature, all easily managed from the frontend. Set a limit to how many attachments each post can have and what file types to allow. Users can manage, arrange, label and remove uploads directly form the front-end form. 25 26 = Complete Customizable Forms and Custom Meta Fields = 27 Choose what post fields you want users to submit. You can include infinite custom fields that save as custom post meta and set their requirements. The form builder allows complete custimization via the editor, letting you place input fields freely with any design. 28 29 = User Form Submission Settings = 30 You can restrict frontend posting to users with a minimum role, such as admins, editors, subscribers or even allow the public (non-members) to submit a form. Other settings allow you choose whether to submit a post in a pending or draft status, or to publish immediately; where to redirect users after submission; which email to notify upon submisson; and many other custom settings. 31 32 = Features and Addons = 33 Mage Front End Forms is a free frontend post plugin for your site and contains the best features and customization options. To enhance your Mage Forms with more advanced features and tools, the following addons are at your disposal: 34 35 * Customizable User Posts dashboard to manage submissions, with integrated post edit and delete options. 36 * Register users after form submissions with new sign-up fields. Ideal for guest posting and public forms. 37 * Product submission forms with WooCommerce compatibility. 38 * and other upcoming [premium addons](http://www.maximusbusiness.com/plugins/mage-forms-pro/ "Mage Forms Pro"). 39 34 40 = Front End User Form Examples = 41 Mage Front End Forms are ideal for custom WordPress sites with robust content-publishing features. Here are a few types of websites that can benefit from these frontend user posting capabilities: 42 35 43 * Guest Post forms and Multi-Author Blogs. 36 44 * Online Business Directory with Listing/Address Submissions … … 52 60 == Screenshots == 53 61 54 1. Snapshot of [Dogsniffer](http://dogsniffer.com/ "Dog Friendly Businesses Reviews"). 55 2. Mage Cast and [Maximus Business Plugins](http://maximusbusiness.com/ "Maximus Business WordPress Plugins"). 62 1. Snapshot of Dogsniffer Listing Forms 63 2. A default Front End Post Form 64 3. Creating Mage Forms in Admin Editor 56 65 57 66 == Changelog == 67 68 = 1.1.4 = 69 * Set default category / custom meta value upon submit. 70 * Upload and Attachment fields are now hidden to logged out users. 71 * Guest Post / Non-member Posting should now work properly. 72 * Additional documentation for form usage. 73 * New Addons page 58 74 59 75 = 1.1.3 = … … 104 120 == Upgrade Notice == 105 121 122 = 1.1.4 = 123 * Set default category / custom meta value upon submit. 124 * Upload and Attachment fields are now hidden to logged out users. 125 * Guest Post / Non-member Posting should now work properly. 126 * Additional documentation for form usage. 127 * New Addons page 128 106 129 = 1.1.3 = 107 130 * Featured Image and Attachment Upload improvements and fixes. -
mage-forms/trunk/source/js/scribe.js
r1633734 r1635652 98 98 var resp = $.parseJSON(response.response); 99 99 //$('#' + file.id + " b").html("100%"); 100 $('#' + file.id).remove();100 101 101 if( resp.success ) { 102 102 $('.mage-form-upload-thumbnail').append(resp.html); 103 103 $('#mage-form-upload-button').hide(); 104 $('#' + file.id).remove(); 104 105 } 105 106 });
Note: See TracChangeset
for help on using the changeset viewer.