public static function unlabeled() { $label = Label::where('label', 'unlabeled')->get()->first(); if ($label == null) { $label = new Label(); $label->label = 'unlabeled'; $label->save(); } return $label; }
public function remove_label($id) { if (Auth::user() && $id) { Label::find($id)->delete(); } return Redirect::back(); }
public function deactivate($id) { $label = Label::find($id); $label->status = 0; $label->save(); return redirect('home/imagelabels'); }
/** * Run the database seeds. * * @return void */ public function run() { Model::unguard(); Label::create(['name' => 'favorite']); Label::create(['name' => 'trashed']); Setting::insert([['name' => 'homeTagline', 'value' => 'Syntropy Cloud, Your Cloud Your Way'], ['name' => 'homeByline', 'value' => 'Register or Login now to upload, backup, manage and access your files on any device, from anywhere, free.'], ['name' => 'homeButtonText', 'value' => 'Register Now'], ['name' => 'homepage', 'value' => 'landing'], ['name' => 'blacklist', 'value' => 'exe, application/x-msdownload, x-dosexec'], ['name' => 'maxFileSize', 'value' => 20], ['name' => 'maxUserSpace', 'value' => 104857600], ['name' => 'enableRegistration', 'value' => 1], ['name' => 'siteName', 'value' => 'CryptOffice'], ['name' => 'enableHomeUpload', 'value' => 1], ['name' => 'maxSimultUploads', 'value' => 10], ['name' => 'enablePushState', 'value' => 0], ['name' => 'dateLocale', 'value' => 'en'], ['name' => 'pushStateRootUrl', 'value' => '/'], ['name' => 'disqusShortname', 'value' => 'cryptoffice'], ['name' => 'enablePayments', 'value' => 1]]); }
public function actionDelete($id) { $user = Auth::user(); $label = Label::where('user_id', '=', $user->id)->findOrFail($id); $label->delete($label); \Session::flash('flash_message', 'You have successfully deleted a label.'); return redirect('labels'); }
public function edit_user($id) { $view = View::make('user.edit'); $view->title = 'Instellingen'; $view->user = User::find($id); $view->available_labels = Label::all()->lists("name", "id"); return $view; }
/** * Run the database seeds. * * @return void */ public function run() { $muse = new Artist(['name' => 'Muse', 'origin' => 'Teignmouth, Devon, England', 'activeFrom' => Carbon::create(1994), 'activeTo' => null, 'source' => 'wikipedia']); $muse->save(); $muse->labels()->attach([Label::where(['name' => 'Warner Bros.'])->first()->id, Label::where(['name' => 'Helium 3'])->first()->id, Label::where(['name' => 'Taste'])->first()->id, Label::where(['name' => 'Mushroom'])->first()->id, Label::where(['name' => 'East West'])->first()->id, Label::where(['name' => 'Dangerous'])->first()->id]); $radiohead = new Artist(['name' => 'Radiohead', 'origin' => 'Abingdon, Oxfordshire, England', 'activeFrom' => Carbon::create(1985), 'activeTo' => null, 'source' => 'wikipedia']); $radiohead->save(); $radiohead->labels()->attach([Label::where(['name' => 'XL'])->first()->id, Label::where(['name' => 'Ticker Tape Ltd.'])->first()->id, Label::where(['name' => 'Hostess'])->first()->id, Label::where(['name' => 'TBD'])->first()->id, Label::where(['name' => 'Parlophone'])->first()->id, Label::where(['name' => 'Capitol'])->first()->id]); $a7x = new Artist(['name' => 'Avenged Sevenfold', 'origin' => 'Huntington Beach, California, U.S.', 'activeFrom' => Carbon::create(1999), 'activeTo' => null, 'source' => 'wikipedia']); $a7x->save(); $a7x->labels()->attach([Label::where(['name' => 'Warner Bros.'])->first()->id, Label::where(['name' => 'Hopeless'])->first()->id, Label::where(['name' => 'Good Life'])->first()->id]); }
/** * Show the form for creating a new Cruiseline. * * @return View */ public function create() { $rankings = Ranking::where('rankable_type', '=', 'App\\Image')->get(); $labels = Label::where('status', '=', '1')->where('type', '=', 'Image')->orderBy('name', 'ASC')->get(); foreach ($labels as $label) { $images[$label['name']] = Image::where('status', '=', '1')->where('product', '=', 0)->where('label_id', '=', $label['id'])->orderBy('name', 'ASC')->lists('name', 'id'); } if (count($rankings)) { return view('galleryrankings.create', compact('images', 'rankings')); } return view('galleryrankings.create', compact('images')); }
/** * Detach label from photo. * * @return Response */ public function detach() { $label = Label::where('name', Input::get('label'))->firstOrFail(); $items = $this->splitFilesAndFolders(); if (count($items['files'])) { $label->files()->detach($items['files']); } if (count($items['folders'])) { $label->folders()->detach($items['folders']); } return response()->json(trans('app.' . Input::get('label') . 'DetachSuccess')); }
/** * Show the form for creating a new Cruiseline. * * @return View */ public function create() { $rankings = Ranking::where('rankable_type', '=', 'App\\Brochure')->get(); $labels = Label::where('status', '=', '1')->where('type', '=', 'Brochure')->orderBy('name', 'ASC')->get(); foreach ($labels as $label) { $brochures[$label['name']] = Brochure::where('status', '=', '1')->where('label_id', '=', $label['id'])->orderBy('name', 'ASC')->lists('name', 'id'); } if (count($rankings)) { return view('brochurerankings.create', compact('brochures', 'rankings')); } return view('brochurerankings.create', compact('brochures')); }
public function index(Request $request) { $label = null; $label_id = $request->input('label', null); if ($label_id != null) { $label = Label::find((int) $label_id); } if ($label == null) { $label = Label::unlabeled(); } $_labels = Label::orderBy('id', 'asc')->get(); $labels = array(); foreach ($_labels as $l) { $labels[$l->id] = $l; } return view('index', ['torrents' => Torrent::orderBy('time_added', 'desc')->where('label_id', $label->id)->get(), 'labels' => $labels, 'label' => $label]); }
/** * Run the database seeds. * * @return void */ public function run() { // muse Label::create(['name' => 'Warner Bros.']); Label::create(['name' => 'Helium 3']); Label::create(['name' => 'Taste']); Label::create(['name' => 'Mushroom']); Label::create(['name' => 'East West']); Label::create(['name' => 'Dangerous']); // radiohead Label::create(['name' => 'XL']); Label::create(['name' => 'Ticker Tape Ltd.']); Label::create(['name' => 'Hostess']); Label::create(['name' => 'TBD']); Label::create(['name' => 'Parlophone']); Label::create(['name' => 'Capitol']); // avenged sevengfold Label::create(['name' => 'Hopeless']); Label::create(['name' => 'Good Life']); }
public function brochures() { $this->data['brochures'] = Brochure::where('status', '=', 1)->get(); $this->data['labels'] = Label::where('status', '=', 1)->where('type', '=', 'Brochure')->get(); $data = $this->data; return view('brochures', $data); }
/** * Show the form for creating a new Cruiseline. * * @return View */ public function edit($id) { $colour = Colour::find($id); $labels = Label::where('status', '=', '1')->where('type', '=', 'Colour')->orderBy('name', 'ASC')->lists('name', 'id'); return view('colours.edit', compact('colour', 'labels')); }
/** * Show the form for creating a new Cruiseline. * * @return View */ public function edit($id) { $brochure = Brochure::find($id); $labels = Label::where('status', '=', '1')->where('type', '=', 'Brochure')->orderBy('name', 'ASC')->lists('name', 'id'); return view('brochures.edit', compact('brochure', 'labels')); }
/** * Show the form for creating a new Cruiseline. * * @return View */ public function edit($id) { $image = Image::find($id); $labels = Label::where('status', '=', '1')->where('type', '=', 'Image')->orderBy('name', 'ASC')->lists('name', 'id'); return view('galleries.edit', compact('image', 'labels')); }
public function show($id) { $labels = Label::find($id); $labels->load('artists'); return $labels; }
public function search($str) { $out = Label::where('name', 'LIKE', $str . '%')->get(['id', 'name']); return $out; }
private function updateTodoList() { foreach ($this->todos as $todo) { $cr_todo = Todo::where('todoist_id', $todo->id)->first(); if (!$cr_todo) { $cr_todo = new todo(); } if (isset($todo->id)) { $cr_todo->todoist_id = $todo->id; } if (isset($todo->user_id)) { $cr_todo->user_id = $todo->user_id; } if (isset($todo->content)) { $cr_todo->content = $todo->content; } if (isset($todo->due_date)) { $cr_todo->due_date = $todo->due_date; } if (isset($todo->day_order)) { $cr_todo->day_order = $todo->day_order; } if (isset($todo->assigned_by_uid)) { $cr_todo->assigned_by_uid = $todo->assigned_by_uid; } if (isset($todo->sync_id)) { $cr_todo->sync_id = $todo->sync_id; } if (isset($todo->in_history)) { $cr_todo->in_history = $todo->in_history; } if (isset($todo->date_added)) { $cr_todo->date_added = $todo->date_added; } if (isset($todo->checked)) { $cr_todo->checked = $todo->checked; } if (isset($todo->date_lang)) { $cr_todo->date_lang = $todo->date_lang; } if (isset($todo->indent)) { $cr_todo->indent = $todo->indent; } if (isset($todo->is_deleted)) { $cr_todo->is_deleted = $todo->is_deleted; } if (isset($todo->priority)) { $cr_todo->priority = $todo->priority; } if (isset($todo->responsible_uid)) { $cr_todo->responsible_uid = $todo->responsible_uid; } if (isset($todo->project_id)) { $cr_todo->project_id = $todo->project_id; } if (isset($todo->collapsed)) { $cr_todo->collapsed = $todo->collapsed; } //$cr_todo->date_string = $todo->date_string ; if (isset($todo->is_archived)) { $cr_todo->is_archived = $todo->is_archived; } if (isset($todo->item_order)) { $cr_todo->item_order = $todo->item_order; } //$cr_todo->due_date_utc = $todo->due_date_utc ; if (isset($todo->date_checked)) { $cr_todo->date_checked = $todo->date_checked; } $cr_todo->touch(); if (isset($cr_todo->is_deleted)) { if (!$cr_todo->is_deleted) { $cr_todo->save(); } else { $cr_todo->delete(); } } if (isset($todo->labels)) { foreach ($todo->labels as $label) { $label = Label::where('todoist_id', $label)->first(); $cr_todo->labels()->attach($label->id); } } } }
private function checkLabels($labels) { $user = Auth::user(); $currentLabels = array_filter($labels, 'is_numeric'); $newLabels = array_diff($labels, $currentLabels); foreach ($newLabels as $newLabel) { $label = Label::create(['name' => $newLabel]); $user->labels()->save($label); $currentLabels[] = $label->id; } return $currentLabels; }