function collect($module) { $this->id = $module->id; $items = Red_Item::get_by_module($module->id); if (count($items) > 0) { foreach ($items as $item) { $this->items[] = array('source' => $item->url, 'target' => $item->action_type == 'url' ? $item->action_data : '', 'last_count' => $item->last_count); } } }
function collect($module) { $pager = new RE_Pager($_GET, admin_url('redirection.php'), 'name', 'DESC', 'log'); $pager->per_page = 0; $this->id = $module->id; $items = Red_Item::get_by_module($pager, $module->id); if (count($items) > 0) { foreach ($items as $item) { $this->items[] = array('source' => $item->url, 'target' => $item->action_type == 'url' ? $item->action_data : '', 'last_count' => $item->last_count); } } }
function collect($module) { include_once dirname(dirname(__FILE__)) . '/models/htaccess.php'; $this->htaccess = new Red_Htaccess($module); $this->name = $module->name; $this->id = $module->id; // Get the items $items = Red_Item::get_by_module($module->id); foreach ($items as $item) { $this->htaccess->add($item); } return true; }
function collect($module) { include_once dirname(__FILE__) . '/../models/htaccess.php'; $this->htaccess = new Red_Htaccess($module); $pager = new RE_Pager($_GET, admin_url('redirection.php'), 'name', 'DESC', 'log'); $pager->per_page = 0; $this->name = $module->name; $this->id = $module->id; // Get the items $items = Red_Item::get_by_module($pager, $module->id); foreach ($items as $item) { $this->htaccess->add($item); } return true; }
protected function flush_module() { include_once dirname(dirname(__FILE__)) . '/models/htaccess.php'; if (empty($this->location)) { return; } $items = Red_Item::get_by_module($this->get_id()); // Produce the .htaccess file $htaccess = new Red_Htaccess(); if (is_array($items) && count($items) > 0) { foreach ($items as $item) { if ($item->is_enabled()) { $htaccess->add($item); } } } return $htaccess->save($this->location); }
function collect($module) { $this->name = $module->name; $this->items = Red_Item::get_by_module($module->id); }