// Make sure the current user has this capability
if (! current_user_can('activate_plugins')) {
- $this->addNotice("Interesting, you don't have permission to activate plugins.");
die();
}
}
- if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
- glmMembersAdmin::addNotice("Amenity added: name = $name, ID = $amenityID", 'DataBlock', "addAmenity()");
- }
-
return $amenityID;
}
}
- if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
- glmMembersAdmin::addNotice("Category added: name = $name, parent = $parent, ID = $categoryID", 'DataBlock', "addCategory()");
- }
-
return $categoryID;
}
if (!is_array($array) || count($array) == 0) {
return false;
}
-
+
// Do a sort by custom function with it included in the call
// This lets me directly use $name and $parent in the sort function
uasort($array, function ($a, $b) use ($name, $parent) {
;";
$list = $this->wpdb->get_results($sql, ARRAY_A);
- if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
- glmMembersAdmin::addNotice($sql, 'DataBlock', "DataAbstract - getListWithParents() query");
- glmMembersAdmin::addNotice($list, 'DataBlock', 'getListWithParents() data');
- }
-
return $list;
}
// Get new list and return it
$current = $this->getList($eventID);
- if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
- glmMembersAdmin::addNotice($current, 'DataBlock', 'Currently Selected Event Amenities');
- }
-
return $current;
}
;";
$list = $this->wpdb->get_results($sql, ARRAY_A);
- if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
- glmMembersAdmin::addNotice($sql, 'DataBlock', "DataAbstract - getListWithParents() query");
- glmMembersAdmin::addNotice($list, 'DataBlock', 'getListWithParents() data');
- }
-
return $list;
}
// Get new list and return it
$current = $this->getList($eventID);
- if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
- glmMembersAdmin::addNotice($current, 'DataBlock', 'Currently Selected Event Categories');
- }
-
return $current;
}
),
);
- if ( is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE ) {
- glmMembersAdmin::addNotice( $this->fields, 'DataBlock', 'Table Fields: '.$this->table );
- }
}
}
return $timesData;
}
-
+
/**
* Get recurances along with all times entries for a particular event ID
*
*/
public function getRecurWithTimes($eventID)
{
-
+
// Check for positive integer event ID
$eventID = ($eventID-0);
if ($eventID == 0) {
return false;
}
-
+
// Get all recurrences
$recurrences = $this->getList("T.event = $eventID", 'start_time');
$recurrences[$k]['times'] = $Times->getEventTimesByRecurrenceSimplified($v['id']);
}
}
-
+
return $recurrences;
-
+
}
}
*/
public function getEventTimesByRecurrenceSimplified($recurrenceID = false, $startDate = false, $endDate = false)
{
-
+
$savedFields = $this->fields;
-
+
$this->fields = array(
'id' => $savedFields['id'],
'start_time' => $savedFields['start_time'],
'end_time' => $savedFields['end_time'],
'all_day' => $savedFields['all_day']
);
-
+
$where = " T.recur_id = $recurrenceID ";
-
+
// Only display times from startDate to endDate
if (!$startDate) {
$startDate = date('Y-m-d H:i:s');
if ($endDate) {
$where .= " AND T.start_time <= '$endDate' ";
}
-
+
$timesSimplified = $this->getList($where, 'start_time');
$this->fields = $savedFields;
-
+
return $timesSimplified;
-
+
}
-
-
+
+
}
?>
$event_settings = $this->editEntry(1);
//echo '<pre>$event_settings: ' . print_r( $event_settings, true ) . '</pre>';
- if ($event_settings === false) {
-
- if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
- glmMembersAdmin::addNotice("<b> /models/admin/management/events.php: Unable to load events management settings.", 'Alert');
- }
-
- }
-
break;
}
$error = false;
$enable_members = $this->config['settings']['enable_members'];
$email_settings = false;
-
+
$email_settings = $this->getSettings();
// If there's an action option
case 'update':
$this->updateEntry($email_settings['id']);
-
+
break;
case 'new':
$this->insertEntry();
);
}
-
- if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
- glmMembersAdmin::addNotice($categories, 'DataBlock', 'Categories Data');
- }
-
// Compile template data
$templateData = array(
'enable_members' => $enable_members,
// Get a current list of amenities
$amenities = $this->getList();
- if ( GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE ) {
- glmMembersAdmin::addNotice( $amenities, 'DataBlock', 'Amenities Data' );
- }
// If we have list entries - even if it's an empty list
$success = true;
$haveAmenities = false;
);
}
- if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
- glmMembersAdmin::addNotice( $amenities, 'DataBlock', 'Amenities Data' );
- }
// Compile template data
$templateData = array(
'enable_members' => $enable_members,
// Get a current list of categories
$categories = $this->getList();
- if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
- glmMembersAdmin::addNotice($categories, 'DataBlock', 'Category Data');
- }
-
// If we have list entries - even if it's an empty list
$success = true;
$haveCategories = false;
// Sort results by hierarchy (Parent/Child and Alpha)
$categories = $this->sortParentChild($categories);
- if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
- glmMembersAdmin::addNotice($categories, 'DataBlock', 'Categories Data');
- }
-
// Compile template data
$templateData = array(
'enable_members' => $enable_members,