function collect($module) { $this->name = $module->name; $this->id = $module->id; $this->type = $module->type; $this->options = unserialize($module->options); if (!is_array($this->options)) { $this->options = array(); } $this->groups = Red_Group::get_for_module($module->id); if (is_array($this->groups) && count($this->groups) > 0) { $pager = new RE_Pager($_GET, admin_url('redirection.php'), 'position', 'ASC', 'log'); $pager->per_page = 0; foreach ($this->groups as $pos => $group) { $this->groups[$pos]->items = Red_Item::get_by_group($group->id, $pager); } } else { $this->groups = array(); } return true; }
function reset() { Red_Module::clear_cache($this->id); $groups = Red_Group::get_for_module($this->id); if (count($groups) > 0) { foreach ($groups as $group) { $group->reset(); } } RE_Log::delete_for_module($this->id); }