function custom_meta_fields()
    {
        // reused array parts
        $__additions_009_1 = apply_filters('eventon_cmd_field_types', array('text' => __('Single line Text', 'eventon'), 'textarea' => __('Multiple lines of text', 'eventon'), 'button' => __('Button', 'eventon')));
        // additional custom data fields
        for ($cm = 1; $cm < evo_max_cmd_count(); $cm++) {
            $__additions_009_a[$cm] = $cm;
        }
        // fields for each custom field
        $cmf_count = !empty($this->evcal_opt[1]['evcal_cmf_count']) ? $this->evcal_opt[1]['evcal_cmf_count'] : 3;
        $cmf_addition_x = array(array('id' => 'evcal__note', 'type' => 'note', 'name' => __('<b>NOTE: </b>Once new data field is activated go to <b>myEventon> Settings> EventCard</b> and rearrange the order of this new field and save changes for it to show on front-end. <br/>
				If you change field name for custom fields make sure it is updated in <b>myEventon > Language</b> as well.<br/>(* Required values)', 'eventon')), array('id' => 'evcal_cmf_count', 'type' => 'dropdown', 'name' => __('Number of Additional Custom Data Fields', 'eventon'), 'options' => $__additions_009_a, 'default' => 3));
        for ($cmf = 0; $cmf < $cmf_count; $cmf++) {
            $num = $cmf + 1;
            $cmf_addition = array(array('id' => 'evcal_af_' . $num, 'type' => 'yesno', 'name' => __('Activate Additional Field #' . $num, 'eventon'), 'legend' => 'This will activate additional event meta field.', 'afterstatement' => 'evcal_af_' . $num . ''), array('id' => 'evcal_af_' . $num, 'type' => 'begin_afterstatement'), array('id' => 'evcal_ec_f' . $num . 'a1', 'type' => 'text', 'name' => __('Field Name*', 'eventon')), array('id' => 'evcal_ec_f' . $num . 'a2', 'type' => 'dropdown', 'name' => __('Content Type', 'eventon'), 'options' => $__additions_009_1), array('id' => 'evcal__fai_00c' . $num . '', 'type' => 'icon', 'name' => __('Icon', 'eventon'), 'default' => 'fa-asterisk'), array('id' => 'evcal_ec_f' . $num . 'a3', 'type' => 'yesno', 'name' => __('Hide this field from front-end calendar', 'eventon')), array('id' => 'evcal_ec_f' . $num . 'a4', 'type' => 'dropdown', 'name' => __('Visibility Type', 'eventon'), 'options' => array('all' => 'Everyone', 'admin' => 'Admin Only', 'loggedin' => 'Logged-in Users Only')), array('id' => 'evcal_af_' . $num, 'type' => 'end_afterstatement'));
            $cmf_addition_x = array_merge($cmf_addition_x, $cmf_addition);
        }
        return $cmf_addition_x;
    }
Beispiel #2
0
function evo_calculate_cmd_count($evopt = '')
{
    $evopt = !empty($evopt) ? $evopt : get_option('evcal_options_evcal_1');
    $count = 0;
    for ($x = 1; $x < evo_max_cmd_count(); $x++) {
        if (!empty($evopt['evcal_af_' . $x]) && $evopt['evcal_af_' . $x] == 'yes' && !empty($evopt['evcal_ec_f' . $x . 'a1'])) {
            $count = $x;
        } else {
            break;
        }
    }
    return $count;
}