public function run() { DB::table('filters')->delete(); $success = File::cleanDirectory($this->getImagesPath()); File::put($this->getImagesPath() . '.gitignore', File::get(public_path() . '/../app/storage/cache/.gitignore')); Filter::create(['name' => 'Fitness', 'poi_url' => 'http://happyfist.co/pois/pois/POI/gyms.kml', 'text' => 'lorem', 'paragraph_title' => 'ipsum']); Filter::create(['name' => 'Lodging', 'poi_url' => 'http://happyfist.co/pois/pois/POI/hotels.kml', 'text' => 'lorem', 'paragraph_title' => 'ipsum']); Filter::create(['name' => 'Culture', 'poi_url' => 'http://happyfist.co/pois/pois/POI/artMuseums.kml', 'text' => 'lorem', 'paragraph_title' => 'ipsum']); Filter::create(['name' => 'Entertainment', 'poi_url' => 'http://happyfist.co/pois/pois/POI/nightlife.kml', 'text' => 'lorem', 'paragraph_title' => 'ipsum']); Filter::create(['name' => 'Dinning', 'poi_url' => 'http://happyfist.co/pois/pois/POI/restaurants.kml', 'text' => 'lorem', 'paragraph_title' => 'ipsum']); Filter::create(['name' => 'Education', 'poi_url' => 'http://happyfist.co/pois/pois/POI/schools.kml', 'text' => 'lorem', 'paragraph_title' => 'ipsum']); Filter::create(['name' => 'Retail', 'poi_url' => 'http://happyfist.co/pois/pois/POI/shop-and-specialities.kml', 'text' => 'lorem', 'paragraph_title' => 'ipsum']); Filter::create(['name' => 'Transportation', 'poi_url' => 'http://happyfist.co/pois/pois/POI/transit.kml', 'text' => 'lorem', 'paragraph_title' => 'ipsum']); }
if ($filter && $filter->isSystemBanlist()) { header('Location: banlist.php'); } if ($_POST) { switch (strtolower($_POST['do'])) { case 'update': if (!$filter) { $errors['err'] = 'Unknown or invalid filter.'; } elseif ($filter->update($_POST, $errors)) { $msg = 'Filter updated successfully'; } elseif (!$errors['err']) { $errors['err'] = 'Error updating filter. Try again!'; } break; case 'add': if (Filter::create($_POST, $errors)) { $msg = 'Filter added successfully'; $_REQUEST['a'] = null; } elseif (!$errors['err']) { $errors['err'] = 'Unable to add filter. Correct error(s) below and try again.'; } break; case 'mass_process': if (!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { $errors['err'] = 'You must select at least one filter to process.'; } else { $count = count($_POST['ids']); if ($_POST['enable']) { $sql = 'UPDATE ' . EMAIL_FILTER_TABLE . ' SET isactive=1 WHERE id IN (' . implode(',', $_POST['ids']) . ')'; if (db_query($sql) && ($num = db_affected_rows())) { if ($num == $count) {
function createSystemBanList() { # XXX: Filter::create should return the ID!!! $errors = array(); return Filter::create(array('execorder' => 99, 'name' => 'SYSTEM BAN LIST', 'isactive' => 1, 'match_all_rules' => false, 'reject_ticket' => true, 'rules' => array(), 'notes' => __('Internal list for email banning. Do not remove')), $errors); }
public function run() { Filter::create(['name' => 'Employee MS Filter', 'active' => true]); Filter::create(['name' => 'Property MS Filter', 'active' => true]); Filter::create(['name' => 'Performance MS Filter', 'active' => true]); }