public function verify_eventtypes() { for ($x = 3; $x <= evo_max_ett_count(); $x++) { if (!empty($this->cal->evopt1['evcal_ett_' . $x]) && $this->cal->evopt1['evcal_ett_' . $x] == 'yes') { $this->cal->event_types = $x + 1; } else { break; } } }
function eventon_add_tax() { $options = get_option('evcal_options_evcal_1'); for ($x = 3; $x <= evo_max_ett_count(); $x++) { if (!empty($options['evcal_ett_' . $x]) && $options['evcal_ett_' . $x] == 'yes') { add_filter("manage_edit-event_type_{$x}_columns", array($this, 'event_type_edit_columns'), 5); add_filter("manage_event_type_{$x}_custom_column", array($this, 'event_type_custom_columns'), 5, 3); } } }
function evo_get_ett_count($evopt = '') { $evopt = !empty($evopt) ? $evopt : get_option('evcal_options_evcal_1'); $maxnum = evo_max_ett_count(); $count = 2; for ($x = 3; $x <= $maxnum; $x++) { if (!empty($evopt['evcal_ett_' . $x]) && $evopt['evcal_ett_' . $x] == 'yes') { $count = $x; } else { break; } } return $count; }
function event_type_categories() { $etc = array(array('id' => 'evcal_fcx', 'type' => 'note', 'name' => __('Use this to assign custom names for the event type taxonomies which you can use to categorize events. Note: Once you update these custom taxonomies refresh the page for the values to show up.', 'eventon')), array('id' => 'evcal_eventt', 'type' => 'text', 'name' => __('Custom name for Event Type Category #1', 'eventon')), array('id' => 'evcal_eventt2', 'type' => 'text', 'name' => __('Custom name for Event Type Category #2', 'eventon')), array('id' => 'evcal_fcx', 'type' => 'note', 'name' => __('In order to add additional event type categories make sure you activate them in order. eg. Activate #4 after you activate #3', 'eventon'))); for ($x = 3; $x <= evo_max_ett_count(); $x++) { $etcx = array(array('id' => 'evcal_ett_' . $x, 'type' => 'yesno', 'name' => __('Activate Event Type Category #' . $x, 'eventon'), 'legend' => 'This will activate additional event type category.', 'afterstatement' => 'evcal_ett_' . $x), array('id' => 'evcal_ett_' . $x, 'type' => 'begin_afterstatement'), array('id' => 'evcal_eventt' . $x, 'type' => 'text', 'name' => __('Category Type Name', 'eventon')), array('id' => 'evcal_ett_' . $x, 'type' => 'end_afterstatement')); $etc = array_merge($etc, $etcx); } return $etc; }