Plugin Directory

Changeset 1635652


Ignore:
Timestamp:
04/11/2017 09:57:54 PM (9 years ago)
Author:
Maximilian Ruthe
Message:

Updating to 1.1.4

Location:
mage-forms
Files:
9 added
1 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • mage-forms/trunk/cast/attributes.php

    r1633734 r1635652  
    3030if (!defined('MAGECAST_FORMS')) exit;
    3131add_action('init', 'summon_magecast_forms');
    32 add_filter('mage_forms_validate', 'mage_forms_options');
    3332add_action( 'wp_enqueue_scripts', 'enqueue_scribe_scripts');
    3433add_action('admin_init', 'summon_scrolls');
     
    9291function summon_magecast_forms(){   
    9392    if (current_user_can('switch_themes')) {   
    94         add_action('admin_init', 'mage_forms_init' );   
    9593        add_action('admin_menu', 'summon_magecast_forms_dashboard');               
    9694    }
    9795}
    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     }
    12396function summon_magecast_forms_dashboard(){
    12497    global $themename, $shortname, $submenu, $menu;
    12598    //$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');
    126100    $mage_forms_help = add_submenu_page('edit.php?post_type=mage_form', 'Mage Forms Settings', 'Help', 'manage_options', 'mage_forms_help', 'mage_forms_page');
    127101    $submenu['edit.php?post_type=mage_form'][5][0] = 'Forms';
     
    130104    add_action('admin_print_scripts-post.php', 'mage_form_scripts' );
    131105    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');
    133107}
    134108function mage_form_scripts(){
     
    147121<div id="container" class="row"> 
    148122    <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>
    155125    </form>
    156126</div>
    157127</div><?php
    158128}
    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(){
     129function mage_forms_help(){
    181130    //global $wp_roles;
    182131    //$mage_roles = (array) $wp_roles->get_names();
     
    185134    //$users = array(0=>'Submitting User') + mage_get_users($args=array('role'=>'administrator'));
    186135    $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');
    189138    /*
    190139    $options[] = array(
     
    206155        'type'=>'html');
    207156    $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');
    227157    /*
    228158    $options[] = array(
     
    442372        'type' => 'html',
    443373        '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');
    445376    $options[] = array(
    446377        'name' => __('Custom Field Shortcode & Template Tag','mage-forms'),
     
    583514        'type' => 'html',
    584515        'for'=>'legend');
     516    $options = apply_filters('mage_form_help_custom_fields_after',$options);
    585517    return $options;   
    586518}
     
    588520
    589521function mage_scroll_settings() {
    590     global $post;   
     522    global $post,$wp_roles;
    591523    $post_form = array(
    592524    'shortcode'=>array(
     
    597529    );
    598530    summon_mage_form_fields(array('id'=>$post->ID,'nonce'=>'mage_form_save'), $post_form, 2);
    599     global $wp_roles;
    600531    $mage_roles = (array) $wp_roles->get_names();
    601532    $mage_roles['public'] = 'Public';
     
    662593    );         
    663594    summon_mage_form_fields(array('id'=>$post->ID,'title'=>'Media Upload Settings','class'=>'pform'), $pform,2);
     595    do_action('after_mage_scroll_settings');
    664596    $editing = array(   
    665597    'shortcode'=>array(
     
    669601        ),
    670602    );
    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);
    672604}
    673605function mage_scroll_cast() {
     
    791723        ), 
    792724    );     
    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');
    794727    //echo !empty($form)? mage_solve_form(false, $form, array(),'dump') : '';
    795728}
     
    818751}
    819752function 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) );
    821754    switch ($column) {
    822755        case 'shortcode':
     
    832765    }
    833766    if (isset($out)) echo $out;
    834 
     767}
     768add_filter('mage_forms_vessel_output','mage_forms_hide_upload_fields',10,2);   
     769function 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  
    4545}
    4646function 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;
    5049    $type = $post->post_type;
    5150    $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    }
    5456    $name = !empty($args['name'])? $args['name'] : 'edit-'.$type;
    5557    $url = ($args['id'] != 0)? get_permalink( $args['id'] ): get_permalink(get_page_by_path( $name ));
     
    115117        if (!mage_form_permission_cap($attr['user_role'])) return __('You do not have sufficient permission to use this form.','mage-forms');
    116118    }
     119    $attr = apply_filters('mage_forms_attr',$attr,$cast);
    117120} elseif (!empty($content)) $output .= $content;
    118121do_action('after_mage_form_element');
  • mage-forms/trunk/cast/diagrams.php

    r1633734 r1635652  
    280280    }
    281281    return false;
     282    //return $uploaded_file;
    282283}
    283284function mage_communicate(){
  • mage-forms/trunk/cast/mage-forms.php

    r1633734 r1635652  
    5050        //'form_post_edit'=>array('type'=>'checkbox'), // unknown
    5151    );
     52    $fields = apply_filters('mage_capture_mage_forms_fields',$fields);
    5253    foreach($fields as $field => $val) {
    5354        if ($val['type'] == 'checkbox'){
     
    411412    }
    412413    $output .= '</div>';
    413     return $output;
     414    return apply_filters('mage_forms_vessel_output',$output,$args);
    414415}
    415416function mage_get_forms() {
     
    425426    $cast = array();   
    426427    $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);
    427429    if (preg_match_all($fields, $content, $names)) {
    428430        $i = 0;     
     
    536538    $user = wp_get_current_user();
    537539    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();
    540542    $values = array(
    541543        'post_title' => '',
     
    564566    $args['post_status'] = $attr['post_status'];
    565567    $args['post_type'] = $attr['post_type'];   
    566     $custom_fields = $custom_data = $events = $raw_date = $custom_dates = $location = array();
    567 
    568568    if (is_array($fields)) {
    569569        foreach ($fields as $field) {
     
    572572                $val = $_POST[$field['name']];
    573573                if ($val !== 'yes') $val = '';
    574                 $custom_fields[$field['name']] = $val;
     574                $data['custom_fields'][$field['name']] = $val;
    575575            } elseif (array_key_exists($field['name'], $_POST)) {
    576576                $val = $_POST[$field['name']];
     
    578578                if (($field['req'] == 1 ) && empty($val)) {
    579579                    $name = is_array($field['name'])? implode(',',$field['name']): trim(strip_tags($field['name']));
    580                     $errors[] = $name;
     580                    $data['errors'][] = $name;
    581581                } else {
    582                     $custom_fields[$field['name']] = $val;
     582                    $data['custom_fields'][$field['name']] = $val;
    583583                }
    584584            } //array_key_exists
    585585        } //foreach
    586586    }
    587     if ($errors) return $errors;
     587    $data = apply_filters('mage_forms_submit_data',$data);
     588    if ($data['errors']) return $data['errors'];
    588589    $attach_id = isset( $_POST['mage_img_upload'] ) ? $_POST['mage_img_upload']: false;
    589590    do_action('before_mage_form_element');
     
    592593        unset($args['post_type']);
    593594        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'){
    598599            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');
    600601        }
    601602        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']);
    603604    }
    604605    if (!isset($args['ID'])){
     
    608609            mage_upload_attachments($post_id);
    609610            //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']);   
    612613            if ($attach_id) set_post_thumbnail( $post_id, $attach_id );
    613614            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'];
    615616            wp_redirect(get_permalink( $post_id ));
    616617            exit;
     
    625626            mage_upload_attachments($post_id);
    626627            //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']); 
    628629            if ( $attach_id ) set_post_thumbnail( $post_id, $attach_id );
    629630            attach_file_to_post($post_id);             
  • mage-forms/trunk/core/css/bootstrap.full.min.css

    r1361581 r1635652  
    327327  color: #428bca;
    328328  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;
    341329}
    342330
  • mage-forms/trunk/core/css/magecast.css

    r1361581 r1635652  
    431431.popover.left .arrow {left:auto;overflow:visible;margin-left:auto;bottom:auto;z-index:auto;}
    432432.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;}
    433434.mage-core-plugin, .mage-core-plugin img {opacity:0.5;}
    434435.mage-core-plugin.active, .mage-core-plugin.active img {opacity:1;}
     
    457458a.mage-core-btn {text-shadow: 0 1px 1px #ffffff;font-weight:bold;}
    458459a.mage-pro-active {color: #336699;}
     460a.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  
    8383    <form id="mage-form" method="post" class="form-horizontal" action="options.php">
    8484        <?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>       
    8686    </form>
    8787</div>
     
    217217    return $options;
    218218}
    219 if (!function_exists('fields')){
    220 function fields($page='',$opt_group='') {
     219if (!function_exists('mage_fields')){
     220function mage_fields($page='',$opt_group='') {
    221221    global $allowedtags;
    222222    $mage_settings = get_option('mage_'.$opt_group);
     
    274274            $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;                 
    275275        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;
    276283        case 'textarea':
    277284            $rows = isset($value['rows'])? $value['rows'] : '6';
    278285            $val = stripslashes( $val );
    279286            $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>';
    281288        break;
    282289        case 'select':         
     
    420427        break;
    421428        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>';
    424429            $output .= '<div class="row">';
     430            /* Addon Header content here... */
    425431            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.'">';
    430437                $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" />';
    432439                $output .= '<div class="caption mage-core-plugin-caption">';
    433440                $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>';             
    435443                $output .= '<div class="list-group">';
     444                $rel = 'target="_blank" rel="external"';
    436445                if($opt['active']){
    437446                    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>';     
    448450                            } else {
    449451                                $output .= '<a href="'.$in.'" class="list-group-item mage-core-btn" '.$rel.'>'.ucfirst($op).'</a>';
     
    452454                        }                       
    453455                    }                   
    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')){
    455460                    $url = mage_plugin_activation_url($option);
    456461                    $output .= '<a href="'.$url.'" class="list-group-item" title="'.esc_attr__('Activate ') .$opt['name']. '">Activate</a>';
    457                
    458462                } else {
    459463                    $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));
    460464                    $thick = is_main_site()? 'thickbox' : '';
    461465                    $output .= '<a href="'.$url.'" class="'.$thick.' list-group-item" title="'.esc_attr__('Install ') .$opt['name']. '">Install</a>';
    462                 }           
     466                } */           
    463467                $output .= '</div>';
    464468                $output .= '</div></div></div>';           
  • mage-forms/trunk/core/mage-sanitize.php

    r1633734 r1635652  
    7878    return $output;
    7979}
     80function 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  
    66 * Author:      Mage Cast
    77 * Author URI:  http://www.maximusbusiness.com/plugins/mage-forms-pro/
    8  * Version:     1.1.3
     8 * Version:     1.1.4
    99 * Text Domain: mage-forms
    1010 * Domain Path: /lang/
     
    1414<?php
    1515if (!defined('ABSPATH')) exit;
    16 define('MAGECAST_FORMS_VER', '1.1.3');
     16define('MAGECAST_FORMS_VER', '1.1.4');
    1717define('MAGECAST_FORMS', dirname( __FILE__ ). '/');
    1818define('MAGECAST_FORMS_URL',plugins_url('/',__FILE__));
  • mage-forms/trunk/readme.txt

    r1633736 r1635652  
    11=== Mage Front End Forms ===
    22Contributors: Maximilian Ruthe
    3 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PVZ7QRZJCZXLY
     3Donate link: https://www.paypal.me/maximusbusiness
    44Tags: form, forms, front-end, frontend, front, user, custom, admin, builder, tool, creator, manager, dashboard, post, submit, submission, mage
    55Requires at least: 3.0.1
    66Tested up to: 4.7
    7 Stable tag: 1.1.3
     7Stable tag: 1.1.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1313== Description ==
    1414
    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.
     15Mage 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.
    1716
    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 = 
     18You can create multiple forms for users to submit and edit posts, pages or any custom post type from the front-end.
    3019
    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 =
     21Allow 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.
    3322
     23= Frontend Featured Image and Attachment Uploads =
     24Upload 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 =
     27Choose 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 =
     30You 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 =
     33Mage 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           
    3440= Front End User Form Examples =
     41Mage 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
    3543* Guest Post forms and Multi-Author Blogs.
    3644* Online Business Directory with Listing/Address Submissions
     
    5260== Screenshots ==
    5361
    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").
     621. Snapshot of Dogsniffer Listing Forms
     632. A default Front End Post Form
     643. Creating Mage Forms in Admin Editor
    5665
    5766== 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
    5874
    5975= 1.1.3 =
     
    104120== Upgrade Notice ==
    105121
     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
    106129= 1.1.3 =
    107130* Featured Image and Attachment Upload improvements and fixes.
  • mage-forms/trunk/source/js/scribe.js

    r1633734 r1635652  
    9898                var resp = $.parseJSON(response.response);
    9999                //$('#' + file.id + " b").html("100%");
    100                 $('#' + file.id).remove();
     100               
    101101                if( resp.success ) {
    102102                    $('.mage-form-upload-thumbnail').append(resp.html);
    103103                    $('#mage-form-upload-button').hide();
     104                    $('#' + file.id).remove();
    104105                }
    105106            });
Note: See TracChangeset for help on using the changeset viewer.